home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 92 / asm / source / fargo / romdump2.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  1.4 KB  |  90 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.     lea    tios::ROM_base,a4    ; start of ROM dump
  14.     move.l    $C4(a4),d0        ; ROM size - 4
  15.     lea    4(a4,d0.l),a5        ; end of ROM dump
  16.     move.w    #8,-(a7)
  17.     pea    buffer(pc)
  18. dump_loop:
  19.     move.l    #0,d1
  20.     move.l    #0,d2
  21.     move.l    a4,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    #8,d0
  35.     bcs    test_key
  36.  
  37.     lea    (buffer+8)(pc),a0
  38.  
  39.     move.b    3(a4),d0
  40.     asl.l    #8,d0
  41.     move.b    4(a4),d0
  42.     asl.l    #8,d0
  43.     move.b    5(a4),d0
  44.     asl.l    #8,d0
  45.     move.b    6(a4),d0
  46.  
  47.     move.w    #3,d1
  48. bit_loop_1:
  49.     move.b    d0,d2
  50.     or.b    #$80,d2
  51.     move.b    d2,-(a0)
  52.     asr.l    #7,d0
  53.     dbf.w    d1,bit_loop_1
  54.  
  55.     move.b    (a4),d0
  56.     asl.l    #8,d0
  57.     move.b    1(a4),d0
  58.     asl.l    #8,d0
  59.     move.b    2(a4),d0
  60.     asl.l    #8,d0
  61.     move.b    3(a4),d0
  62.     asr.l    #4,d0
  63.  
  64.     move.w    #3,d1
  65. bit_loop_2:
  66.     move.b    d0,d2
  67.     or.b    #$80,d2
  68.     move.b    d2,-(a0)
  69.     asr.l    #7,d0
  70.     dbf.w    d1,bit_loop_2
  71.  
  72.     jsr    tios::transmit
  73.  
  74.     add.l    #7,a4
  75.     cmp.l    a5,a4
  76.     bcs    dump_loop
  77. dump_exit:
  78.     add.l    #$6,a7
  79.     rts
  80.  
  81. ;*****************************************************
  82.  
  83. buffer        dcb.b    8,0
  84.  
  85. _comment    dc.b    "Dump ROM to link port (ASCII)",0
  86.  
  87. ;*****************************************************
  88.  
  89.     end
  90.