Empty string: Difference between revisions

m
→‎{{header|68000 Assembly}}: assignment of empty string to a variable
m (→‎{{header|6502 Assembly}}: assignment of empty string to a variable)
m (→‎{{header|68000 Assembly}}: assignment of empty string to a variable)
Line 53:
EVEN</lang>
Checking if a string is empty is simple, just count the number of characters before you reach the terminator. If that count equals zero, the string is empty. Otherwise, the string is not empty.
<lang 68000devpac>LEA EmptyString,A0 ;assign the empty string to address register A0
getStringLength:
MOVE.L A0,-(SP) ;push A0 onto the stack. This will be used to check if the string is empty.
loop_getStringLength:
MOVE.B (A0)+,D0
1,489

edits