3 # sim
: --environment operating
47 .macro load2w reg hi lo
57 .macro check exit reg val
67 .macro check2w2 exit reg hi lo
87 .macro loadacc2 acc guard hi lo
97 .macro checkacc2 exit acc guard hi lo
124 .macro checkpsw2 exit val
136 ;; 4:write
(1, string
, strlen
(string
))
143 1: .string
"Hello World!\n"
149 ;;; Blat our DMAP registers so that they point at on-chip imem
150 .macro point_dmap_at_imem
152 ldi r2
, MAP_INSN |
0xf
153 st r2
, @
(DMAP_REG
,r0
)
155 st r2
, @
(IMAP1_REG
,r0
)
158 ;;; Patch VEC so that it jumps back to code that checks PSW
159 ;;; and then exits with success.
160 .macro check_interrupt vec psw src
161 ;;; Patch the interrupt vector's AE entry with a jmp to success
173 ;;; Code that gets patched into the interrupt vector
177 ;;; Successful trap jumps back to here
185 ;;; Verify the original addr
187 cmpeqi r2
, #\src@word
191 ;;; continue as normal