Literals/String: Difference between revisions

Content added Content deleted
m (→‎{{header|6502 Assembly}}: forgot to close language)
m (→‎{{header|6502 Assembly}}: formatting for additional clarity. Why doesn't 6502 highlight opcodes?)
Line 53: Line 53:
iny ;next character
iny ;next character
jmp PrintString ;back to top
jmp PrintString ;back to top

Terminated:
Terminated:
rts ;exit
rts ;exit

HandleSpecialChars:
HandleSpecialChars:
iny ;next char
iny ;next char
lda (StringPtr),y
lda (StringPtr),y
cmp #'n'
cmp #'n'
beq NextLine ;unimplemented new line routine, it ends in "JMP DoneSpecialChar"
beq NextLine ;unimplemented new line routine, it ends in "JMP DoneSpecialChar."
;Typically this would reset the x cursor and increment the y cursor, which are software variables that
DoneSpecialChar
;get converted to a VRAM address in some other routine.
DoneSpecialChar:
iny
iny
jmp PrintString ;jump back to top. Notice that neither the backslash nor the character after it were actually printed.</lang>
jmp PrintString ;jump back to top. Notice that neither the backslash nor the character after it were actually printed.</lang>