( 8 July 88 -- MFB) OFF PRINTLOAD ( FILE: MAKECOM.4TH) ( This file converts most 4th programs to a CP/M "COM" file with a minimum of effort. The last "user" definition loaded is assumed to be the entry point. To use, enter: " MAKECOM.4TH" LOAD The source program and the files BASIC.4TH, CIO.4TH, FIO.4TH and DISP.4TH must be on the logged in drive. ) 100H FFF0H CROSS-COMPILE ( set cross mode) 103H ORG ( init.4th loaded below puts in start jmp at 100h) iload kernel2.img ( *** Add more loads here if desired *** ) ( load user program ) 22 BLOCK SRCFILENAME " File to cross compile (ex. TEST.4TH): " ." 20 pad1 ( STRING ) B! pad1 ( STRING ) GETLIN CRLF " \13\\10\Enter filename for 'attached' system: " PUTLIN 20 pad2 ( STRING ) B! pad2 ( STRING ) GETLIN CRLF " Now loading " ." pad1 1+ ." crlf pad1 ( STRING ) 1+ LOAD ( define a constant that is the def adr of the last word) LAST @ DUPB@ + 2+ @ CONST ENTRYPOINT : BOOT ( bootstrap) INITIO ENTRYPOINT EXEC QUIT ; 1000 CONST SYSIZE ( stack space for program) '' SYSIZE BLOCK SYSTK ( define stack) ( init code) 100H CODE GOFORTH HEAD @ SWAP GETLOC SWAP ORG JMP, HEAD ! ( That patched the startup jump into the given location) SP '' SYSTK '' SYSIZE + LXI, ( set SP) H '' SYSTK LXI, '' CSP SHLD, ( set CSP) :ENTER BOOT ( enter forth and execute user bootstrap) ; STATUS DS pad2 ( STRING ) 1+ SAVE " your file " ." pad2 1+ ." " is now saved" ." crlf quit