There's a not really important bug in the EXEPRFIX.ASM assembly example, but it may drive a beginner mad. In the PRINTNUM routine, Tens overwrite Hundreds when preparing the print area for numbers between 0 to 255 (there's no routine for 16 bit numbers, though). This is (part of) the code:
ADD A,100
LD (HL),C
NUMB LD C,"0"-1
When, later, C is again put at (HL), without first incrementing HL! One solution could be:
ADD A,100
LD (HL),C
INC HL
NUMB LD C,"0"-1
That is, add a INC HL instruction before entering the NUMB label (this would make the EXE one byte longer).
This is a not really important bug because the command line cannot be longer than 128 (decimal) characters, and the biggest correct number printed by the routine without the correction would be 99 (decimal). I really doubt anyone tested this with such a long command line!
Marcelo.
----------------------------------
Speccy rules, its staff is Sprinter.
|