include "tios.h" include "util.h" xdef _main ;we will begin at the _main label xdef _comment ;yes, we have a comment. Make sure the compiler knows that too! xdef _ti89 ;this will run on the ti89 _main: jsr util::clr_scr;clear the screen move.w #25,d0 ;move 25 into d0. X-coordinate move.w #50,d1 ;move 50 into d1. Y-coordinate bsr FindPixel ;find the bit at (25,50) bset.b d1,(a0);do what you want to the pixel here. Set it, test it, invert it, whatever. jsr util::idle_loop ;pause, so we can see that it worked! rts FindPixel: ;Matt Teiken's FindPixel ;Inputs: (x,y)=(d0,d1) ;Outputs: a0= points to the byte in video memory, d1= the bit of (a0) you want ;Destroys: d0,a0 move.w d0,-(a7) ;move the x-coordinate onto the stack lea $4C00,a0 ;load the address of the video mem to address register 0 mulu.w #30,d1 ;multiply the y-coordinate by 30. (30 bytes per row) add.w d1,a0 ;add the result to the pointer to the video mem lsr.w #3,d0 ;divide the x-coordinate by 8(divide by 2 three times). because there are 8 pixels per byte add.w d0,a0 ;now add that to a0 move.w (a7),d0 ;move the word that we stored off of the stack and into d0 again lea 2(a7),a7 ;update the stack pointer and.w #7,d0 ;this will give you the remainder of d0/8. And=See which bits they have in common move.w #7,d1 ;put 7 into d1 sub d0,d1 ;subtract d0 from d1(which is 7) rts _comment: dc.b "set pixel at (25,50)",0 ;this is our comment for the shell end