Selaa lähdekoodia

Add ASM instruction test.

master
Ben Kurtovic 8 vuotta sitten
vanhempi
commit
c8ecf01600
4 muutettua tiedostoa jossa 98 lisäystä ja 0 poistoa
  1. +1
    -0
      tests/asm/06-formatting.asm
  2. +96
    -0
      tests/asm/08-instructions.asm
  3. +1
    -0
      tests/asm/manifest
  4. BIN
     

+ 1
- 0
tests/asm/06-formatting.asm Näytä tiedosto

@@ -12,4 +12,5 @@ foo: .inCLUde "06.inc.asm"

ayy: lmao:
di
InC a
ret

+ 96
- 0
tests/asm/08-instructions.asm Näytä tiedosto

@@ -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

+ 1
- 0
tests/asm/manifest Näytä tiedosto

@@ -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


Ladataan…
Peruuta
Tallenna