include "tios.h" include "flib.h" include "hexlib.h" xdef _main xdef _comment ;******************************************************* ;***** The sourcecode for LinkPort Dump ***** ;***** by Kristian K. Nielsen ***** ;******************************************************* ;************===---> jkkn@ctav.com <---===************** ;********************** MACROS ************************* checkkey: tst.w (tios::kb_vars+$1C) beq NoKeypress move.w (tios::kb_vars+$1E),d1 clr.w (tios::kb_vars+$1C) cmp.w #$0108,d1 beq Keypressed move.b #2,d0 rts NoKeypress: move.b #0,d0 rts Keypressed: move.b #1,d0 rts Send_Byte: bsr checkkey cmp.b #1,d0 beq sendstop_a jsr tios::tx_free cmp.w #1,d0 bcs Send_Byte bsr checkkey cmp.b #1,d0 beq sendstop_a move.w #1,-(a7) pea (a4) jsr tios::transmit lea 6(a7),a7 move.b #1,d0 sendstop: rts sendstop_a: move.b #0,d0 rts Read_Byte: bsr checkkey cmp.b #0,d0 bne readstop_a move.w #1,-(a7) pea (a4) jsr tios::receive lea 6(a7),a7 cmp.b #1,d0 bne Read_Byte move.b #9,d0 readstop: rts readstop_a: bra readstop ;************** Start of Fargo program ************** moveup: move.w #824,d7 lea LCD_MEM,a0 lea LCD_MEM,a6 add.l #300,a0 sloop: move.l (a0)+,(a6)+ dbf d7,sloop move.w #74,d7 clear: clr.l (a6)+ dbf d7,clear clr.b x bra write _main: jsr flib::clr_scr ; FLIB call to Clear Screen jsr tios::reset_link ; Reset Link clr.b x loop: lea buffer(pc),a4 bsr Read_Byte cmp.b #9,d0 beq incoming cmp.b #1,d0 beq end move.b d1,buffer lea buffer(pc),a4 bsr Send_Byte bra loop ; Forget everything about keypresses incoming: cmp.b #30,x beq moveup write: clr.l d0 clr.l d2 move.b buffer,d0 move.l #14,d1 move.b x,d2 move.l #1,d4 jsr hexlib::put_hex add.b #3,x bra loop end: jsr tios::reset_link ; Reset Link rts ;*********************************************************** ;****** If you have any questions about this sourcecode **** ;****** fell free to send me an email at jkkn@ctav.com. **** ;****** By changing this sourcecode please give credit! **** ;*********************************************************** _comment: dc.b "LinkPort Dump (by JKKN)",0 buffer dc.b 0 x dc.b 0 ;************** End of Fargo program **************** end