Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
PrintString:
|
||||
ld a,(hl) ;HL is our pointer to the string we want to print
|
||||
cp 0 ;it's better to use OR A to compare A to zero, but for demonstration purposes this is easier to read.
|
||||
ret z ;return if accumulator = zero
|
||||
call PrintChar ;prints accumulator's ascii code to screen - on Amstrad CPC for example this label points to memory address &BB5A
|
||||
inc hl ;next char
|
||||
jr PrintString ;jump back to the start of the loop. RET Z is our only exit.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
foo:
|
||||
push af
|
||||
bar:
|
||||
ld a,(hl)
|
||||
cp 255
|
||||
jr z,exit
|
||||
inc hl
|
||||
jr bar
|
||||
|
||||
exit:
|
||||
pop af
|
||||
ret
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
loop:
|
||||
;your code goes here
|
||||
DJNZ loop
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
_LDIR:
|
||||
ld a,(hl)
|
||||
ld (de),a
|
||||
inc hl
|
||||
inc de
|
||||
dec bc
|
||||
ld a,b
|
||||
or c ;compare BC to zero
|
||||
jr nz,_LDIR ;Game Boy doesn't have LDIR so you'll have to use this code instead.
|
||||
Loading…
Add table
Add a link
Reference in a new issue