String length: Difference between revisions
→{{header|68000 Assembly}}
(added ReScript) |
Puppydrum64 (talk | contribs) |
||
Line 79:
exit:
RTS ;string length is now loaded into Y.</lang>
=={{header|68000 Assembly}}==
===Byte Length (ASCII)===
<lang 68000devpac>GetStringLength:
; INPUT: A3 = BASE ADDRESS OF STRING
; RETURNS LENGTH IN D1 (MEASURED IN BYTES)
MOVE.L #0,D1
loop_getStringLength:
MOVE.B (A3)+,D0
CMP #0,D0
BEQ done
ADDQ.L #1,D1
BRA loop_getStringLength
done:
MOVE.B -(A3),D0 ;dummy move to point A3 to the last char rather than the terminator, which is much more useful
RTS</lang>
=={{header|4D}}==
|