Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/String-length/6502-Assembly/string-length.6502
Normal file
12
Task/String-length/6502-Assembly/string-length.6502
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
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.)
|
||||
LDY #0 ;Y is both the index into the string and the length counter.
|
||||
|
||||
loop_getStringLength:
|
||||
LDA ($00),y
|
||||
BEQ exit
|
||||
INY
|
||||
JMP loop_getStringLength
|
||||
|
||||
exit:
|
||||
RTS ;string length is now loaded into Y.
|
||||
Loading…
Add table
Add a link
Reference in a new issue