home *** CD-ROM | disk | FTP | other *** search
- ; Mod2App source code
- ; by M.Bloch, 1995
-
- #type &FF8
- #base &8000
- #name Mod2App
-
- SWI OS_GetEnv
- RSB R1,R1,#&8000
- STR R1,ram_limit
- MOV R1,R0
- ADR R0,keyword_definition
- ADR R2,output_buffer
- MOV R3,#64
- SWI OS_ReadArgs
- LDR R7,[R2,#4]
- TEQ R7,#0
- BEQ syntax
- LDR R8,[R2,#8]
- TEQ R8,#0
- MOVEQ R8,R7
-
- MOV R0,#23
- MOV R1,R7
- SWI OS_File
- STR R4,length_of_module
- ADD R4,R4,#&400
- LDR R3,ram_limit
- CMP R3,R4
- BGE not_enough_memory
-
- MOV R0,#16
- MOV R1,R7
- ADR R2,load_module_here
- MOV R3,#0
- SWI OS_File
-
- MOV R0,#10
- MOV R1,R8
- MOV R2,#&FF8
- ADR R4,start_of_app_shell
- LDR R5,length_of_module
- ADD R5,R5,R4
- SWI OS_File
-
- SWI OS_Exit
-
- .syntax
- SWI OS_WriteS
- DCB "Syntax: Mod2App <input file> [output file]",0
- ALIGN
- SWI OS_NewLine
- SWI OS_Exit
- .not_enough_memory
- SWI OS_WriteS
- DCB "Not enough memory available to load module",0
- ALIGN
- SWI OS_NewLine
- SWI OS_Exit
- .keyword_definition
- DCB "prog,infile,outfile",0
- .ram_limit
- DCD 0
- .output_buffer
- DBB 64,0
-
- .start_of_app_shell
- MOV R0,#11
- ADR R1,load_module_here
- LDR R2,length_of_module
- SWI OS_Module
- SWI OS_Exit
- .length_of_module
- DCD 0
- .load_module_here
-