From 52d106571463d83865c3c54f27a8a35094dd4ebe Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Sun, 30 Aug 2020 01:49:38 -0700 Subject: [PATCH] Remove some buggy-but-dead code when parsing a hex number. --- src/shell/main.asm | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/shell/main.asm b/src/shell/main.asm index 7c797d7..d30cdac 100644 --- a/src/shell/main.asm +++ b/src/shell/main.asm @@ -294,9 +294,9 @@ wentD: nullcmd: rts nullentr: - .byte 'x',0 + .byte 'x',0 ; command name .addr nullcmd - .byte 0,0 ;no parms + .byte $FF ;no parms gdParms: .byte 1 @@ -957,19 +957,18 @@ overflow: lda #der_bignum bne der3 +; CLC if character is a digit, SEC otherwise chk_dig: - cmp #_'9'+1 - bcs chkdig_no cmp #_'0' bcc chkdig_no - clc + cmp #_'9'+1 rts chkdig_no: sec rts ; -; mult10um - multiply num (4 bytes) by 10 +; mult10num - multiply num (4 bytes) by 10 ; ; destroys temp (4 bytes) ; @@ -1023,16 +1022,8 @@ hex_1: pha jsr mult2num jsr mult2num pla - clc - adc num + ora num ;never overflows byte here sta num - bcc hnum_ok - inc num+1 ; the following long-standing BCC is buggy, but actually we can never get SEC here - bcc hnum_ok - inc num+2 - bne hnum_ok - jmp overflow -hnum_ok: jsr chrget jsr chk_hex bcc hex_1 @@ -1677,9 +1668,9 @@ cmdtbl: CommandName "spool" .addr go_spool .byte 0,t_wildpath -;dfb 'h',t_string ;header -;dfb 'l',t_int1 ;lines/page -;dfb 'w',t_int1 ;page width +;.byte 'h',t_string ;header +;.byte 'l',t_int1 ;lines/page +;.byte 'w',t_int1 ;page width .byte 'x',t_int1 ;cancel 1 .byte 'z',t_nil ;zap (cancel all) NoMoreParameters