mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
36 lines
368 B
NASM
36 lines
368 B
NASM
|
CompareBytes::
|
||
|
; Compare c bytes at de and hl.
|
||
|
; Return z if they all match.
|
||
|
.loop
|
||
|
ld a, [de]
|
||
|
cp [hl]
|
||
|
ret nz
|
||
|
inc de
|
||
|
inc hl
|
||
|
dec c
|
||
|
jr nz, .loop
|
||
|
ret
|
||
|
|
||
|
CompareBytesLong::
|
||
|
; Compare bc bytes at de and hl.
|
||
|
; Return carry if they all match.
|
||
|
.loop
|
||
|
ld a, [de]
|
||
|
cp [hl]
|
||
|
jr nz, .diff
|
||
|
|
||
|
inc de
|
||
|
inc hl
|
||
|
dec bc
|
||
|
|
||
|
ld a, b
|
||
|
or c
|
||
|
jr nz, .loop
|
||
|
|
||
|
scf
|
||
|
ret
|
||
|
|
||
|
.diff:
|
||
|
and a
|
||
|
ret
|