Jump to content

String length: Difference between revisions

(added ReScript)
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}}==
1,489

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.