AppleIIAsm-Collection/source/disk19_demo_builds_1/T.MAKEEXEC
nathanriggs c8cac53c5e Rev 0.4 updates
Massive updates that changes the way most subroutines are handled. Major bugfixes, various utilities added, started higher-level libraries.
2019-04-26 18:49:10 -04:00

152 lines
3.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

********************************
* *
* MAKEEXEC *
* *
* CREATES AN EXEC FILE THAT *
* RUNS A BINARY. NECESSARY FOR *
* ANY FILE OPERATIONS. *
* *
* NOTE THAT IRONICALLY, THIS *
* PROGRAM ITSELF HAS TO BE RUN *
* THROUGH AN EXEC FILE... *
* *
********************************
*
** ASSEMBLER DIRECTIVES
*
CYC AVE
EXP ONLY ; TURN OFF LATER
DSK MAKEEXEC
TR ON
OBJ $BFE0
ORG $6000
*
********************************
* *
* HEADER, HOOKS AND MACROS *
* *
********************************
*
PUT MIN.VARS.REQUIRED
USE MIN.MAC.STRINGS
USE MIN.MAC.REQUIRED
USE MIN.MAC.FILEIO
USE MIN.MAC.STDIO
PUT MIN.HOOKS.REQUIRED
PUT MIN.HOOKS.STDIO
PUT MIN.HOOKS.FILEIO
PUT MIN.HOOKS.STRINGS
*
********************************
* *
* CONSTANT DECLARATIONS *
* *
********************************
*
*
********************************
* *
* MAIN PROGRAM LOOP *
* *
********************************
*
JSR HOME
PRN "************************",8D
PRN "* *",8D
PRN "* EXEC FILE MAKER FOR *",8D
PRN "* BINARY PROGRAMS THAT *",8D
PRN "* USE APPLESOFT. *",8D
PRN "* * ",8D
PRN "************************",8D8D8D
*
PRN "BIN FILENAME: "
INP
LDA RETLEN
GRET #BNAME ; TRANSFER RETURN TO BNAME
*
PRN "BIN STARTING ADDRESS: "
INP
LDA RETLEN
GRET #BLOC
*
SCAT "GO.";#BNAME;#20 ; PREFIX NAME WITH GO.
*
GRET #TNAME ; STORE RESULTING STRING IN TNAME
*
PRN " ",8D
PRN "BUILDING FILE: "
SPRN #TNAME
PRN " ",8D8D
*
** OPEN FILE FOR WRITING
*
SCAT "OPEN ";#TNAME;#255
CMD #RETURN
SCAT "WRITE ";#TNAME;#255
CMD #RETURN
*
** PRINT TO FILE
*
SCAT "BLOAD ";#BNAME;#255
FPRN #RETURN
LDA #$8D
JSR FCOUT
FPRN "CALL -151"
SCAT #BLOC;"G";#255
FPRN #RETURN
*
** CLOSE FILE
*
SCAT "CLOSE ";#TNAME;#255
CMD #RETURN
*
PRN "DONE!",8D8D
JMP REENTRY
*
********************************
* *
* VARIABLES *
* *
********************************
*
BNAME DS 20
TNAME DS 20
BLOC DS 10
LINE DS 40
HEAD ASC "REM ** THIS FILES BLOADS",8D
ASC "REM ** A BINARY PROGRAM INTO",8D
ASC "REM ** MEMORY THEN EXECUTES IT",8D
ASC "REM ** VIA THE MONITOR. THIS IS",8D
ASC "REM ** NECESSARY FOR CERTAIN ",8D
ASC "REM ** EXECUTABLES THAT USE APPLESOFT",8D
ASC "REM ** ROUTINES.",8D
ASC "REM **",8D00
*
********************************
* *
* LOW-LEVEL ROUTINES *
* *
********************************
*
PUT MIN.LIB.REQUIRED
*
** INDIVIDUAL SUBROUTINES
*
*** FILEIO
*
PUT MIN.SUB.FPRINT
PUT MIN.SUB.DOSCMD
PUT MIN.SUB.FPSTR
*
*** STDIO
*
PUT MIN.SUB.DPRINT
PUT MIN.SUB.XPRINT
PUT MIN.SUB.SINPUT
*
*** STRINGS
*
PUT MIN.SUB.STRCAT
PUT MIN.SUB.PRNSTR
*
N