String length: Difference between revisions

Content added Content deleted
Line 69: Line 69:
<lang 6502asm>GetStringLength: ;$00 and $01 make up the pointer to the string's base address.
<lang 6502asm>GetStringLength: ;$00 and $01 make up the pointer to the string's base address.
;(Of course, any two consecutive zero-page memory locations can fulfill this role.)
;(Of course, any two consecutive zero-page memory locations can fulfill this role.)
LDY #0 ;Y doubles as the pointer to the chars in the string and our length counter
LDY #0 ;Y is both the index into the string and the length counter.


loop_getStringLength:
loop_getStringLength: