1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-21 02:08:05 +11:00
collapseos/apps/memt/main.asm

34 lines
445 B
NASM
Raw Normal View History

2019-06-17 10:53:21 +10:00
memtMain:
ld de, memtEnd
.loop:
ld b, 0
.iloop:
ld a, b
ld (de), a
ld a, (de)
cp b
jr nz, .notMatching
djnz .iloop
inc de
xor a
cp d
jr nz, .loop
cp e
jr nz, .loop
; we rolled over 0xffff, stop
ld hl, .sOk
xor a
jp printstr ; returns
.notMatching:
ld hl, .sNotMatching
call printstr
ex de, hl
ld a, 1
jp printHexPair ; returns
.sNotMatching:
.db "Not matching at pos ", 0xd, 0xa, 0
.sOk:
.db "OK", 0xd, 0xa, 0
memtEnd: