URL
https://opencores.org/ocsvn/6809_6309_compatible_core/6809_6309_compatible_core/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 7 |
Rev 18 |
|
|
; simple instruction excerciser
|
; simple instruction excerciser
|
|
|
|
lds #$00ff
|
|
andcc #$af ; enable interrupts
|
ldd #$AABB
|
ldd #$AABB
|
mul
|
mul
|
ldx #$1234
|
ldx #$1234
|
ldy #$5678
|
ldy #$5678
|
exg a,b
|
exg a,b
|
;exg a,x
|
;exg a,x
|
exg y,x
|
exg y,x
|
tfr x,u ; 16 bit transfer
|
tfr x,u ; 16 bit transfer
|
tfr a,u ; high to high
|
tfr a,u ; high to high
|
tfr b,u
|
tfr b,u
|
tfr x,a ; gets high byte
|
tfr x,a ; gets high byte
|
tfr x,b ; gets low byte
|
tfr x,b ; gets low byte
|
bra eatests
|
bra eatests
|
addr: fcb 0, 4 ; an address
|
addr: fcb 0, 4 ; an address
|
|
|
eatests: lda #$02
|
eatests: lda #$02
|
ldb #$00
|
ldb #$00
|
sta $0
|
sta $0
|
stb $1
|
stb $1
|
ldx $0 ; load saved value
|
ldx $0 ; load saved value
|
ldy #$0
|
ldy #$0
|
cmpx ,y ; compare
|
cmpx ,y ; compare
|
beq test_push_pull
|
beq test_push_pull
|
|
|
error: bra error
|
error: bra error
|
|
|
test_push_pull: lds #$00ff
|
test_push_pull: lds #$00ff
|
pshs a,b
|
pshs a,b
|
puls x
|
puls x
|
cmpx ,y ; compare again
|
cmpx ,y ; compare again
|
bne error
|
bne error
|
|
|
bsr test_bsr
|
bsr test_bsr
|
bne error ; push/pull with sub don't work
|
bne error ; push/pull with sub don't work
|
lbsr test_lea
|
lbsr test_lea
|
bne error
|
bne error
|
ok: bra ok
|
ok: bra ok
|
|
|
test_bsr: pshs y
|
test_bsr: pshs y
|
puls y
|
puls y
|
cmpx 0,y
|
cmpx 0,y
|
rts
|
rts
|
|
|
test_lea: leau 1,y
|
test_lea: leau 1,y
|
leay 0,y
|
leay 0,y
|
rts
|
rts
|
|
|
_boot: ldx #100
|
_boot: ldx #100
|
_loop0: ldd #$4100
|
_loop0: ldd #$4100
|
_loop1: sta b,x
|
_loop1: sta b,x
|
incb
|
incb
|
cmpb #16
|
cmpb #16
|
bne _loop1
|
bne _loop1
|
inca
|
inca
|
_loop2: incb
|
_loop2: incb
|
bne _loop2 ; delay
|
bne _loop2 ; delay
|
cmpa #128
|
cmpa #128
|
beq _loop1 ; another row of characters
|
beq _loop1 ; another row of characters
|
bra _loop0
|
bra _loop0
|
|
|
|
_interrupt: nop
|
|
nop
|
|
rti
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.