08-07-2017, 08:45 AM
ivanb303 Wrote:That code is ok... except that once the loop is finished de CPU will run into your DEFB udg 1 and will execute those bytes as if they were assembler instructions.Code:ASM
LD HL, 65368
LD DE, DATA
LD B,56 <-- I have 7 characters
LOOP:
LD A,(DATA)
LD (HL),A
INC HL
INC DE
DEC B
JR NZ,LOOP
DATA:
DEFB udg 1 ; <--- LOOK OUT
DEFB udg 2
etcc...
END ASM
You should jump somewhere else, RETurn or something.