;made by Alban Gervaise ;last release 31/10/98 include "tios.h" include "util.h" xdef _main xdef _comment xdef _ti89 WriteStr MACRO move.w \3,-(a7) pea \4(pc) move.w \2,-(a7) move.w \1,-(a7) jsr tios::DrawStrXY lea 10(a7),a7 ENDM Get_string MACRO movem d0-d7/a0-a6,-(a7) move.w \1,d3 move.w \2,d4 move.w \3,d7 sub.w #1,d7 lea \4(pc),a1 bsr take_name movem (a7)+,d0-d7/a0-a6 ENDM _main: jsr util::clr_scr Get_string #40,#40,#8,score WriteStr #40,#50,#1,score jsr util::idle_loop rts ;лллллллллл GET A STRING ROUTINE лллллллллл ; made by Alban Gervaise ; ; input: Get_string x,y,nb,string_addr ; x=x coord where string is writen on the screen ; y=y coord where string is writen on the screen ; nb=number of char taken ; string_addr=address where the string will be put ; ; output: the string is stored and a 0 is put after the last char take_name: jsr util::idle_loop cmp.w #264,d0 beq ag_exit move.l #value,a0 move.l #key,a2 move.w #26,d6 ; depend on the char which are put on key ag_search: move.w (a0)+,d5 cmp.w d0,d5 beq ag_good add.l #1,a2 dbra d6,ag_search bra take_name ag_good: move.b (a2),d0 move.b d0,(a1)+ move.w #2,-(a7) move.w d4,-(a7) move.w d3,-(a7) move.w d0,-(a7) jsr util::DrawCharXY lea 8(a7),a7 add.w #6,d3 ; font=1 so increase cursor with 6 dbra d7,take_name ag_exit: move.b #0,(a1) rts key dc.b "ABCDEFGHIJKLMNOPQRSTUVWXYZ " ; char value dc.w 61,40,41,44,47,124,55,56,57,42,149,52,53 ; value of getkey for char (ex:A=61,B=44...Z=122) dc.w 54,45,258,49,50,51,116,43,48,46,120,121,122,173 ;лллллллллллллл END OF ROUTINE лллллллллллл score dc.b " ",0 _comment dc.b "input string routine by Endive",0 end