# Build OS/8 BASIC and FORTRAN II from source

mount rk0 $os8mo/v3d-patched.rk05 required scratch
copy $obj/ock-bf2-src.rk05 $os8mo/ock-bf2-obj.rk05
mount rk1 $os8mo/ock-bf2-obj.rk05 required

boot rk0

print Building BASIC.SV
pal8 RKB1:BASIC.BN<RKA1:BASIC.PA
begin cdprog SYS:ABSLDR.SV
RKB1:BASIC.BN
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:BASIC.SV;3211
os8 DEL RKB1:BASIC.BN

print Building BCOMP.SV
pal8 RKB1:BCOMP.BN<RKA1:BCOMP.PA
begin cdprog SYS:ABSLDR.SV
RKB1:BCOMP.BN
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:BCOMP.SV;7000
os8 DEL RKB1:BCOMP.BN

print Building BLOAD.SV
pal8 RKB1:BLOAD.BN<RKA1:BLOAD.PA
begin cdprog SYS:ABSLDR.SV
RKB1:BLOAD.BN
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:BLOAD.SV;7605
os8 DEL RKB1:BLOAD.BN

print Building BRTS.SV, BASIC.AF, BASIC.SF, BASIC.FF from BRTS.PA
pal8 RKB1:BRTS.BN<RKA1:BRTS.PA/W
begin cdprog SYS:ABSLDR.SV
RKB1:BRTS.BN
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:BRTS.SV 0-6777;7605
os8 SAVE RKB1:BASIC.AF 3400-4577;7605 
os8 SAVE RKB1:BASIC.SF 12000-13177;7605
os8 SAVE RKB1:BASIC.FF 13400-14577;7605
os8 DEL RKB1:BRTS.BN

print Building BASIC.UF which includes patch 31.5.1 M in source form.
pal8 RKB1:UF.BN<RKA1:UF.PA
begin cdprog SYS:ABSLDR.SV
RKB1:UF.BN
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:BASIC.UF 3400-4577;7605
os8 DEL RKB1:UF.BN

print Building EABRTS.BN from EAEDEF.PA and BRTS.PA
pal8 RKB1:EABRTS.BN<RKA1:EAEDEF.PA,RKA1:BRTS.PA/W

print Building SABR.SV from SABR.PA and SPATCH.PA
pal8 RKB1:SABR.BN<RKA1:SABR.PA
pal8 RKB1:SPATCH.BN<RKA1:SPATCH.PA
begin cdprog SYS:ABSLDR.SV
RKB1:SABR.BN
RKB1:SPATCH.BN
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:SABR.SV
os8 DEL RKB1:SABR.BN,RKB1:SPATCH.BN

print Building LOADER.SV
pal8 RKB1:LOADER.BN<RKA1:LOADER.PA
begin cdprog SYS:ABSLDR.SV
RKB1:LOADER.BN/9
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:LOADER.SV
os8 DEL RKB1:LOADER.BN

print Building FORT.SV from FORT.PA and FPATCH.PA
pal8 RKB1:FORT.BN<RKA1:FORT.PA
pal8 RKB1:FPATCH.BN<RKA1:FPATCH.PA
begin cdprog SYS:ABSLDR.SV
RKB1:FORT.BN
RKB1:FPATCH.BN
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:FORT.SV
os8 DEL RKB1:FORT.BN,FPATCH.BN

print Building LIBSET.SV
pal8 RKB1:LIBSET.BN<RKA1:LIBSET.PA
begin cdprog SYS:ABSLDR.SV
RKB1:LIBSET.BN
end cdprog SYS:ABSLDR.SV
os8 SAVE RKB1:LIBSET.SV;12600=6000
os8 DEL RKB1:LIBSET.BN

print Assemble Library Modules
print ATAN
begin cdprog RKB1:SABR.SV
RKB1:ATAN.RL<RKA1:ATAN.SB
end cdprog RKB1:SABR.SV

print FLOAT
begin cdprog RKB1:SABR.SV
RKB1:FLOAT.RL<RKA1:FLOAT.SB
end cdprog RKB1:SABR.SV

# GENIOX is a Legacy module that conflicts with UTIL
# Although all other SB modules are documented in the
# OS/8 LANGUAGE REFERENCE MANUAL - AA-H609A-TA
# GENIOX is not mentioned.
# print GENIOX
# begin cdprog RKB1:SABR.SV
# RKB1:GENIOX.RL<RKA1:GENIOX.SB
# end cdprog RKB1:SABR.SV

print INTEGR
begin cdprog RKB1:SABR.SV
RKB1:INTEGR.RL<RKA1:INTEGR.SB
end cdprog RKB1:SABR.SV

print IOH
begin cdprog RKB1:SABR.SV
RKB1:IOH.RL<RKA1:IOH.SB
end cdprog RKB1:SABR.SV

print IOPEN
begin cdprog RKB1:SABR.SV
RKB1:IOPEN.RL<RKA1:IOPEN.SB
end cdprog RKB1:SABR.SV

print IPOWRS
begin cdprog RKB1:SABR.SV
RKB1:IPOWRS.RL<RKA1:IPOWRS.SB
end cdprog RKB1:SABR.SV

print POWERS
begin cdprog RKB1:SABR.SV
RKB1:POWERS.RL<RKA1:POWERS.SB
end cdprog RKB1:SABR.SV

print RWTAPE
begin cdprog RKB1:SABR.SV
RKB1:RWTAPE.RL<RKA1:RWTAPE.SB
end cdprog RKB1:SABR.SV

print SQRT
begin cdprog RKB1:SABR.SV
RKB1:SQRT.RL<RKA1:SQRT.SB
end cdprog RKB1:SABR.SV

print TRIG
begin cdprog RKB1:SABR.SV
RKB1:TRIG.RL<RKA1:TRIG.SB
end cdprog RKB1:SABR.SV

print UTILTY
begin cdprog RKB1:SABR.SV
RKB1:UTILTY.RL<RKA1:UTILTY.SB
end cdprog RKB1:SABR.SV

print Use our newly built LIBSET to create LIB8.RL from our library RL files.

begin cdprog RKB1:LIBSET.SV
RKB1:LIB8.RL<RKB1:ATAN.RL,RKB1:FLOAT.RL,RKB1:INTEGR.RL
RKB1:IOH.RL,RKB1:IOPEN.RL,RKB1:IPOWRS.RL,RKB1:POWERS.RL,RKB1:RWTAPE.RL
RKB1:SQRT.RL,RKB1:TRIG.RL,RKB1:UTILTY.RL
end cdprog RKB1:LIBSET.SV
