1997-09-16 07:01:57 +00:00
|
|
|
.macro start
|
|
|
|
.text
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro exit47
|
|
|
|
mov 1, r6
|
|
|
|
addi 47, r0, r7
|
|
|
|
trap 31
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro exit0
|
|
|
|
mov 1, r6
|
|
|
|
mov 0, r7
|
|
|
|
trap 31
|
|
|
|
.endm
|
|
|
|
|
1997-09-17 03:31:09 +00:00
|
|
|
.macro load reg val
|
1997-09-16 07:01:57 +00:00
|
|
|
jr 1f
|
|
|
|
.align 2
|
|
|
|
1: jarl 2f, \reg
|
|
|
|
.long \val
|
|
|
|
2: ld.w 0[\reg], \reg
|
|
|
|
.endm
|
1997-09-17 03:31:09 +00:00
|
|
|
|
|
|
|
.macro check1 reg val
|
|
|
|
jr 1f
|
|
|
|
.align 2
|
|
|
|
1: jarl 2f, r1
|
|
|
|
.long \val
|
|
|
|
2: ld.w 0[r1], r1
|
|
|
|
cmp r1, \reg
|
|
|
|
be 1f
|
|
|
|
exit47
|
|
|
|
1:
|
|
|
|
.endm
|
1997-09-19 06:40:11 +00:00
|
|
|
|
|
|
|
.macro check1x sts reg val
|
|
|
|
jr 1f
|
|
|
|
.align 2
|
|
|
|
1: jarl 2f, r1
|
|
|
|
.long \val
|
|
|
|
2: ld.w 0[r1], r1
|
|
|
|
cmp r1, \reg
|
|
|
|
be 1f
|
|
|
|
mov 1, r6
|
|
|
|
addi \sts, r0, r7
|
|
|
|
trap 31
|
|
|
|
1:
|
|
|
|
.endm
|
|
|
|
|
|
|
|
|
|
|
|
# definitions of various PSW bits
|
|
|
|
PSW_US = 0x100
|
|
|
|
PSW_NP = 0x80
|
|
|
|
PSW_EP = 0x40
|
|
|
|
PSW_ID = 0x20
|
|
|
|
PSW_SAT = 0x10
|
|
|
|
PSW_CY = 0x8
|
|
|
|
PSW_OV = 0x4
|
|
|
|
PSW_S = 0x2
|
|
|
|
PSW_Z = 0x1
|
|
|
|
|
1997-09-23 08:40:55 +00:00
|
|
|
|
|
|
|
# definitions of various interrupt addresses
|
|
|
|
INT_RESET = 0x0
|
|
|
|
INT_NMI = 0x10
|