diff --git a/tests/asm/06-formatting.asm b/tests/asm/06-formatting.asm index f8533d8..b15f805 100644 --- a/tests/asm/06-formatting.asm +++ b/tests/asm/06-formatting.asm @@ -12,4 +12,5 @@ foo: .inCLUde "06.inc.asm" ayy: lmao: di + InC a ret diff --git a/tests/asm/08-instructions.asm b/tests/asm/08-instructions.asm index 3ecdba0..a9859b6 100644 --- a/tests/asm/08-instructions.asm +++ b/tests/asm/08-instructions.asm @@ -5,3 +5,99 @@ ; 08-instructions.asm ; Exhaustive test of instruction syntax + +.define COUNTER $C010 +.define OFFSET 6 +.define OFFSET2 157 + +.org $1000 + +str1: .ascii "Hello, world!" + +.org $0000 +main: + di + call inst + halt + +.org $0066 +nmi: + retn + +.org $2000 +inst: + inc a + inc c + inc hl + inc sp + inc (hl) + inc ( hl ) + inc ix + inc iyl + inc (ix) + inc ( ix ) + inc (iy+0) + inc (ix+3) + inc (ix+OFFSET) + inc (ix-OFFSET) + inc ( ix + 7 ) + inc (ix-8) + inc (ix - +9) + inc (iy+127) + inc (iy-128) + + add a, e + add a, 5 + add a, $12 + add a, (hl) + add a, (ix+4) + add hl, bc + add ix, de + + adc a, e + adc a, 5 + adc a, $12 + adc a, (hl) + adc a, (ix+4) + adc hl, bc + + rlca + rrca + rla + rra + daa + cpl + scf + ccf + halt + exx + ei + di + cpd + cpdr + cpi + cpir + ind + indr + ini + inir + ldd + lddr + ldi + ldir + otdr + otir + outd + outi + rrd + rld + + ld hl, COUNTER ; H contains $C0, L contains $10 + ld d, (hl) ; D contains $FF (garbage) + ld c, $3B ; C contains $3B + ld (hl), c ; memory address $C010 contains $3B + + ld hl, str1 + ld b, (hl) ; B contains 'H' + ld hl, (str1) ; H contains 'e', L contains 'H' + ld (hl), b ; error, writing to cartridge ROM diff --git a/tests/asm/manifest b/tests/asm/manifest index 2a0f414..75a5147 100644 --- a/tests/asm/manifest +++ b/tests/asm/manifest @@ -5,3 +5,4 @@ 05-includes.asm 05-includes.gg 06-formatting.asm 06-formatting.gg 07-data.asm 07-data.gg +08-instructions.asm 08-instructions.gg diff --git a/tests/asm/roms.tar.gz b/tests/asm/roms.tar.gz index e86fb67..10d3d10 100644 Binary files a/tests/asm/roms.tar.gz and b/tests/asm/roms.tar.gz differ