home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 92 / asm / source / fargo / romdump1.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  941 b   |  53 lines

  1.     include    "tios.h"
  2.     include    "flib.h"
  3.     include    "hexlib.h"
  4.     xdef    _main
  5.     xdef    _comment
  6.  
  7. ;*****************************************************
  8.  
  9. _main:
  10.     jsr    flib::clr_scr
  11.     jsr    tios::reset_link
  12.  
  13.     move.w    #$80,-(a7)
  14.     lea    tios::ROM_base,a6
  15.     pea    (a6)            ; start of ROM dump
  16.     move.l    $C4(a6),d0        ; ROM size - 4
  17.     lea    4(a6,d0.l),a6        ; end of ROM dump
  18. dump_loop:
  19.     move.l    #0,d1
  20.     move.l    #0,d2
  21.     move.l    (a7),d0
  22.     move.w    #7,d4
  23.     jsr    hexlib::put_hex
  24.  
  25. test_key:
  26.     tst.w    tios::kb_globals+$1C
  27.     beq    no_key
  28.     move.w    tios::kb_globals+$1E,d0
  29.     clr.w    tios::kb_globals+$1C
  30.     cmp.w    #$0108,d0
  31.     beq    dump_exit
  32. no_key:
  33.     jsr    tios::tx_free
  34.     cmp.w    #$80,d0
  35.     bcs    test_key
  36.  
  37.     jsr    tios::transmit
  38.  
  39.     add.l    #$80,(a7)
  40.     cmp.l    (a7),a6
  41.     bhi    dump_loop
  42. dump_exit:
  43.     add.l    #$6,a7
  44.     rts
  45.  
  46. ;*****************************************************
  47.  
  48. _comment    dc.b    "Dump ROM to link port (raw)",0
  49.  
  50. ;*****************************************************
  51.  
  52.     end
  53.