Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
3
Task/Empty-string/68000-Assembly/empty-string-1.68000
Normal file
3
Task/Empty-string/68000-Assembly/empty-string-1.68000
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
EmptyString:
|
||||
DC.B 0
|
||||
EVEN
|
||||
14
Task/Empty-string/68000-Assembly/empty-string-2.68000
Normal file
14
Task/Empty-string/68000-Assembly/empty-string-2.68000
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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
|
||||
BEQ Terminated
|
||||
JMP loop_getStringLength
|
||||
|
||||
SUBQ.L #1,A0 ;after the terminator is read, A0 is incremented to point to the byte after it. This fixes that.
|
||||
CMP.L A0,(SP) ;compare the current A0 with the original value.
|
||||
BEQ StringIsEmpty ;if they are equal, then nothing was read besides the terminator. Therefore the string is empty.
|
||||
;if the above branch wasn't taken, the string is not empty and execution arrives here.
|
||||
Loading…
Add table
Add a link
Reference in a new issue