// show interrupt mode // similar to ems-demo plot routine // 14 Jan 2013 // dummy header for compiler use asm(x) // ISR, assembly // x is r1, y is r2, color is r3 int_plot() asm("st r1 1010") asm("st r2 1011") asm("trap r3 #15") asm("add r1 r1 #1") asm("add r2 r2 #1") asm("sub fp fp #1") // correct fp asm("ret r31") main() // setup interrupt asm("mov r1 #int_plot") asm("st r1 1000") asm("mov r1 #1") asm("trap r1 #12 ; enable int") asm("mov r1 #100") asm("trap r1 #100 ; set timer1 = 100") asm("mov r1 #100") asm("trap r1 #11 ; set div = 100") x = 10 y = 10 color = 1 while(x < 50) // empty loop // use ISR to plot and step x,y