         nam   CC3Go
         ttl   OS-9 Level Two V2.00.01 SysGo

         ifp1
         use   defsfile
         endc

tylg     set   Prgrm+Objct
atrv     set   $00+rev
rev      set   $01

         mod   eom,name,tylg,atrv,start,size

u0000    rmb   32
u0020    rmb   42
u004A    rmb   33
u006B    rmb   6
u0071    rmb   655
size     equ   .

name     fcs   /CC3Go/
edition  fcb   $05

Banner   fcc   / OS-9 LEVEL TWO VR. 02.00.01/
         fdb   $0D0A
         fcc   /     COPYRIGHT 1986 BY/
         fdb   $0D0A
         fcc   /   MICROWARE SYSTEMS CORP./
         fdb   $0D0A
         fcc   /   LICENSED TO TANDY CORP./
         fdb   $0D0A
         fcc   /    ALL RIGHTS RESERVED./
         fdb   $0D0A
         fcb   $0A
DefDev   fcc   "/H0"
         fcb   $0D
HDDev    fcc   "/H0/"
ExecDir  fcc   "Cmds"
         fcb   $0D
         fcc   ",,,,,"
Shell    fcc   "Shell"
         fcb   $0D
         fcc   ",,,,,"
AutoEx   fcc   "AutoEx"
         fcb   $0D
         fcc   ",,,,,"
Startup  fcc   "STARTUP -P"
         fcb   $0D
         fcc   ",,,,,"
ShellPrm fcc   "i=/1"
CRtn     fcb   $0D
         fcc   ",,,,,"

DefTime  fcb   87,02,16,00,00,00

start    leax  >IcptRtn,pcr
         os9   F$Icpt
         os9   F$ID
         ldb   #$80
         os9   F$SPrior
         leax  >Banner,pcr
         ldy   #$0089
         lda   #$01                    standard output
         os9   I$Write                 write out banner
         leax  >DefTime,pcr
         os9   F$STime                 set time to default
         leax  >ExecDir,pcr
         lda   #EXEC.
         os9   I$ChgDir                change exec. dir
         leax  >DefDev,pcr
         lda   #READ.+WRITE.
         os9   I$ChgDir                change data dir.
         bcs   L0125
         leax  >HDDev,pcr
         lda   #EXEC.
         os9   I$ChgDir                change exec. dir to HD
L0125    pshs  u,y
         os9   F$ID
         bcs   Crash
         leax  ,u
         os9   F$GPrDsc
         bcs   Crash
         leay  ,u
         ldx   #$0000
         ldb   #$01
         os9   F$MapBlk
         bcs   Crash
         lda   #$55
         sta   <D.CBStrt,u
         ldd   <D.SysPrc,u
         leau  d,u
         leau  <u0020,u
         leay  <$20,y
         ldb   #$0F
L0151    lda   b,y
         sta   b,u
         decb
         bpl   L0151
         leax  >Shell,pcr
         leau  >Startup,pcr
         ldd   #256
         ldy   #16
         os9   F$Fork
         bcs   Crash
         os9   F$Wait
         leax  >AutoEx,pcr
         leau  >CRtn,pcr
         ldd   #$0100
         ldy   #$0001
         os9   F$Fork
         bcs   L0186
         os9   F$Wait
L0186    puls  u,y
         leax  >ShellPrm,pcr
         leay  ,u
         ldb   #$0A
L0190    lda   ,x+
         sta   ,y+
         decb
         bne   L0190
         leax  >Shell,pcr
         ldd   #$0100
         ldy   #$000A
         os9   F$Chain

Crash    clr   $FFA8                   turn off disk motor
         jmp   <D.Crash

IcptRtn  rti

         emod
eom      equ   *
         end
