;Copywrite 2000 Samuel Stearley sstear@calvin.edu include "Os.h" ;makes the xdefs work xdef _ti89 xdef _ti92plus xdef _nostub _main: movem.l a2/a3/a6,-(a7) ;save registers move.l 200,a2 ;get base pointer of the jump table move.l a7,a6 ;save stack pointer move.l 1060(a2),a3 ;get pointer to the tios global variable ; top estack pointer move.l (a3),a3 ;actually get the top estack pointer move.l 3852(a2),a0 ;argument counter call move.l a3,-(a7) ;input to argument counter call jsr (a0) ;count number of arguments subq.b #1,d0 ;was there only one argument? bne error ;branch if zero or if more than one argument cmp.b #$2D,(a3) ;is the argument a string? bne error ;branch if not a string subq.l #1,a3 ;point to end zero byte of the string moveq #-1,d0 ;initiate counter count_loop: addq.l #1,d0 ;increase counter till a3 points to the tst.b -(a3) ; beginning zero bne count_loop ;go until beginning zero clr.w -(a7) ;copy flags are 0 move.l d0,-(a7) ;length to copy into the clipboard pea 1(a3) ;address to copy from move.l 772(a2),a0 ;get replace clipboard call jsr (a0) ;place text into the clipboard error: move.l a6,a7 ;reset the stack movem.l (a7)+,a2/a3/a6 ;get saved registers rts ;finally exit end