home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / misc / extract.asm < prev    next >
Assembly Source File  |  1994-08-17  |  2KB  |  112 lines

  1. ; ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  2. ;    It's too bad I didn't own a GUS, instead I have a SB16ASP...oh well...
  3. ; I really wanted to experience this demo with music playing in the back-
  4. ; ground.  I decided to rip the MOD and use IPLAY to play it, then excute
  5. ; the demo...well...it works fine...the demo is a little slow, but what
  6. ; the hell.  You will need about 2MB of Expanded memory for this to work.
  7. ; Load the MOD with Inertia Player, shell to dos and run the demo.
  8. ;
  9. ; This file will extract the 8 channel mod file from the VERSES demo by EMF
  10. ; to disk in order for you to play it.
  11. ;
  12. ;                            Bad Sector/iLL
  13. ; ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  14.  
  15. .MODEL SMALL
  16. DOSSEG
  17.  
  18. .STACK 0
  19.  
  20. .DATA
  21.     Demo_File    db    'VERSES.EXE',0
  22.     Mod_File    db    'DTROUBLE.MOD',0
  23.     Error_Msg    db    'Sorry, a critical error has occurred'
  24.             db    13,10,'$'
  25. .DATA?
  26.     Demo_Handle    dw    ?
  27.     Mod_Handle    dw    ?
  28.     Byte_Read    dw    8000 dup(?)
  29.  
  30. .CODE
  31.  
  32. Main    proc
  33.     
  34.     mov    ax,dgroup        ; program setup
  35.     mov    ds,ax
  36.  
  37.     mov    ah,4ah            ; reduce program memory size
  38.     mov    bx,437fh        ; i dunno..EXEMOD gave me this
  39.     int    21h
  40.  
  41.  
  42.     mov    ax,3d00h        ; open file for reading
  43.     mov    dx,offset Demo_File
  44.     int    21h
  45.     jnc    @FileOkay        ; error check
  46.  
  47. @Error:
  48.     mov    ah,09h            ; If error, display warning
  49.     mov    dx,offset Error_Msg    ; then exit.
  50.     int    21h
  51.     jmp    @Exit
  52.  
  53. @FileOkay:
  54.     mov    Demo_Handle,ax        ; make a backup of handle
  55.  
  56.     mov    ax,4200h        ; LSEEK to MOD offset
  57.     mov    bx,Demo_Handle
  58.     mov    cx,0006h
  59.     mov    dx,0BD35h
  60.     int    21h
  61.  
  62.     mov    ah,3ch            ; Create MOD file
  63.     xor    cx,cx
  64.     mov    dx,offset Mod_File
  65.     int    21h
  66.     jc    @Error            ; error check
  67.  
  68.     mov    ax,3d01h        ; open file for writing
  69.     mov    dx,offset Mod_File
  70.     int    21h
  71.     jc    @Error            ; error check
  72.  
  73.      mov    Mod_Handle,ax        ; make backup of new file handle
  74.  
  75.      mov    cx,64            ; number of cycles
  76. @ReadLoop:
  77.      push    cx            ; preserve loop count
  78.  
  79.      mov    ah,3fh            ; read from file
  80.      mov    bx,Demo_Handle
  81.      mov    cx,5536
  82.      mov    dx,offset Byte_Read
  83.      int    21h
  84.      jc    @Error            ; error check
  85.      mov    cx,ax            ; number of bytes read
  86.  
  87.      mov    ah,40h            ; write to (mod) file
  88.      mov    bx,Mod_Handle
  89.      mov    dx,offset Byte_Read
  90.      int    21h
  91.      jc    @Error            ; error check
  92.  
  93.      pop    cx            ; restore loop count
  94.      loop    @ReadLoop
  95.  
  96. @Done:
  97.     mov    ah,3eh            ; close files handles
  98.     mov    bx,Demo_Handle
  99.     int    21h
  100.  
  101.     mov    ah,3eh
  102.     mov    bx,Mod_Handle
  103.     int    21h
  104.  
  105. @Exit:
  106.     mov    ah,4ch            ; Exit to Dos
  107.     int    21h
  108.  
  109. Main    endp
  110.  
  111.     end Main
  112.