.ifill pushge r15
prog_dup:
-.ifill fetch r6
+.ifill pop r6
+.ifill push r6
.ifill push r6
prog_jmp:
.ifill push r6
prog_pop:
-.ifill disc r6
+.ifill pop r6
prog_xch:
.ifill pop r6
.define PBASE, 0x2030
.define PADDR, 0x4
.define PDATA, 0x8
+.org 0
+start:
+ call main
+ call main
+ ret
main:
brnz+ u_test ; branch if not zero
stb r0, UART_TRANS(r10)
+
;set address of input
ldis r1, inputdata@lo
ldih r1, inputdata@hi
+
;set address of program start
ldis r2, (prog_start/4)@lo
ldih r2, (prog_start/4)@hi
ldis r13, PBASE@lo
ldih r13, PBASE@hi
+
;set programmer address
stw r2, PADDR(r13)
PROGINSTR
ldw r0, 4(r4)
PROGINSTR
+ ldw r0, 8(r4)
+ PROGINSTR
;increment address
- addi r2, r2, 2
+ addi r2, r2, 3
br+ vm_loop