apps/memt: new app
This commit is contained in:
parent
7c23e5a9ef
commit
5e31de0bac
20
apps/memt/glue.asm
Normal file
20
apps/memt/glue.asm
Normal file
@ -0,0 +1,20 @@
|
||||
; memt
|
||||
;
|
||||
; Write all possible values in all possible addresses that follow the end of
|
||||
; this program. That means we don't test all available RAM, but well, still
|
||||
; better than nothing...
|
||||
;
|
||||
; If there's an error, prints out where.
|
||||
;
|
||||
; *** Requirements ***
|
||||
; printstr
|
||||
; printHexPair
|
||||
;
|
||||
; *** Includes ***
|
||||
|
||||
#include "user.h"
|
||||
.org USER_CODE
|
||||
|
||||
jp memtMain
|
||||
|
||||
#include "memt/main.asm"
|
33
apps/memt/main.asm
Normal file
33
apps/memt/main.asm
Normal file
@ -0,0 +1,33 @@
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user