INMC News |
Spring 1979 · Issue 2 |
Page 5 of 18 |
---|
And it only takes four bytes!
EF RST 28H 48 45 4C 4C 4F DEFM /HELLO/ 00 DEFB 0
These seven bytes will make the message ‘HELLO’ be displayed. Don’t forget to put the value 00 at the end of the message, or the screen will fill up with the contents of the rest of your program!
AF XOR A Set A to 0 06 00 LD B,0 Set B to 0 3C LABL INC A Increment A 27 DAA Decimal adjust 10 FC DJNZ LABL Repeat, 256 times. E7 RST BRKPT Display registers.
Now A has been incremented 256 times, and the DAA instruction makes this work in decimal, so A should be 56 at the end. Why isn’t it, and how would you correct the program? (No, the Z80 doesn’t have a fault in it!)
/ .. ..
Page 5 of 18 |
---|