Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
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