* Demonstrate a simple program with two modules
* Build with:
* runmus simpmus.job output.txt old.exe pdptest.exe
* You can delete the running of old.exe to get the
* ball rolling.


/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/PARM *
/INC PURGE
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/sys region=9999,xregion=64m
/file sysprint prt osrecfm(f) oslrecl(256)
/file in tape osrecfm(u) oslrecl(0) osblksize(32760) vol(PCTOMF) old
/file out n(oldexe.lmod) new(repl) lr(128) recfm(f) sp(100) shr
/parm -bb dd:in dd:out
/load xmon
copyfile n(copyfile.lmod) lcparm
/END

* Note that the name "pdptest" must match what is
* internally in oldexe.lmod
/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/sys region=9999,xregion=64m
/file sysprint prt osrecfm(f) oslrecl(256)
/parm Hi there DeeeeeFerDog
/load xmon
pdptest n(oldexe.lmod) lcparm
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/SAVE PDPASM REPL
/inc rexx
parse arg name
queue "/file syspunch n("name".obj) new(repl) sp(50) secsp(100%)"
queue "/file syslib pds(@BLD000:*.M,$MCU:*.M,$MCM:*.M)"
queue "/load asm"
queue "/job nogo"
queue "/opt deck,list"
queue "/inc" name".asm"
"EXEC"

exit rc
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/SAVE ONE.ASM REPL
         CSECT
         PRINT GEN
* YREGS is not standard
*         YREGS
R0       EQU   0
R1       EQU   1
R2       EQU   2
R3       EQU   3
R4       EQU   4
R5       EQU   5
R6       EQU   6
R7       EQU   7
R8       EQU   8
R9       EQU   9
R10      EQU   10
R11      EQU   11
R12      EQU   12
R13      EQU   13
R14      EQU   14
R15      EQU   15
*
*
*
*
         ENTRY ONE
ONE      DS    0H
         SAVE  (14,12),,ONE
         LR    R12,R15
         USING ONE,R12
*
         LR    R5,R13
         LA    R13,SAVEAREA
         WTO   'Hello from ONE'
         WTO   'Hello again from ONE'
         CALL  TWO
         LR    R8,R15
         WTO   'Bye from ONE'
         LR    R15,R8
*
         LR    R13,R5
         RETURN (14,12),RC=(15)
         LTORG
*
SAVEAREA DS    18F
         END
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/SAVE TWO.ASM REPL
         CSECT
*
*
         ENTRY TWO
TWO      DS    0H
         USING *,7
         LR    7,15
         LR    4,13
         LA    13,SAVEAREA
         LR    3,14
         WTO   'Hello from TWO'
         LR    14,3
         LR    13,4
         LA    15,6
         BR    14
         LTORG
SAVEAREA DS    18F
         END
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/inc rexx
'pdpasm one'
'pdpasm two'
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/sys region=9999
/file lmod n(pdptest.lmod) new(repl) lr(128) recfm(f) sp(100) shr
/load lked
/job map,nogo,print,stats,mode=os,name=pdptest
.org 4a00
/inc one.obj
/inc two.obj
 ENTRY ONE
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/sys region=3000,xregion=64m
/parm *
/inc dir
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/sys region=9999,xregion=64m
/file sysprint prt osrecfm(f) oslrecl(256)
/parm Hi there DeeeeeFerDog
/load xmon
pdptest n(pdptest.lmod) lcparm
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/sys region=9999,xregion=64m
/file sysprint prt osrecfm(f) oslrecl(256)
/file in name(pdptest.lmod)
/parm dd:in
/load xmon
hexdump n(hexdump.lmod) lcparm
/END

/ID SAVE-JOB-123456 @BLD000 9999 9999 9999 9999
/PASSWORD=BLD000
/sys region=9999,xregion=64m
/file sysprint prt osrecfm(f) oslrecl(256)
/file in name(pdptest.lmod)
/file out tape vol(MFTOPC) new recfm(u) osrecfm(u) oslrecl(0) osblksize(32760)
/parm -bb dd:in dd:out
/load xmon
copyfile n(copyfile.lmod) lcparm
/END
