Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Literals-String/Z80-Assembly/literals-string-1.z80
Normal file
1
Task/Literals-String/Z80-Assembly/literals-string-1.z80
Normal file
|
|
@ -0,0 +1 @@
|
|||
db "Hello World"
|
||||
2
Task/Literals-String/Z80-Assembly/literals-string-2.z80
Normal file
2
Task/Literals-String/Z80-Assembly/literals-string-2.z80
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
db "Hello World"
|
||||
db $48,$65,$6c,$6c,$6f,$20,$57,$6f,$72,$6c,$64
|
||||
1
Task/Literals-String/Z80-Assembly/literals-string-3.z80
Normal file
1
Task/Literals-String/Z80-Assembly/literals-string-3.z80
Normal file
|
|
@ -0,0 +1 @@
|
|||
db "Hello World",13,10,0
|
||||
21
Task/Literals-String/Z80-Assembly/literals-string-4.z80
Normal file
21
Task/Literals-String/Z80-Assembly/literals-string-4.z80
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
PrintString:
|
||||
; HL contains the pointer to the string literal.
|
||||
ld a,(hl)
|
||||
or a ;compares to zero quicker than "CP 0"
|
||||
ret z ;we're done printing the string, so exit.
|
||||
cp '\' ; a single ascii character is specified in single quotes. This compares A to the backslash's ASCII value.
|
||||
jr z,HandleSpecialChars ; if accumulator = '\' then goto "HandleSpecialChars"
|
||||
call PrintChar ;unimplemented print routine, depending on the system this is either a BIOS call
|
||||
; or a routine written by the programmer.
|
||||
|
||||
inc hl ;next character
|
||||
jr PrintString ;back to top
|
||||
|
||||
|
||||
HandleSpecialChars:
|
||||
inc hl ;next char
|
||||
ld a,(hl)
|
||||
cp 'n'
|
||||
call z,NewLine ;unimplemented routine, advances text cursor to next line. Only called if accumulator = 'n'.
|
||||
inc hl ;advance past the 'n' to the next char.
|
||||
jr PrintString ;jump back to top. Notice that neither the backslash nor the character after it were actually printed.
|
||||
Loading…
Add table
Add a link
Reference in a new issue