home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
EFFO
/
forum16.lzh
/
SOFTWARE
/
ASSEMBLER
/
DEMERGE
/
demerge.a
< prev
next >
Wrap
Text File
|
1991-04-01
|
2KB
|
116 lines
nam DeMerge
ttl create single Modules from merged file
use <defsfile>
***************************************
* Function:
* erzeugt aus einer merged Datei (OS9boot usw.)
* die einzelnen Module
page
********************************************
* edt date
* --- -------- ------------------------------ ---
* 0 18-mar-91 initial wtg
Edition equ 0
Revisn equ 0
TypLang set (Prgrm<<8)+Objct
AttRev set (ReEnt<<8)+Revisn
stacksize set 200
psect DeMerge,TypLang,AttRev,Edition,stacksize,entry ,trapent
StdIn set 0
StdOut set 1
StdErr set 2
maxsize set 64000
vsect
buff ds.b maxsize
ends
entry:
move.l a5,a0 get input file name from param's
move #Read_,d0 open for read
OS9 I$Open
bcs ExitHelp war nix
move.w #SS_Size,d1 get size of it
OS9 I$GetStt
bcs Exit
cmpi.l #maxsize,d2 more than will fit in mem?
blo en.10
lea max$err(pc),a0 yes, make mess.
move #1,d0
move.l #80,d1
OS9 I$WritLn
clr d1
bra Exit
max$err dc.b "File > 64000 -- aborted ",C$CR
align
en.10:
move.l d2,d1
lea buff(a6),a0
OS9 I$Read
bcs Exit
OS9 I$Close
bcs Exit
* start work
lea buff(a6),a5
Loop: move.l M$Name(a5),d0 get offset
lea (a5,d0.l),a0 point to module name
move.b #Write_+$20,d0 write+ISize
move.w #$3,d1 ---wr
move.l M$Size(a5),d2 module size
OS9 I$Create create the file
bcs Exit
movea.l a5,a0 restore module start
move.l M$Size(a0),d1 write module
OS9 I$Write
bcs Exit
OS9 I$Close close this module
bcs Exit
lea (a5,d1.l),a5 point to next module
cmpi.b #$4a,(a5) is it a module
bne Done
cmpi.b #$fc,1(a5)
beq Loop
Done:
clr d1 ok, all done
bra Exit
ExitHelp:
lea Helpmsg(pc),a0
move.l #Helpl,d1
moveq #2,d0 StdErr
OS9 I$Write
clr d1
Exit:
OS9 F$Exit
bra * fix debug here
Helpmsg:
dc.b "Syntax: demerge <path>",C$CR,C$LF
dc.b "Function: demerges a file of merged modules to single module",C$CR,C$LF
dc.b " files named as modules",C$CR,C$LF
dc.b "opts: none",C$CR,C$LF,0
Helpl equ *-Helpmsg
align
ends