home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
WDR Computer Club Digital 1996 October
/
CLUB10_96.BIN
/
fernuni
/
medlite3.app
/
testload.prg
< prev
next >
Wrap
Text File
|
1995-03-13
|
3KB
|
315 lines
#our program starts at 0x2000
load 0x0100
shift 5
jump
$0x2000
# test load immediate
load 1
store [0x1000]
load 0
store [0x1001]
load -1
store [0x1002]
# test load direct & store direct (see above)
load [0x1000]
load [0x1001]
load [0x1002]
# test neg
load 0
neg
load 1
neg
load -1
neg
# test unconditional branch
branch b1
:b3
branch b2
:b1
branch b3
:b2
# test branch z
load 0
branch z,b4
halt
:b4
load 1
branch z,b5
branch b6
:b5
halt
:b6
load -1
branch z,b7
branch b8
:b7
halt
:b8
# test branch n
load 0
branch n,b9
branch b10
:b9
halt
:b10
load 1
branch n,b11
branch b12
:b11
halt
:b12
load -1
branch n,b13
halt
:b13
# test arithmetical and
load 3
load 5
and
load 3
load 4
and
load -2
load 1
and
load -1
load -4
and
# test arithmetical or
load 3
load 5
or
load 0
load 0
or
load -1
load 2
or
# test arithmetical xor
load 3
load 5
xor
load 3
load 3
xor
load -1
load 2
xor
# test LOAD B
load 1
load b
load -1
load b
load 0
load b
# test ADD
load 2
load 3
add
load 2
load -2
add
load 3
load -2
add
load -3
load 2
add
# test SUB
load 1
load 2
sub
load 4
load 3
sub
load 5
load 5
sub
# test INCA
load 2
inca 3
load 2
inca -2
load 3
inca -2
load -3
inca 2
# test LOAD I (immediate)
load i,1
load i,0
load i,-1
# test INCI
load i,2
inci 3
load i,2
inci -2
load i,3
inci -2
load i,-3
inci 2
# test branch c
load 2
inca -1
branch c,b14
halt
:b14
load 1
inca -2
branch c,b15
branch b16
:b15
halt
:b16
# test LOAD (indirect) and STORE (indirect)
load 0x100
load 0x100
add
load b
load I,0x100
load 2
store [b+i+0x50]
load [0x350]
load [b+i+0x50]
load i,-0xB0
load 4
store [b+i+0x20]
load [0x170]
load [b+i+0x20]
load 0xb0
# test XCHG
load 1
load i,2
xchg
load 1
load i,0
xchg
load 1
load i,-1
xchg
# test jump
load i,0x20
load 0
store [0x100]
#set 0x100 to 0x2000
:b18
load 0x100
load [0x100]
add
store [0x100]
inci -1
branch z,b17
branch b18
:b17
load [0x100]
load 0xa4
add
jump
#this jump should skip the following branch
halt
# test call
load [0x100]
load 0xa9
add
call
#this call should skip the following branch
halt
load 0
# test logical shifts
load 3
shift 2
load 12
load 2
shift 15
branch c,b19
halt
:b19
load -1
shift 15
branch c,b20
halt
:b20
load -4
shift a,r,2
load -1
load 4
shift a,r,2
load 1
load -1
inca 2
load 0
shift c,2
load 2
halt