;; *******************************************************************
|
;; *******************************************************************
|
;; $Id: test.asm,v 1.1.1.1 2006-05-06 01:56:45 arniml Exp $
|
;; $Id: test.asm,v 1.1.1.1 2006-05-06 01:56:45 arniml Exp $
|
;;
|
;;
|
;; Checks the LD instruction.
|
;; Checks the LD instruction.
|
;; Br can't be observed directly via XABR on COP41x.
|
;; Br can't be observed directly via XABR on COP41x.
|
;; Therefore, Br address os observed indirectly via memory content.
|
;; Therefore, Br address os observed indirectly via memory content.
|
;;
|
;;
|
|
|
;; the cpu type is defined on asl's command line
|
;; the cpu type is defined on asl's command line
|
|
|
org 0x00
|
org 0x00
|
clra
|
clra
|
|
|
;; preload for digit of each data register
|
;; preload for digit of each data register
|
;; Br = 0 -> data = 0x1
|
;; Br = 0 -> data = 0x1
|
lbi 0x0, 0x0
|
lbi 0x0, 0x0
|
stii 0x1
|
stii 0x1
|
;; Br = 1 -> data = 0x2
|
;; Br = 1 -> data = 0x2
|
lbi 0x1, 0x0
|
lbi 0x1, 0x0
|
stii 0x2
|
stii 0x2
|
;; Br = 2 -> data = 0x3
|
;; Br = 2 -> data = 0x3
|
lbi 0x2, 0x0
|
lbi 0x2, 0x0
|
stii 0x3
|
stii 0x3
|
;; Br = 3 -> data = 0x4
|
;; Br = 3 -> data = 0x4
|
lbi 0x3, 0x0
|
lbi 0x3, 0x0
|
stii 0x4
|
stii 0x4
|
|
|
;; *******************************************************************
|
;; *******************************************************************
|
;; XOR 0
|
;; XOR 0
|
;;
|
;;
|
;; Br(0) xor 0
|
;; Br(0) xor 0
|
lbi 0x0, 0x0
|
lbi 0x0, 0x0
|
ld 0x0
|
ld 0x0
|
ske ; expect no change of Br
|
ske ; expect no change of Br
|
jmp fail
|
jmp fail
|
|
|
;; Br(1) xor 0
|
;; Br(1) xor 0
|
lbi 0x1, 0x0
|
lbi 0x1, 0x0
|
ld 0x0
|
ld 0x0
|
ske ; expect no change of Br
|
ske ; expect no change of Br
|
jmp fail
|
jmp fail
|
|
|
;; Br(2) xor 0
|
;; Br(2) xor 0
|
lbi 0x2, 0x0
|
lbi 0x2, 0x0
|
ld 0x0
|
ld 0x0
|
ske ; expect no change of Br
|
ske ; expect no change of Br
|
jmp fail
|
jmp fail
|
|
|
;; Br(3) xor 0
|
;; Br(3) xor 0
|
lbi 0x3, 0x0
|
lbi 0x3, 0x0
|
ld 0x0
|
ld 0x0
|
ske ; expect no change of Br
|
ske ; expect no change of Br
|
jmp fail
|
jmp fail
|
|
|
|
|
;; *******************************************************************
|
;; *******************************************************************
|
;; XOR 1
|
;; XOR 1
|
;;
|
;;
|
;; Br(0) xor 1
|
;; Br(0) xor 1
|
lbi 0x0, 0x0
|
lbi 0x0, 0x0
|
ld 0x1
|
ld 0x1
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x2 at current Br
|
;; expect 0x2 at current Br
|
clra
|
clra
|
aisc 0x2
|
aisc 0x2
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x1 in accumulator
|
;; expect 0x1 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0x1
|
aisc 0x1
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(1) xor 1
|
;; Br(1) xor 1
|
lbi 0x1, 0x0
|
lbi 0x1, 0x0
|
ld 0x1
|
ld 0x1
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x1 at current Br
|
;; expect 0x1 at current Br
|
clra
|
clra
|
aisc 0x1
|
aisc 0x1
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x2 in accumulator
|
;; expect 0x2 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0xf
|
aisc 0xf
|
nop
|
nop
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(2) xor 1
|
;; Br(2) xor 1
|
lbi 0x2, 0x0
|
lbi 0x2, 0x0
|
ld 0x1
|
ld 0x1
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x4 at current Br
|
;; expect 0x4 at current Br
|
clra
|
clra
|
aisc 0x4
|
aisc 0x4
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x3 in accumulator
|
;; expect 0x3 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0x1
|
aisc 0x1
|
nop
|
nop
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(3) xor 1
|
;; Br(3) xor 1
|
lbi 0x3, 0x0
|
lbi 0x3, 0x0
|
ld 0x1
|
ld 0x1
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x3 at current Br
|
;; expect 0x3 at current Br
|
clra
|
clra
|
aisc 0x3
|
aisc 0x3
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x4 in accumulator
|
;; expect 0x4 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0xf
|
aisc 0xf
|
nop
|
nop
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; *******************************************************************
|
;; *******************************************************************
|
;; XOR 2
|
;; XOR 2
|
;;
|
;;
|
;; Br(0) xor 2
|
;; Br(0) xor 2
|
lbi 0x0, 0x0
|
lbi 0x0, 0x0
|
ld 0x2
|
ld 0x2
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x3 at current Br
|
;; expect 0x3 at current Br
|
clra
|
clra
|
aisc 0x3
|
aisc 0x3
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x1 in accumulator
|
;; expect 0x1 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0x2
|
aisc 0x2
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(1) xor 2
|
;; Br(1) xor 2
|
lbi 0x1, 0x0
|
lbi 0x1, 0x0
|
ld 0x2
|
ld 0x2
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x4 at current Br
|
;; expect 0x4 at current Br
|
clra
|
clra
|
aisc 0x4
|
aisc 0x4
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x2 in accumulator
|
;; expect 0x2 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0x2
|
aisc 0x2
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(2) xor 2
|
;; Br(2) xor 2
|
lbi 0x2, 0x0
|
lbi 0x2, 0x0
|
ld 0x2
|
ld 0x2
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x1 at current Br
|
;; expect 0x1 at current Br
|
clra
|
clra
|
aisc 0x1
|
aisc 0x1
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x3 in accumulator
|
;; expect 0x3 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0xe
|
aisc 0xe
|
nop
|
nop
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(3) xor 2
|
;; Br(3) xor 2
|
lbi 0x3, 0x0
|
lbi 0x3, 0x0
|
ld 0x2
|
ld 0x2
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x2 at current Br
|
;; expect 0x2 at current Br
|
clra
|
clra
|
aisc 0x2
|
aisc 0x2
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x4 in accumulator
|
;; expect 0x4 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0xe
|
aisc 0xe
|
nop
|
nop
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; *******************************************************************
|
;; *******************************************************************
|
;; XOR 3
|
;; XOR 3
|
;;
|
;;
|
;; Br(0) xor 3
|
;; Br(0) xor 3
|
lbi 0x0, 0x0
|
lbi 0x0, 0x0
|
ld 0x3
|
ld 0x3
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x4 at current Br
|
;; expect 0x4 at current Br
|
clra
|
clra
|
aisc 0x4
|
aisc 0x4
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x1 in accumulator
|
;; expect 0x1 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0x3
|
aisc 0x3
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(1) xor 3
|
;; Br(1) xor 3
|
lbi 0x1, 0x0
|
lbi 0x1, 0x0
|
ld 0x3
|
ld 0x3
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x3 at current Br
|
;; expect 0x3 at current Br
|
clra
|
clra
|
aisc 0x3
|
aisc 0x3
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x2 in accumulator
|
;; expect 0x2 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0x1
|
aisc 0x1
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(2) xor 3
|
;; Br(2) xor 3
|
lbi 0x2, 0x0
|
lbi 0x2, 0x0
|
ld 0x3
|
ld 0x3
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x2 at current Br
|
;; expect 0x2 at current Br
|
clra
|
clra
|
aisc 0x2
|
aisc 0x2
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x3 in accumulator
|
;; expect 0x3 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0xf
|
aisc 0xf
|
nop
|
nop
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
;; Br(3) xor 3
|
;; Br(3) xor 3
|
lbi 0x3, 0x0
|
lbi 0x3, 0x0
|
ld 0x3
|
ld 0x3
|
xad 3, 15 ; save load data
|
xad 3, 15 ; save load data
|
;; expect 0x1 at current Br
|
;; expect 0x1 at current Br
|
clra
|
clra
|
aisc 0x1
|
aisc 0x1
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; expect 0x4 in accumulator
|
;; expect 0x4 in accumulator
|
xad 3, 15 ; restore load data
|
xad 3, 15 ; restore load data
|
aisc 0xd
|
aisc 0xd
|
nop
|
nop
|
ske
|
ske
|
jmp fail
|
jmp fail
|
|
|
|
|
jmp pass
|
jmp pass
|
|
|
org 0x100
|
org 0x100
|
include "pass_fail.asm"
|
include "pass_fail.asm"
|
|
|