From 72a9e331e3d4f741c7be8ee2f12be283ca48b373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Sat, 14 Mar 2015 00:01:12 +0100 Subject: [PATCH 1/3] Fixed uninitialized use of low byte of address "load". --- cfg/osic1p-asm.cfg | 2 +- cfg/osic1p.cfg | 2 +- libsrc/osic1p/bootstrap.s | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cfg/osic1p-asm.cfg b/cfg/osic1p-asm.cfg index d8a2626f1..4000890be 100644 --- a/cfg/osic1p-asm.cfg +++ b/cfg/osic1p-asm.cfg @@ -11,7 +11,7 @@ SYMBOLS { MEMORY { # for size of ZP, see runtime/zeropage.s and c1p/extzp.s ZP: file = "", define = yes, start = $0002, size = $001A + $0006; - HEAD: file = %O, start = $0000, size = $00AA; + HEAD: file = %O, start = $0000, size = $00B6; RAM: file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S; } SEGMENTS { diff --git a/cfg/osic1p.cfg b/cfg/osic1p.cfg index 17109adf0..b05eeb3d5 100644 --- a/cfg/osic1p.cfg +++ b/cfg/osic1p.cfg @@ -11,7 +11,7 @@ SYMBOLS { MEMORY { # for size of ZP, see runtime/zeropage.s and c1p/extzp.s ZP: file = "", define = yes, start = $0002, size = $001A + $0006; - HEAD: file = %O, start = $0000, size = $00AA; + HEAD: file = %O, start = $0000, size = $00B6; RAM: file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S; } SEGMENTS { diff --git a/libsrc/osic1p/bootstrap.s b/libsrc/osic1p/bootstrap.s index 5116cc15a..b7c10a525 100644 --- a/libsrc/osic1p/bootstrap.s +++ b/libsrc/osic1p/bootstrap.s @@ -45,6 +45,8 @@ GETCHAR := $FFBF ; gets one character from ACIA FIRSTVISC = $85 ; Offset of first visible character in video RAM LINEDIST = $20 ; Offset in video RAM between two lines + lda #0 + sta load lda #load_addr tay @@ -105,6 +107,8 @@ CR = $0D ; ASCII-coded hexadecimal translation of the above assembly code. ; It was copied from the assembler listing. + .byte "A9", CR, "00", CR + .byte "85", CR, "08", CR .byte "A9", CR hex2 Date: Sat, 14 Mar 2015 00:06:00 +0100 Subject: [PATCH 2/3] Fix bad tabbing --- libsrc/osic1p/bootstrap.s | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/osic1p/bootstrap.s b/libsrc/osic1p/bootstrap.s index b7c10a525..806532791 100644 --- a/libsrc/osic1p/bootstrap.s +++ b/libsrc/osic1p/bootstrap.s @@ -45,8 +45,8 @@ GETCHAR := $FFBF ; gets one character from ACIA FIRSTVISC = $85 ; Offset of first visible character in video RAM LINEDIST = $20 ; Offset in video RAM between two lines - lda #0 - sta load + lda #0 + sta load lda #load_addr tay From 8b10534429a769a64a03e021d0d86a59bc98954b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Sun, 15 Mar 2015 00:40:42 +0100 Subject: [PATCH 3/3] Improved fix with suggestions by Greg King. --- libsrc/osic1p/bootstrap.s | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libsrc/osic1p/bootstrap.s b/libsrc/osic1p/bootstrap.s index 806532791..2a501b980 100644 --- a/libsrc/osic1p/bootstrap.s +++ b/libsrc/osic1p/bootstrap.s @@ -45,11 +45,10 @@ GETCHAR := $FFBF ; gets one character from ACIA FIRSTVISC = $85 ; Offset of first visible character in video RAM LINEDIST = $20 ; Offset in video RAM between two lines - lda #0 - sta load + ldy #<$0000 lda #load_addr - tay + sta load stx load+1 lda #load_addr - .byte CR, "A8", CR + .byte CR, "85", CR, "08", CR .byte "86", CR, "09", CR .byte "A9", CR hex2