Strona działa najlepiej z włączonym JavaScript.
Strona główna
Odkrywaj
lain.church
Pomoc
Zarejestruj się
Zaloguj się
izaya
/
collapseos
kopia lustrzana
https://github.com/hsoft/collapseos.git
Obserwuj
1
Polub
1
Forkuj
0
Kod
Zgłoszenia
0
Wydania
0
Wiki
Aktywność
Przeglądaj źródła
Add missing common.asm test harness file
pull/85/head
Virgil Dupras
4 lat temu
rodzic
cc754e12aa
commit
aef96c5e96
1 zmienionych plików
z
62 dodań
i
0 usunięć
Widok podzielony
Opcje porównania
Pokaż statystyki
Ściągnij plik aktualizacji
Ściągnij plik porównania
+62
-0
tools/tests/unit/common.asm
+ 62
- 0
tools/tests/unit/common.asm
Wyświetl plik
@@ -0,0 +1,62 @@
; *** requirements ***
; ascii.h
; core
; stdio
; lib/ari
; lib/fmt
testNum: .db 1
STDIO_PUTC:
out (0), a
cp a
ret
STDIO_GETC:
jp unsetZ
assertZ:
ret z
ld hl, .msg
call printstr
jp fail
.msg:
.db "Z not set", CR, LF, 0
assertNZ:
ret nz
ld hl, .msg
call printstr
jp fail
.msg:
.db "Z set", CR, LF, 0
; Assert that HL == DE
assertEQW:
ld a, h
cp d
jr nz, .fail
ld a, l
cp e
ret z
.fail:
call printHexPair
call printcrlf
ex de, hl
call printHexPair
call printcrlf
ld hl, .msg
call printstr
jp fail
.msg:
.db "HL != DE", CR, LF, 0
nexttest:
ld a, (testNum)
inc a
ld (testNum), a
ret
fail:
ld a, (testNum)
halt
Napisz
Podgląd
Ładowanie…
Anuluj
Zapisz