home *** CD-ROM | disk | FTP | other *** search
/ Emulator Universe CD / emulatoruniversecd1998.iso / Amiga / ROMs / ghoulsn1.adf / boot.s < prev    next >
Encoding:
Text File  |  1989-09-18  |  2.0 KB  |  117 lines

  1.         move.w    #$7fff,custom+$9a
  2.         move.w    #$7fff,custom+$96
  3.  
  4.         lea     program_start,a0
  5.         lea     rel_address,a1
  6.         move.l     #(program_end-program_start)-1,d0
  7. relocate_1    move.l     (a0)+,(a1)+
  8.         dbra     d0,relocate_1
  9.  
  10.         jmp     rel_address
  11.  
  12. program_start    
  13.         bsr    set_copper
  14.         bsr     open_library
  15.         bsr     open_file
  16.         bsr     read_file
  17.  
  18.         move.l    4,a6
  19.         jsr    -150(a6)
  20.         move.w    #$2700,sr
  21.         
  22.         move.l    #load_address,a0
  23.         move.l    #$18400,a1
  24.         move.l    #86*256,d0
  25. .loop        move.l    (a0)+,(a1)+
  26.         sub.l    #1,d0
  27.         bne    .loop
  28.  
  29.         jmp     $18400
  30.  
  31. set_copper    move.w    #$c028,custom+$9a
  32.         move.w    #$83d0,custom+$96
  33.         lea    copper_list(pc),a0
  34.         move.l    a0,custom+$80
  35.         move.l    a0,custom+$84
  36.         move.w    d0,custom+$8a
  37.         move.w    d0,custom+$88
  38.         rts
  39.  
  40. open_library    lea     dos_name(pc),a1
  41.         clr.l     d0
  42.         move.l     4,a6
  43.         jsr     openlibrary(a6)
  44.         lea     dos_base(pc),a0
  45.         move.l     d0,(a0)
  46.         rts
  47.  
  48. open_file    lea     filename(pc),a0
  49.         move.l     a0,d1
  50.         move.l     #1005,d2                ; old file
  51.         move.l     dos_base(pc),a6
  52.         jsr     open(a6)
  53.         lea     file_handle(pc),a0
  54.         move.l     d0,(a0)
  55.         rts
  56.  
  57. read_file    move.l     file_handle(pc),d1
  58.         move.l     #load_address,d2
  59.         move.l     #load_length,d3
  60.         move.l     dos_base(pc),a6
  61.         jsr     read(a6)
  62.         rts
  63.  
  64. int_exit    rte
  65.  
  66. custom        equ     $dff000
  67. load_address    equ     $2c040
  68. load_length    equ     $20000
  69. rel_address    equ     $78000
  70.  
  71. openlibrary    equ     -552
  72. open        equ     -30
  73. read        equ     -42
  74. close        equ     -36
  75. dos_base    dc.l     0
  76. file_handle    dc.w     0
  77. filename    dc.b     "DF0:GHOULS.PRG",0
  78.  
  79.         even
  80. dos_name    dc.b     "dos.library",0
  81.         even
  82. copper_list    dc.w    $0100,$4000
  83.         dc.w    $0102,$0000
  84.         dc.w    $008e,$3880
  85.         dc.w    $0090,$f8c0
  86.         dc.w    $0092,$0038
  87.         dc.w    $0094,$00d0
  88.         dc.w    $00e0,$0000
  89.         dc.w    $00e2,$0000
  90.         dc.w    $00e4,$0000
  91.         dc.w    $00e6,$0000
  92.         dc.w    $00e8,$0000
  93.         dc.w    $00ea,$0000
  94.         dc.w    $00ec,$0000
  95.         dc.w    $00ee,$0000
  96.         dc.w    $0180,$0000
  97.         dc.w    $0182,$0fff
  98.         dc.w    $0184,$0000
  99.         dc.w    $0186,$0000
  100.         dc.w    $0188,$0000
  101.         dc.w    $018a,$0000
  102.         dc.w    $018c,$0000
  103.         dc.w    $018e,$0000
  104.         dc.w    $0190,$0000
  105.         dc.w    $0192,$0000
  106.         dc.w    $0194,$0000
  107.         dc.w    $0196,$0000
  108.         dc.w    $0198,$0000
  109.         dc.w    $019a,$0000
  110.         dc.w    $019c,$0000
  111.         dc.w    $019e,$0000
  112.         dc.w    $ffff,$fffe
  113.  
  114.         ds.l    128
  115. mystack        dc.l    0
  116. program_end
  117.