From 3ab4f385acae30b8131b0e3d96d64fb1f111ed2e Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Sun, 28 Apr 2019 21:36:33 +0930 Subject: [PATCH] fix printing of integers and BASIC free bytes on startup --- c64/basic/basic_cold_start.s | 2 +- c64/basic/print_integer.s | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 7f399c7d..cab62ebd 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -20,7 +20,7 @@ basic_cold_start: tax lda basic_top_of_memory_ptr+1 sbc basic_end_of_text_ptr+1 - + jsr print_integer lda #$20 diff --git a/c64/basic/print_integer.s b/c64/basic/print_integer.s index 1d80e09a..8e1c1f8a 100644 --- a/c64/basic/print_integer.s +++ b/c64/basic/print_integer.s @@ -73,12 +73,13 @@ bit_clear_hi: dey dey dey + dey + dey next_hi_bit: asl cpy #$7f bcc hi_loop - - + ;; Deal with any carries ldx #3 carry_fix_loop: @@ -94,15 +95,10 @@ carry_fix_loop: bpl carry_fix_loop post_carry: - + ;; Got digits. ;; Skip leading zeros, and print the resulting number - ldx #4 -* lda $0100,x - dex - bpl - - ;; Skip leading zeros ldy #0 * lda $0100,y