Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Empty-string/Z80-Assembly/empty-string-1.z80
Normal file
2
Task/Empty-string/Z80-Assembly/empty-string-1.z80
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
EmptyString:
|
||||
byte 0
|
||||
17
Task/Empty-string/Z80-Assembly/empty-string-2.z80
Normal file
17
Task/Empty-string/Z80-Assembly/empty-string-2.z80
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
ld hl,MyString
|
||||
|
||||
GetStringLength:
|
||||
ld b,0 ;zero the length counter
|
||||
loop_getStringLength:
|
||||
ld a,(hl)
|
||||
or a ;compare A to zero
|
||||
ret z ;exit if zero
|
||||
|
||||
inc hl ;next char
|
||||
inc b ;add 1 to length counter
|
||||
jr loop_getStringLength
|
||||
|
||||
ld a,b ;load B into A
|
||||
or a ;compare A to zero (effectively comparing B to zero)
|
||||
jr z,StringIsEmpty
|
||||
;your code for what happens when MyString is not empty goes here.
|
||||
Loading…
Add table
Add a link
Reference in a new issue