# HG changeset patch # User Shinji KONO # Date 1531548973 -32400 # Node ID bd2b07db89174add5fac10cd2b9ac8f8f34d7065 # Parent 7b1b25ff010a081e9764c04c281b57ed9ab8e8a9 CoCoOS9 version diff -r 7b1b25ff010a -r bd2b07db8917 .gdbinit --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gdbinit Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,15 @@ +handle 2 pass +define regs +call (void)printf("rax=%08lx rbx=%08lx rcx=%08lx rdx=%08lx\nrsi=%08lx rdi=%08lx rbp=%08lx rsp=%08lx rip=%08lx\n",$rax,$rbx,$rcx,$rdx,$rsi,$rdi,$rbp,$rsp,$rip) +end +define si +stepi +regs +x/1i $rip +end +define ni +nexti +regs +x/1i $rip +end + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/README Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,8 @@ +This directory contains definitions files for various versions of OS-9 +Level One and Two. + +The convention used in renaming version dependent files has been to append +.l1 for Level 1, .l2 for Level 2 and .l2v3 for Level 2 Version 3. + +Boisy G. Pitre +9/25/98 diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/l51.defs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/l51.defs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,98 @@ + +* miscellaneous definitions +HResMaxX equ 639 high resolution X limit +HResMaxY equ 191 high resolution Y limit +MousData equ $0008 arbitrary choice for mouse data area ($0008-$000F) +PcktSize equ 5 number of bytes in mouse data packet +SyncData equ %10000000 initial mouse data byte pattern +SyncMask equ %11111000 mask for initial mouse data byte pattern + +* 6551 register definitions + org 0 +DataReg rmb 1 receive/transmit data +StatReg rmb 1 IRQ/DSR/DCD/error status (read only) +PRstReg equ StatReg programmed reset (write only) +CmdReg rmb 1 command (parity/echo/Tx IRQ/Rx IRQ/DTR) +CtrlReg rmb 1 control (stop bits/word length/Rx clock/baud rate) + +* Status bit definitions +Stat.IRQ equ %10000000 IRQ occurred +Stat.DSR equ %01000000 current DSR input level (0=enabled, 1=disabled) +Stat.DCD equ %00100000 current DCD input level (0=enabled, 1=disabled) +Stat.TxE equ %00010000 Tx register empty +Stat.RxF equ %00001000 Rx register full +Stat.Ovn equ %00000100 overrun error +Stat.Frm equ %00000010 framing error +Stat.Par equ %00000001 parity error + +Stat.Err equ Stat.Ovn!Stat.Frm!Stat.Par status error bits +Stat.Flp equ $00 all status bits active when set +Stat.Msk equ Stat.RxF!Stat.Ovn!Stat.Frm!Stat.Par active IRQ bits + +* Command bit definitions +Cmd.Par equ %11100000 see parity table below +Cmd.Echo equ %00010000 Rx echo (0=disabled, 1=enabled) +Cmd.TxIC equ %00001100 see Tx IRQ control table below +Cmd.RxIE equ %00000010 Rx IRQ enable (0=enabled, 1=disabled) +Cmd.DTR equ %00000001 DTR output (0=disabled, 1=enabled) + +* parity table +Par.None equ %00000000 +Par.Odd equ %00100000 +Par.Even equ %01100000 +Par.Mark equ %10100000 +Par.Spac equ %11100000 + +* Tx IRQ control table +TIC.Off equ %00000000 RTS disabled, Tx IRQ disabled +TIC.On equ %00000100 RTS enabled, Tx IRQ enabled +TIC.RTS equ %00001000 RTS enabled, Tx IRQ disabled +TIC.Brk equ %00001100 RTS enabled, Tx line break + +* Control bit definitions +Ctl.Stop equ %10000000 stop bits (clear=1, set=2) +Ctl.DBit equ %01100000 see data bit table below +Ctl.RClk equ %00010000 Rx clock source (0=external, 1=internal) +Ctl.Baud equ %00001111 see baud rate table below + +* data bit table +DB.5 equ %01100000 five data bits per character +DB.6 equ %01000000 six data bits per character +DB.7 equ %00100000 seven data bits per character +DB.8 equ %00000000 eight data bits per character + +* baud rate table + org 0 +BR.ExClk rmb 1 16x external clock +BR.00050 rmb 1 50 baud +BR.00075 rmb 1 75 baud +BR.00110 rmb 1 109.92 baud +BR.00135 rmb 1 134.58 baud +BR.00150 rmb 1 150 baud +BR.00300 rmb 1 300 baud +BR.00600 rmb 1 600 baud +BR.01200 rmb 1 1200 baud +BR.01800 rmb 1 1800 baud +BR.02400 rmb 1 2400 baud +BR.03600 rmb 1 3600 baud +BR.04800 rmb 1 4800 baud +BR.07200 rmb 1 7200 baud +BR.09600 rmb 1 9600 baud +BR.19200 rmb 1 19200 baud + +* Btn.Cntr bit definitions +BC.Butn1 equ %00100000 button #1 (left, 1 = pressed) +BC.Butn2 equ %00010000 button #2 (middle, 1 = pressed) +BC.Butn3 equ %00001000 button #3 (right, 1 = pressed) +BC.RxCnt equ %00000111 Rx data counter + +BC.Butns equ BC.Butn1!BC.Butn2!BC.Butn3 mask for all buttons + + +* mouse static data area definitions + org 0 +Btn.Cntr rmb 1 mouse button status and Rx data counter +Buffer rmb 3 Rx buffer for 1st 3 bytes of XY mouse data (must start at 1,u) +CrntXPos rmb 2 mouse X position (0 to HResMaxX) +CrntYPos rmb 2 mouse Y position (0 to HResMaxY*2) + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/l52.defs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/l52.defs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,108 @@ + +* miscellaneous definitions +HResMaxX equ 639 high resolution X limit +HResMaxY equ 191 high resolution Y limit +MousData equ $0008 arbitrary choice for mouse data area ($0008-$000F) +PcktSize equ 5 number of bytes in mouse data packet +SyncData equ %10000000 initial mouse data byte pattern +SyncMask equ %11111000 mask for initial mouse data byte pattern + +* 65C52 register definitions + org 0 +ISReg rmb 1 IRQ Status (read only) +IEReg equ ISReg IRQ Enable (write only) +CSReg rmb 1 Control Status (read only) +CFReg equ CSReg Control/Format (write only) +CDReg rmb 1 Compare Data (write only, unused in this driver) +TBReg equ CDReg Transmit Break (write only) +DataReg rmb 1 receive/transmit Data (read Rx / write Tx) + +* IRQ Status/Enable bit definitions +ISE.IRQ equ %10000000 IRQ occurred/enable +ISE.TxE equ %01000000 Tx data register Empty +ISE.CTS equ %00100000 CTS transition +ISE.DCD equ %00010000 DCD transition +ISE.DSR equ %00001000 DSR transition +ISE.FOB equ %00000100 receive data Framing or Overrun error, or Break +ISE.Par equ %00000010 Parity error in Rx data +ISE.RxF equ %00000001 Rx data register Full + +ISE.Errs equ ISE.FOB!ISE.Par IRQ Status error bits +ISE.Flip equ $00 all ISR bits active when set +ISE.Mask equ ISE.FOB!ISE.Par!ISE.RxF active IRQs + +* Control Status bit definitions +CS.Frame equ %10000000 framing error (set=error) +CS.TxE equ %01000000 Tx data empty (set=empty) +CS.CTS equ %00100000 CTS input (set=disabled) +CS.DCD equ %00010000 DCD input (set=disabled) +CS.DSR equ %00001000 DSR input (set=disabled) +CS.Break equ %00000100 Rx line break (set=received break) +CS.DTR equ %00000010 DTR output (set=disabled) +CS.RTS equ %00000001 RTS output (set=disabled) + +* Control bit definitions +C.TBRCDR equ %01000000 Tx Break/Compare Data register access (set=Tx Break) +C.StpBit equ %00100000 stop bits (set=two, clear=one) +C.Echo equ %00010000 local echo (set=activated) +C.Baud equ %00001111 see baud rate table below + +* baud rate table + org 0 +BR.00050 rmb 1 50 baud +BR.00110 rmb 1 109.2 baud +BR.00135 rmb 1 134.58 baud +BR.00150 rmb 1 150 baud +BR.00300 rmb 1 300 baud +BR.00600 rmb 1 600 baud +BR.01200 rmb 1 1200 baud +BR.01800 rmb 1 1800 baud +BR.02400 rmb 1 2400 baud +BR.03600 rmb 1 3600 baud +BR.04800 rmb 1 4800 baud +BR.07200 rmb 1 7200 baud +BR.09600 rmb 1 9600 baud +BR.19200 rmb 1 19200 baud +BR.38400 rmb 1 38400 baud +BR.ExClk rmb 1 external Rx and Tx clocks + +* Format bit definitions +F.Slct equ %10000000 register select (set=Format, clear=Control) +F.DatBit equ %01100000 see data bit table below +F.Par equ %00011100 see parity table below +F.DTR equ %00000010 DTR output (set=disabled) +F.RTS equ %00000001 RTS output (set=disabled) + +* data bit table +DB.5 equ %00000000 five data bits per character +DB.6 equ %00100000 six data bits per character +DB.7 equ %01000000 seven data bits per character +DB.8 equ %01100000 eight data bits per character + +* parity table +Par.None equ %00000000 +Par.Odd equ %00000100 +Par.Even equ %00001100 +Par.Mark equ %00010100 +Par.Spac equ %00011100 + +* Transmit Break bit definitions +TB.Brk equ %00000010 Tx break control (set=transmit continuous line Break) +TB.Par equ %00000001 parity check (set=parity bit to ISE.Par, clear=normal) + +* Btn.Cntr bit definitions +BC.Butn1 equ %00100000 button #1 (left, 1 = pressed) +BC.Butn2 equ %00010000 button #2 (middle, 1 = pressed) +BC.Butn3 equ %00001000 button #3 (right, 1 = pressed) +BC.RxCnt equ %00000111 Rx data counter + +BC.Butns equ BC.Butn1!BC.Butn2!BC.Butn3 mask for all buttons + + +* mouse static data area definitions + org 0 +Btn.Cntr rmb 1 mouse button status and Rx data counter +Buffer rmb 3 Rx buffer for 1st 3 bytes of XY mouse data (must start at 1,u) +CrntXPos rmb 2 mouse X position (0 to HResMaxX) +CrntYPos rmb 2 mouse Y position (0 to HResMaxY*2) + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/os9defs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/os9defs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,901 @@ + nam OS9Defs + ttl OS-9 Level 1 & 2 System Symbol Definitions + +***************** +* Edition History +* +* Date Changes Made by +* -------- ------------------------------------------------------------ --- +* 85/08/29 Fixed DT.SBF/NFM values to 3/4 Kmz +* 85/09/01 Added SS.FDInf, SS.Attr to accept 68K request thru NET Kmz +* 85/09/03 Eliminated E$BPrcID, made Error #238 +* become E$DNE for 68000 compatability Kmz/rfd +* 86/04/15 F$AlHRam System call added for COCO MGH +* 86/09/08 F$Alarm for COCO Clock Module MGH +* 86/09/17 SS.Tone For COCO MGH +* 86/09/23 Added F$NMLink and F$NMLoad for COCO MGH +* 86/09/30 added Reserved User $70 to $7f in sytem calls MGH +* 86/09/30 Created Color Computer 3 Version of OS9Defs MGH +* 98/10/03 Consoldated Level 1/Level 2 os9defs BGP + + pag +***************************************** +* System Service Request Code Definitions +* + org 0 +F$Link rmb 1 Link to Module +F$Load rmb 1 Load Module from File +F$UnLink rmb 1 Unlink Module +F$Fork rmb 1 Start New Process +F$Wait rmb 1 Wait for Child Process to Die +F$Chain rmb 1 Chain Process to New Module +F$Exit rmb 1 Terminate Process +F$Mem rmb 1 Set Memory Size +F$Send rmb 1 Send Signal to Process +F$Icpt rmb 1 Set Signal Intercept +F$Sleep rmb 1 Suspend Process +F$SSpd rmb 1 Suspend Process +F$ID rmb 1 Return Process ID +F$SPrior rmb 1 Set Process Priority +F$SSWI rmb 1 Set Software Interrupt +F$PErr rmb 1 Print Error +F$PrsNam rmb 1 Parse Pathlist Name +F$CmpNam rmb 1 Compare Two Names +F$SchBit rmb 1 Search Bit Map +F$AllBit rmb 1 Allocate in Bit Map +F$DelBit rmb 1 Deallocate in Bit Map +F$Time rmb 1 Get Current Time +F$STime rmb 1 Set Current Time +F$CRC rmb 1 Generate CRC +F$GPrDsc rmb 1 get Process Descriptor copy +F$GBlkMp rmb 1 get System Block Map copy +F$GModDr rmb 1 get Module Directory copy +F$CpyMem rmb 1 Copy External Memory +F$SUser rmb 1 Set User ID number +F$UnLoad rmb 1 Unlink Module by name + + ifeq Level-1 + + rmb 3 + + else + +* Level 2 system calls +F$Alarm rmb 1 Color Computer Alarm Call + rmb 2 reserved - For overlap of other systems +F$NMLink rmb 1 Color Computer NonMapping Link +F$NMLoad rmb 1 Color Computer NonMapping Load + + endc + + org $27 Beginning of System Reserved Calls +F$VIRQ rmb 1 Install/Delete Virtual IRQ +F$SRqMem rmb 1 System Memory Request +F$SRtMem rmb 1 System Memory Return +F$IRQ rmb 1 Enter IRQ Polling Table +F$IOQu rmb 1 Enter I/O Queue +F$AProc rmb 1 Enter Active Process Queue +F$NProc rmb 1 Start Next Process +F$VModul rmb 1 Validate Module +F$Find64 rmb 1 Find Process/Path Descriptor +F$All64 rmb 1 Allocate Process/Path Descriptor +F$Ret64 rmb 1 Return Process/Path Descriptor +F$SSvc rmb 1 Service Request Table Initialization +F$IODel rmb 1 Delete I/O Module +F$SLink rmb 1 System Link +F$Boot rmb 1 Bootstrap System +F$BtMem rmb 1 Bootstrap Memory Request +F$GProcP rmb 1 Get Process ptr +F$Move rmb 1 Move Data (low bound first) +F$AllRAM rmb 1 Allocate RAM blocks +F$AllImg rmb 1 Allocate Image RAM blocks +F$DelImg rmb 1 Deallocate Image RAM blocks +F$SetImg rmb 1 Set Process DAT Image +F$FreeLB rmb 1 Get Free Low Block +F$FreeHB rmb 1 Get Free High Block +F$AllTsk rmb 1 Allocate Process Task number +F$DelTsk rmb 1 Deallocate Process Task number +F$SetTsk rmb 1 Set Process Task DAT registers +F$ResTsk rmb 1 Reserve Task number +F$RelTsk rmb 1 Release Task number +F$DATLog rmb 1 Convert DAT Block/Offset to Logical +F$DATTmp rmb 1 Make temporary DAT image (Obsolete) +F$LDAXY rmb 1 Load A [X,[Y]] +F$LDAXYP rmb 1 Load A [X+,[Y]] +F$LDDDXY rmb 1 Load D [D+X,[Y]] +F$LDABX rmb 1 Load A from 0,X in task B +F$STABX rmb 1 Store A at 0,X in task B +F$AllPrc rmb 1 Allocate Process Descriptor +F$DelPrc rmb 1 Deallocate Process Descriptor +F$ELink rmb 1 Link using Module Directory Entry +F$FModul rmb 1 Find Module Directory Entry +F$MapBlk rmb 1 Map Specific Block +F$ClrBlk rmb 1 Clear Specific Block +F$DelRAM rmb 1 Deallocate RAM blocks +F$GCMDir rmb 1 Pack module directory +F$AlHRam rmb 1 Allocate HIGH RAM Blocks +* +* Numbers $70 through $7F are reserved for user definitions +* + org $70 + rmb 16 Reserved for user definition + + pag +************************************** +* I/O Service Request Code Definitions +* + org $80 +I$Attach rmb 1 Attach I/O Device +I$Detach rmb 1 Detach I/O Device +I$Dup rmb 1 Duplicate Path +I$Create rmb 1 Create New File +I$Open rmb 1 Open Existing File +I$MakDir rmb 1 Make Directory File +I$ChgDir rmb 1 Change Default Directory +I$Delete rmb 1 Delete File +I$Seek rmb 1 Change Current Position +I$Read rmb 1 Read Data +I$Write rmb 1 Write Data +I$ReadLn rmb 1 Read Line of ASCII Data +I$WritLn rmb 1 Write Line of ASCII Data +I$GetStt rmb 1 Get Path Status +I$SetStt rmb 1 Set Path Status +I$Close rmb 1 Close Path +I$DeletX rmb 1 Delete from current exec dir + +******************* +* File Access Modes +* +READ. equ %00000001 +WRITE. equ %00000010 +UPDAT. equ READ.+WRITE. +EXEC. equ %00000100 +PREAD. equ %00001000 +PWRIT. equ %00010000 +PEXEC. equ %00100000 +SHARE. equ %01000000 +DIR. equ %10000000 +ISIZ. equ %00100000 + +************** +* Signal Codes +* + org 0 +S$Kill rmb 1 Non-Interceptable Abort +S$Wake rmb 1 Wake-up Sleeping Process +S$Abort rmb 1 Keyboard Abort +S$Intrpt rmb 1 Keyboard Interrupt +S$Window rmb 1 Window Change + + pag +********************************** +* Status Codes for GetStat/PutStat +* + org 0 +SS.Opt rmb 1 Read/Write PD Options +SS.Ready rmb 1 Check for Device Ready +SS.Size rmb 1 Read/Write File Size +SS.Reset rmb 1 Device Restore +SS.WTrk rmb 1 Device Write Track +SS.Pos rmb 1 Get File Current Position +SS.EOF rmb 1 Test for End of File +SS.Link rmb 1 Link to Status routines +SS.ULink rmb 1 Unlink Status routines +SS.Feed rmb 1 issue form feed +SS.Frz rmb 1 Freeze DD. information +SS.SPT rmb 1 Set DD.TKS to given value +SS.SQD rmb 1 Sequence down hard disk +SS.DCmd rmb 1 Send direct command to disk +SS.DevNm rmb 1 Return Device name (32-bytes at [X]) +SS.FD rmb 1 Return File Descriptor (Y-bytes at [X]) +SS.Ticks rmb 1 Set Lockout honor duration +SS.Lock rmb 1 Lock/Release record +SS.DStat rmb 1 Return Display Status (CoCo) +SS.Joy rmb 1 Return Joystick Value (CoCo) +SS.BlkRd rmb 1 Block Read +SS.BlkWr rmb 1 Block Write +SS.Reten rmb 1 Retension cycle +SS.WFM rmb 1 Write File Mark +SS.RFM rmb 1 Read past File Mark +SS.ELog rmb 1 Read Error Log +SS.SSig rmb 1 Send signal on data ready +SS.Relea rmb 1 Release device +SS.AlfaS rmb 1 Return Alfa Display Status (CoCo, SCF/GetStat) +SS.Attr equ SS.AlfaS to serve 68K/RBF/SetStat only, thru NET +SS.Break rmb 1 Send break signal out acia +SS.RsBit rmb 1 Reserve bitmap sector (do not allocate in) LSB(X)=sct# + rmb 1 reserved +SS.FDInf equ $20 to serve 68K/RBF/GetStat only, thru NET + rmb 4 reserve $20-$23 for Japanese version (Hoshi) +SS.SetMF rmb 1 reserve $24 for Gimix G68 (Flex compatability?) +SS.Cursr rmb 1 Cursor information for COCO +SS.ScSiz rmb 1 Return screen size for COCO +SS.KySns rmb 1 Getstat/Putstat for COCO keyboard +SS.ComSt rmb 1 Getstat/Putstat for Baud/Parity +SS.Open rmb 1 Putstat to tell driver a path was opened +SS.Close rmb 1 Putstat to tell driver a path was closed +SS.HngUp rmb 1 Putstat to tell driver to hangup phone +* System Specific and User defined codes above $80 + org $80 +SS.AAGBf rmb 1 Putstat to Allocate Additional Graphic Buffer +SS.SLGBf rmb 1 Putstat to Select a different Graphic Buuffer +SS.Mount rmb 1 Network 4 Mount Setstat +SS.RdNet rmb 1 Read Raw Sector from Network 4 Omnidrive +SS.MpGPB rmb 1 Putstat to request a Get/Put Buffer be mapped in workspace +SS.Slots rmb 1 Network 4 slots? getstat + + ifgt Level-1 + +* Level 2 Windowing +SS.WnSet rmb 1 Set up High Level Windowing Information +SS.MnSel rmb 1 Request High level Menu Handler take determine next event +SS.SBar rmb 1 Putstat to set position block on Window scroll bars +SS.Mouse rmb 1 Return Mouse information packet (COCO) +SS.MsSig rmb 1 Putstat to tell driver to send signal on mouse event +SS.AScrn rmb 1 Allocate a screen for application poking +SS.DScrn rmb 1 Display a screen allocated by SS.AScrn +SS.FScrn rmb 1 Free a screen allocated by SS.AScrn +SS.PScrn rmb 1 Polymorph Screen into different screen type + rmb 2 Reserved +SS.Palet rmb 1 Return palette information +SS.Montr rmb 1 Get and Set Monitor Type +SS.ScTyp rmb 1 Get screen type information +SS.GIP rmb 1 Global Input Parameters (SetStat) +SS.UMBar rmb 1 update menu bar (SetStat) +SS.FBRgs rmb 1 return color registers (GetStat) +SS.DfPal rmb 1 set/return default palette registers (Getstat/Setstat) +SS.Tone rmb 1 Generate a tone using 6 bit sound + + endc + + ttl Direct Page Definitions + pag + +********************************** +* Direct Page Variable Definitions +* + org $20 + + ifeq Level-1 + +* Level 1 DP vars +D.FMBM rmb 4 Free memory bit map pointers +D.MLIM rmb 2 Memory limit $24 +D.ModDir rmb 4 Module directory $26 +D.Init rmb 2 Rom base address $2A +D.SWI3 rmb 2 Swi3 vector $2C +D.SWI2 rmb 2 Swi2 vector $2E +D.FIRQ rmb 2 Firq vector $30 +D.IRQ rmb 2 Irq vector $32 +D.SWI rmb 2 Swi vector $34 +D.NMI rmb 2 Nmi vector $36 +D.SvcIRQ rmb 2 Interrupt service entry $38 +D.Poll rmb 2 Interrupt polling routine $3A +D.UsrIRQ rmb 2 User irq routine $3C +D.SysIRQ rmb 2 System irq routine $3E +D.UsrSvc rmb 2 User service request routine $40 +D.SysSvc rmb 2 System service request routine $42 +D.UsrDis rmb 2 User service request dispatch table +D.SysDis rmb 2 System service reuest dispatch table +D.Slice rmb 1 Process time slice count $48 +D.PrcDBT rmb 2 Process descriptor block address $49 +D.Proc rmb 2 Process descriptor address $4B +D.AProcQ rmb 2 Active process queue $4D +D.WProcQ rmb 2 Waiting process queue $4F +D.SProcQ rmb 2 Sleeping process queue $51 +D.Time equ . Time +D.Year rmb 1 $53 +D.Month rmb 1 $54 +D.Day rmb 1 $55 +D.Hour rmb 1 $56 +D.Min rmb 1 $57 +D.Sec rmb 1 $58 +D.Tick rmb 1 $59 +D.TSec rmb 1 Ticks / second $5A +D.TSlice rmb 1 Ticks / time-slice $5B +D.IOML rmb 2 I/O mgr free memory low bound $5C +D.IOMH rmb 2 I/O mgr free memory hi bound $5E +D.DevTbl rmb 2 Device driver table addr $60 +D.PolTbl rmb 2 Irq polling table addr $62 +D.PthDBT rmb 2 Path descriptor block table addr $64 +D.BTLO rmb 2 Bootstrap low address $66 +D.BTHI rmb 2 Bootstrap hi address $68 +D.DMAReq rmb 1 DMA in use flag $6A +D.AltIRQ rmb 2 Alternate IRQ vector (CC) $6B +D.KbdSta rmb 2 Keyboard scanner static storage (CC) $6D +D.DskTmr rmb 2 Disk Motor Timer (CC) $6F +D.CBStrt rmb 16 reserved for CC warmstart ($71) +D.Clock rmb 2 Address of Clock Tick Routine (CC) $81 +D.Boot rmb 1 Bootstrap attempted flag +D.URtoSs rmb 2 address of user to system routine (VIRQ) $84 +D.CLTB rmb 2 Pointer to clock interrupt table (VIRQ) $86 + +* TABLE SIZES +BMAPSZ equ 32 BIT MAP SIZE +SVCTNM equ 2 NUMBER OF SERVICE REQUEST TABLES +SVCTSZ equ (256-BMAPSZ)/SVCTNM-2 SERVICE REQUEST TABLE SIZE + + else + +* Level 2 DP vars +D.Tasks rmb 2 Task User Table +D.TmpDAT rmb 2 Temporary DAT Image stack +D.Init rmb 2 Initialization Module ptr +D.Poll rmb 2 Interrupt Polling Routine ptr +D.Time equ . System Time +D.Year rmb 1 +D.Month rmb 1 +D.Day rmb 1 +D.Hour rmb 1 +D.Min rmb 1 +D.Sec rmb 1 +D.Tick rmb 1 +D.Slice rmb 1 current slice remaining +D.TSlice rmb 1 Ticks per Slice +D.Boot rmb 1 Bootstrap attempted flag +D.MotOn rmb 1 Floppy Disk Motor-On time out +D.ErrCod rmb 1 Reset Error Code +D.Daywk rmb 1 day of week, com-trol clock +D.TkCnt rmb 1 Tick Counter +D.BtPtr rmb 2 Address of Boot in System Address space +D.BtSz rmb 2 Size of Boot + org $40 +D.BlkMap rmb 4 Memory Block Map ptr +D.ModDir rmb 4 Module Directory ptrs +D.PrcDBT rmb 2 Process Descriptor Block Table ptr +D.SysPrc rmb 2 System Process Descriptor ptr +D.SysDAT rmb 2 System DAT Image ptr +D.SysMem rmb 2 System Memory Map ptr +D.Proc rmb 2 Current Process ptr +D.AProcQ rmb 2 Active Process Queue +D.WProcQ rmb 2 Waiting Process Queue +D.SProcQ rmb 2 Sleeping Process Queue +D.ModEnd rmb 2 Module Directory end ptr +D.ModDAT rmb 2 Module Dir DAT image end ptr +D.CldRes rmb 2 Cold Restart vector + org $6B +D.Crash rmb 6 Pointer to CC Crash Routine +D.CBStrt rmb $B Reserved for CC warmstart ($71) + org $80 +D.DevTbl rmb 2 I/O Device Table +D.PolTbl rmb 2 I/O Polling Table + rmb 4 reserved +D.PthDBT rmb 2 Path Descriptor Block Table ptr +D.DMAReq rmb 1 DMA Request flag + + endc + + ifgt Level-1 + +******** +* CoCo 3 STUFF COMES NEXT +* This area is used for the CoCo Hardware Registers +* + org $90 +D.HINIT rmb 1 GIME INIT0 register (hardware setup $FF90) +D.TINIT rmb 1 GIME INIT1 register (timer/task register $FF91) +D.IRQER rmb 1 Interrupt enable regsiter ($FF92) +D.FRQER rmb 1 Fast Interrupt enable register ($FF93) +D.TIMMS rmb 1 Timer most significant nibble ($FF94) +D.TIMLS rmb 1 Timer least significant byte ($FF95) +D.RESV1 rmb 1 reserved register ($FF96) +D.RESV2 rmb 1 reserved register ($FF97) +D.VIDMD rmb 1 video mode register ($FF98) +D.VIDRS rmb 1 video resolution register ($FF99) +D.BORDR rmb 1 border register ($FF9A) +D.RESV3 rmb 1 reserved register ($FF9B) +D.VOFF2 rmb 1 vertical scroll/offset 2 register ($FF9C) +D.VOFF1 rmb 1 vertical offset 1 register ($FF9D) +D.VOFF0 rmb 1 vertical offset 0 register ($FF9E) +D.HOFF0 rmb 1 horizontal offset 0 register ($FF9F) +D.Speed rmb 1 Speed of COCO CPU 0=slow,1=fast +D.TskIPt rmb 2 Task image Pointer table (CC) +D.MemSz rmb 1 128/512K memory flag (CC) +D.SSTskN rmb 1 System State Task Number (COCO) +D.CCMem rmb 2 Pointer to beginning of CC Memory +D.CCStk rmb 2 Pointer to top of CC Memory +D.Flip0 rmb 2 Change to Task 0 +D.Flip1 rmb 2 Change to reserved Task 1 +D.VIRQ rmb 2 VIRQ Polling routine +D.IRQS rmb 1 IRQ shadow register (CC Temporary) +D.CLTb rmb 2 VIRQ Table address +D.AltIRQ rmb 2 Alternate IRQ Vector (CC) +D.GPoll rmb 2 CC GIME IRQ enable/disable toggle +D.Clock2 rmb 2 CC Clock2 entry address + org $C0 +D.SysSvc rmb 2 System Service Routine entry +D.SysDis rmb 2 System Service Dispatch Table ptr +D.SysIRQ rmb 2 System IRQ Routine entry +D.UsrSvc rmb 2 User Service Routine entry +D.UsrDis rmb 2 User Service Dispatch Table ptr +D.UsrIRQ rmb 2 User IRQ Routine entry +D.SysStk rmb 2 System stack +D.SvcIRQ rmb 2 In-System IRQ service +D.SysTsk rmb 1 System Task number + org $E0 +D.Clock rmb 2 +D.XSWI3 rmb 2 +D.XSWI2 rmb 2 +D.XFIRQ rmb 2 +D.XIRQ rmb 2 +D.XSWI rmb 2 +D.XNMI rmb 2 +D.ErrRst rmb 2 + org $F2 +D.SWI3 rmb 2 +D.SWI2 rmb 2 +D.FIRQ rmb 2 +D.IRQ rmb 2 +D.SWI rmb 2 +D.NMI rmb 2 + +************************** +* Level II Block Map flags +* +NotRAM equ %10000000 Block Not RAM flag +ModBlock equ %00000010 Module in Block +RAMinUse equ %00000001 RAM Block in use flag +* +* Service Dispatch Table special entries +* +IOEntry equ 254 + + endc + + ttl Structure Formats + pag +************************************ +* Module Directory Entry Definitions +* + org 0 +MD$MPDAT rmb 2 Module DAT Image ptr +MD$MBSiz rmb 2 Memory Block size +MD$MPtr rmb 2 Module ptr +MD$Link rmb 2 Module Link count +MD$ESize equ . Module Directory Entry size + +******************** +* Module Definitions +* +* Universal Module Offsets +* + org 0 +M$ID rmb 2 ID Code +M$Size rmb 2 Module Size +M$Name rmb 2 Module Name +M$Type rmb 1 Type / Language +M$Revs rmb 1 Attributes / Revision Level +M$Parity rmb 1 Header Parity +M$IDSize equ . Module ID Size +* +* Type-Dependent Module Offsets +* +* System, File Manager, Device Driver, Program Module +* +M$Exec rmb 2 Execution Entry Offset +* +* Device Driver, Program Module +* +M$Mem rmb 2 Stack Requirement +* +* Device Driver, Device Descriptor Module +* +M$Mode rmb 1 Device Driver Mode Capabilities +* +* Device Descriptor Module +* + org M$IDSize +M$FMgr rmb 2 File Manager Name Offset +M$PDev rmb 2 Device Driver Name Offset + rmb 1 M$Mode (defined above) +M$Port rmb 3 Port Address +M$Opt rmb 1 Device Default Options +M$DTyp rmb 1 Device Type +IT.DTP equ M$DTyp Descriptor type offset +* +* Configuration Module Entry Offsets +* + org M$IDSize +MaxMem rmb 3 Maximum Free Memory +PollCnt rmb 1 Entries in Interrupt Polling Table +DevCnt rmb 1 Entries in Device Table +InitStr rmb 2 Initial Module Name +SysStr rmb 2 System Device Name +StdStr rmb 2 Standard I/O Pathlist +BootStr rmb 2 Bootstrap Module name +ProtFlag rmb 1 Write protect enable flag + + pag +************************** +* Module Field Definitions +* +* ID Field +* +M$ID1 equ $87 Module ID code byte one +M$ID2 equ $CD Module ID code byte two +M$ID12 equ M$ID1*256+M$ID2 +* +* Module Type / Language byte +* +* Field Masks +* +TypeMask equ %11110000 Type Field +LangMask equ %00001111 Language Field +* +* Type Values +* +Devic equ $F0 Device Descriptor Module +Drivr equ $E0 Physical Device Driver +FlMgr equ $D0 File Manager +Systm equ $C0 System Module +Data equ $40 Data Module +Multi equ $30 Multi-Module +Sbrtn equ $20 Subroutine Module +Prgrm equ $10 Program Module +* +* Language Values +* +Objct equ 1 6809 Object Code Module +ICode equ 2 Basic09 I-code +PCode equ 3 Pascal P-code +CCode equ 4 C I-code +CblCode equ 5 Cobol I-code +FrtnCode equ 6 Fortran I-code +* +* Module Attributes / Revision byte +* +* Field Masks +* +AttrMask equ %11110000 Attributes Field +RevsMask equ %00001111 Revision Level Field +* +* Attribute Flags +* +ReEnt equ %10000000 Re-Entrant Module +Modprot equ %01000000 Gimix Module protect bit (0=protected, 1=write enable) + +******************** +* Device Type Values +* +DT.SCF equ 0 Sequential Character File Type +DT.RBF equ 1 Random Block File Type +DT.Pipe equ 2 Pipe File Type + + ifeq Level-1 + +DT.NFM equ 3 + + else + +DT.SBF equ 3 +DT.NFM equ 4 Network File Manager + + endc + +********************* +* CRC Result Constant +* +CRCCon1 equ $80 +CRCCon23 equ $0FE3 + + ttl Process Information + pag +******************************** +* Process Descriptor Definitions +* + ifeq Level-1 + +* Level 1 process descriptor defs +DefIOSiz equ 12 +NumPaths equ 16 Number of Local Paths + + org 0 +P$ID rmb 1 Process ID +P$PID rmb 1 Parent's ID +P$SID rmb 1 Sibling's ID +P$CID rmb 1 Child's ID +P$SP rmb 2 Stack ptr +P$CHAP rmb 1 process chapter number +P$ADDR rmb 1 user address beginning page number +P$PagCnt rmb 1 Memory Page Count +P$User rmb 2 User Index $09 +P$Prior rmb 1 Priority $0B +P$Age rmb 1 Age $0C +P$State rmb 1 Status $0D +P$Queue rmb 2 Queue Link (Process ptr) $0E +P$IOQP rmb 1 Previous I/O Queue Link (Process ID) $10 +P$IOQN rmb 1 Next I/O Queue Link (Process ID) +P$PModul rmb 2 Primary Module +P$SWI rmb 2 SWI Entry Point +P$SWI2 rmb 2 SWI2 Entry Point +P$SWI3 rmb 2 SWI3 Entry Point $18 +P$DIO rmb DefIOSiz default I/O ptrs $1A +P$PATH rmb NumPaths I/O path table $26 +P$Signal rmb 1 Signal Code $36 +P$SigVec rmb 2 Signal Intercept Vector +P$SigDat rmb 2 Signal Intercept Data Address +P$NIO rmb 4 additional dio pointers for net + rmb $40-. unused +P$Size equ . Size of Process Descriptor + +* +* Process State Flags +* +SysState equ %10000000 +TimSleep equ %01000000 +TimOut equ %00100000 +ImgChg equ %00010000 +Condem equ %00000010 +Dead equ %00000001 + + else + +* Level 2 process descriptor defs +DefIOSiz equ 16 Default I/O Data Length +NefIOSiz equ 12 On-Net Default I/O Data Length +NumPaths equ 16 Number of Local Paths + + org 0 +P$ID rmb 1 Process ID +P$PID rmb 1 Parent's ID +P$SID rmb 1 Sibling's ID +P$CID rmb 1 Child's ID +P$SP rmb 2 Stack ptr +P$Task rmb 1 Task Number +P$PagCnt rmb 1 Memory Page Count +P$User rmb 2 User Index +P$Prior rmb 1 Priority +P$Age rmb 1 Age +P$State rmb 1 Status +P$Queue rmb 2 Queue Link (Process ptr) +P$IOQP rmb 1 Previous I/O Queue Link (Process ID) +P$IOQN rmb 1 Next I/O Queue Link (Process ID) +P$PModul rmb 2 Primary Module +P$SWI rmb 2 SWI Entry Point +P$SWI2 rmb 2 SWI2 Entry Point +P$SWI3 rmb 2 SWI3 Entry Point +P$Signal rmb 1 Signal Code +P$SigVec rmb 2 Signal Intercept Vector +P$SigDat rmb 2 Signal Intercept Data Address +P$DeadLk rmb 1 Dominant proc ID if I/O locked + rmb $20-. unused +P$DIO rmb DefIOSiz Default I/O ptrs +P$Path rmb NumPaths I/O Path Table +P$DATImg rmb 64 DAT Image +P$Links rmb 32 Block Link counts +P$NIO rmb 6*2 additional DIO ptrs for net, compatible with 68k +P$SelP rmb 1 Selected Path for COCO Windows (Default 0) + rmb $200-. Local stack +P$Stack equ . Top of Stack +P$Size equ . Size of Process Descriptor + +* +* Process State Flags +* +SysState equ %10000000 +TimSleep equ %01000000 +TimOut equ %00100000 +ImgChg equ %00010000 +Suspend equ %00001000 +Condem equ %00000010 +Dead equ %00000001 + + endc + + ttl OS-9 I/O Symbolic Definitions + pag +************************* +* Path Descriptor Offsets +* + org 0 +PD.PD rmb 1 Path Number +PD.MOD rmb 1 Mode (Read/Write/Update) +PD.CNT rmb 1 Number of Open Images +PD.DEV rmb 2 Device Table Entry Address +PD.CPR rmb 1 Current Process +PD.RGS rmb 2 Caller's Register Stack +PD.BUF rmb 2 Buffer Address +PD.FST rmb 32-. File Manager's Storage +PD.OPT equ . PD GetSts(0) Options +PD.DTP rmb 1 Device Type + rmb 64-. Path options +PDSIZE equ . + +* +* Pathlist Special Symbols +* +PDELIM equ '/ Pathlist Name Separator +PDIR equ '. Directory +PENTIR equ '@ Entire Device + page +**************************** +* File Manager Entry Offsets +* + org 0 +FMCREA rmb 3 Create (Open New) File +FMOPEN rmb 3 Open File +FMMDIR rmb 3 Make Directory +FMCDIR rmb 3 Change Directory +FMDLET rmb 3 Delete File +FMSEEK rmb 3 Position File +FMREAD rmb 3 Read from File +FMWRIT rmb 3 Write to File +FMRDLN rmb 3 ReadLn +FMWRLN rmb 3 WritLn +FMGSTA rmb 3 Get File Status +FMSSTA rmb 3 Set File Status +FMCLOS rmb 3 Close File + +***************************** +* Device Driver Entry Offsets +* + org 0 +D$INIT rmb 3 Device Initialization +D$READ rmb 3 Read from Device +D$WRIT rmb 3 Write to Device +D$GSTA rmb 3 Get Device Status +D$PSTA rmb 3 Put Device Status +D$TERM rmb 3 Device Termination + +********************* +* Device Table Format +* + org 0 +V$DRIV rmb 2 Device Driver module +V$STAT rmb 2 Device Driver Static storage +V$DESC rmb 2 Device Descriptor module +V$FMGR rmb 2 File Manager module +V$USRS rmb 1 use count +DEVSIZ equ . + +******************************* +* Device Static Storage Offsets +* + org 0 +V.PAGE rmb 1 Port Extended Address +V.PORT rmb 2 Device 'Base' Port Address +V.LPRC rmb 1 Last Active Process ID +V.BUSY rmb 1 Active Process ID (0=UnBusy) +V.WAKE rmb 1 Active PD if Driver MUST Wake-up +V.USER equ . Driver Allocation Origin + +******************************** +* Interrupt Polling Table Format +* + org 0 +Q$POLL rmb 2 Absolute Polling Address +Q$FLIP rmb 1 Flip (EOR) Byte ..normally Zero +Q$MASK rmb 1 Polling Mask (after Flip) +Q$SERV rmb 2 Absolute Service routine Address +Q$STAT rmb 2 Static Storage Address +Q$PRTY rmb 1 Priority (Low Numbers=Top Priority) +POLSIZ equ . + +******************** +* VIRQ packet format +* + org 0 +Vi.Cnt rmb 2 count down counter +Vi.Rst rmb 2 reset value for counter +Vi.Stat rmb 1 status byte + +Vi.IFlag equ %00000001 status byte virq flag + + page +************************************* +* Machine Characteristics Definitions +* +R$CC equ 0 Condition Codes register +R$A equ 1 A Accumulator +R$B equ 2 B Accumulator +R$D equ R$A Combined A:B Accumulator +R$DP equ 3 Direct Page register +R$X equ 4 X Index register +R$Y equ 6 Y Index register +R$U equ 8 User Stack register +R$PC equ 10 Program Counter register +R$Size equ 12 Total register package size + +Entire equ %10000000 Full Register Stack flag +FIRQMask equ %01000000 Fast-Interrupt Mask bit +HalfCrry equ %00100000 Half Carry flag +IRQMask equ %00010000 Interrupt Mask bit +Negative equ %00001000 Negative flag +Zero equ %00000100 Zero flag +TwosOvfl equ %00000010 Two's Comp Overflow flag +Carry equ %00000001 Carry bit +IntMasks equ IRQMask+FIRQMask +Sign equ %10000000 sign bit + +true equ 1 useful name +false equ 0 useful name + + ttl Error Code Definitions + pag +************************ +* Error Code Definitions +* +* +* System Dependent Error Codes +* + + ifgt Level-1 + +* Level 2 windowing error codes + org 186 +E$StkOvf rmb 1 Stack overflow +E$IllArg rmb 1 Illegal argument + rmb 1 reserved +E$ICoord rmb 1 Illegal coordinates +E$Bug rmb 1 Bug (should never be returned) +E$BufSiz rmb 1 Buffer size is too small +E$IllCmd rmb 1 Illegal command +E$TblFul rmb 1 Screen or window table is full +E$BadBuf rmb 1 Bad/Undefined buffer number +E$IWDef rmb 1 Illegal window definition +E$WUndef rmb 1 Window undefined + + endc + +* +* Standard OS-9 Error Codes +* + org 200 +E$PthFul rmb 1 Path Table full +E$BPNum rmb 1 Bad Path Number +E$Poll rmb 1 Polling Table Full +E$BMode rmb 1 Bad Mode +E$DevOvf rmb 1 Device Table Overflow +E$BMID rmb 1 Bad Module ID +E$DirFul rmb 1 Module Directory Full +E$MemFul rmb 1 Process Memory Full +E$UnkSvc rmb 1 Unknown Service Code +E$ModBsy rmb 1 Module Busy +E$BPAddr rmb 1 Bad Page Address +E$EOF rmb 1 End of File + rmb 1 +E$NES rmb 1 Non-Existing Segment +E$FNA rmb 1 File Not Accesible +E$BPNam rmb 1 Bad Path Name +E$PNNF rmb 1 Path Name Not Found +E$SLF rmb 1 Segment List Full +E$CEF rmb 1 Creating Existing File +E$IBA rmb 1 Illegal Block Address +E$HangUp rmb 1 Carrier Detect Lost +E$MNF rmb 1 Module Not Found + rmb 1 +E$DelSP rmb 1 Deleting Stack Pointer memory +E$IPrcID rmb 1 Illegal Process ID +E$BPrcID equ E$IPrcID Bad Process ID (formerly #238) + rmb 1 +E$NoChld rmb 1 No Children +E$ISWI rmb 1 Illegal SWI code +E$PrcAbt rmb 1 Process Aborted +E$PrcFul rmb 1 Process Table Full +E$IForkP rmb 1 Illegal Fork Parameter +E$KwnMod rmb 1 Known Module +E$BMCRC rmb 1 Bad Module CRC +E$USigP rmb 1 Unprocessed Signal Pending +E$NEMod rmb 1 Non Existing Module +E$BNam rmb 1 Bad Name +E$BMHP rmb 1 (bad module header parity) +E$NoRam rmb 1 No (System) Ram Available +E$DNE rmb 1 Directory not empty +E$NoTask rmb 1 No available Task number + rmb $F0-. reserved +E$Unit rmb 1 Illegal Unit (drive) +E$Sect rmb 1 Bad SECTor number +E$WP rmb 1 Write Protect +E$CRC rmb 1 Bad Check Sum +E$Read rmb 1 Read Error +E$Write rmb 1 Write Error +E$NotRdy rmb 1 Device Not Ready +E$Seek rmb 1 Seek Error +E$Full rmb 1 Media Full +E$BTyp rmb 1 Bad Type (incompatable) media +E$DevBsy rmb 1 Device Busy +E$DIDC rmb 1 Disk ID Change +E$Lock rmb 1 Record is busy (locked out) +E$Share rmb 1 Non-sharable file busy +E$DeadLk rmb 1 I/O Deadlock error + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/os9defs.l2v3 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/os9defs.l2v3 Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,868 @@ + nam os9defs + ttl OS-9 Level 2 V3 System Symbol Definitions + +***************** +* Edition History +* +* Date Changes Made by +* -------- ------------------------------------------------------------ --- +* 85/08/29 Fixed DT.SBF/NFM values to 3/4 Kmz +* 85/09/01 Added SS.FDInf, SS.Attr to accept 68K request thru NET Kmz +* 85/09/03 Eliminated E$BPrcID, made Error #238 +* become E$DNE for 68000 compatability Kmz/rfd +* 86/04/15 F$AlHRam System call added for COCO MGH +* 86/09/08 F$Alarm for COCO Clock Module MGH +* 86/09/17 SS.Tone For COCO MGH +* 86/09/23 Added F$NMLink and F$NMLoad for COCO MGH +* 86/09/30 added Reserved User $70 to $7f in sytem calls MGH +* 86/09/30 Created Color Computer 3 Version of OS9Defs MGH +* 88/12/13 Added Module Table Offsets KKD/BRI +* 88/12/22 Added process accounting to process descriptor BRI +* 98/09/18 Expanded Init module to include more info BGP +* 98/10/10 Added L2V3 specific setstat/getstat codes BGP +* 98/10/15 Added definitions from Bruce Isted's Eliminator software BGP +* 98/10/26 Added Basic09 error definitions BGP + + page +***************************************** +* System Service Request Code Definitions +* + org 0 +F$Link rmb 1 Link to Module +F$Load rmb 1 Load Module from File +F$UnLink rmb 1 Unlink Module +F$Fork rmb 1 Start New Process +F$Wait rmb 1 Wait for Child Process to Die +F$Chain rmb 1 Chain Process to New Module +F$Exit rmb 1 Terminate Process +F$Mem rmb 1 Set Memory Size +F$Send rmb 1 Send Signal to Process +F$Icpt rmb 1 Set Signal Intercept +F$Sleep rmb 1 Suspend Process +F$SSpd rmb 1 Suspend Process +F$ID rmb 1 Return Process ID +F$SPrior rmb 1 Set Process Priority +F$SSWI rmb 1 Set Software Interrupt +F$PErr rmb 1 Print Error +F$PrsNam rmb 1 Parse Pathlist Name +F$CmpNam rmb 1 Compare Two Names +F$SchBit rmb 1 Search Bit Map +F$AllBit rmb 1 Allocate in Bit Map +F$DelBit rmb 1 Deallocate in Bit Map +F$Time rmb 1 Get Current Time +F$STime rmb 1 Set Current Time +F$CRC rmb 1 Generate CRC +F$GPrDsc rmb 1 get Process Descriptor copy +F$GBlkMp rmb 1 get System Block Map copy +F$GModDr rmb 1 get Module Directory copy +F$CpyMem rmb 1 Copy External Memory +F$SUser rmb 1 Set User ID number +F$UnLoad rmb 1 Unlink Module by name +F$Alarm rmb 1 Color Computer Alarm Call + rmb 2 reserved - For overlap of other systems +F$NMLink rmb 1 Color Computer NonMapping Link +F$NMLoad rmb 1 Color Computer NonMapping Load + org $25 +F$TPS rmb 1 Return System's Ticks Per Second +F$TimAlm rmb 1 + org $27 Beginning of System Reserved Calls +F$VIRQ rmb 1 Install/Delete Virtual IRQ +F$SRqMem rmb 1 System Memory Request +F$SRtMem rmb 1 System Memory Return +F$IRQ rmb 1 Enter IRQ Polling Table +F$IOQu rmb 1 Enter I/O Queue +F$AProc rmb 1 Enter Active Process Queue +F$NProc rmb 1 Start Next Process +F$VModul rmb 1 Validate Module +F$Find64 rmb 1 Find Process/Path Descriptor +F$All64 rmb 1 Allocate Process/Path Descriptor +F$Ret64 rmb 1 Return Process/Path Descriptor +F$SSvc rmb 1 Service Request Table Initialization +F$IODel rmb 1 Delete I/O Module +F$SLink rmb 1 System Link +F$Boot rmb 1 Bootstrap System +F$BtMem rmb 1 Bootstrap Memory Request +F$GProcP rmb 1 Get Process ptr +F$Move rmb 1 Move Data (low bound first) +F$AllRAM rmb 1 Allocate RAM blocks +F$AllImg rmb 1 Allocate Image RAM blocks +F$DelImg rmb 1 Deallocate Image RAM blocks +F$SetImg rmb 1 Set Process DAT Image +F$FreeLB rmb 1 Get Free Low Block +F$FreeHB rmb 1 Get Free High Block +F$AllTsk rmb 1 Allocate Process Task number +F$DelTsk rmb 1 Deallocate Process Task number +F$SetTsk rmb 1 Set Process Task DAT registers +F$ResTsk rmb 1 Reserve Task number +F$RelTsk rmb 1 Release Task number +F$DATLog rmb 1 Convert DAT Block/Offset to Logical +F$DATTmp rmb 1 Make temporary DAT image (Obsolete) +F$LDAXY rmb 1 Load A [X,[Y]] +F$LDAXYP rmb 1 Load A [X+,[Y]] +F$LDDDXY rmb 1 Load D [D+X,[Y]] +F$LDABX rmb 1 Load A from 0,X in task B +F$STABX rmb 1 Store A at 0,X in task B +F$AllPrc rmb 1 Allocate Process Descriptor +F$DelPrc rmb 1 Deallocate Process Descriptor +F$ELink rmb 1 Link using Module Directory Entry +F$FModul rmb 1 Find Module Directory Entry +F$MapBlk rmb 1 Map Specific Block +F$ClrBlk rmb 1 Clear Specific Block +F$DelRAM rmb 1 Deallocate RAM blocks +F$GCMDir rmb 1 Pack module directory +F$AlHRam rmb 1 Allocate HIGH RAM Blocks +* +* Numbers $70 through $7F are reserved for user definitions +* + org $70 +F$RegDmp rmb 1 +F$NVRAM rmb 1 + + rmb $80-. Reserved for user definition + + page +************************************** +* I/O Service Request Code Definitions +* + org $80 +I$Attach rmb 1 Attach I/O Device +I$Detach rmb 1 Detach I/O Device +I$Dup rmb 1 Duplicate Path +I$Create rmb 1 Create New File +I$Open rmb 1 Open Existing File +I$MakDir rmb 1 Make Directory File +I$ChgDir rmb 1 Change Default Directory +I$Delete rmb 1 Delete File +I$Seek rmb 1 Change Current Position +I$Read rmb 1 Read Data +I$Write rmb 1 Write Data +I$ReadLn rmb 1 Read Line of ASCII Data +I$WritLn rmb 1 Write Line of ASCII Data +I$GetStt rmb 1 Get Path Status +I$SetStt rmb 1 Set Path Status +I$Close rmb 1 Close Path +I$DeletX rmb 1 Delete from current exec dir + +******************* +* File Access Modes +* +READ. equ %00000001 +WRITE. equ %00000010 +UPDAT. equ READ.+WRITE. +EXEC. equ %00000100 +PREAD. equ %00001000 +PWRIT. equ %00010000 +PEXEC. equ %00100000 +SHARE. equ %01000000 +DIR. equ %10000000 +ISIZ. equ %00100000 + +************** +* Signal Codes +* + org 0 +S$Kill rmb 1 Non-Interceptable Abort +S$Wake rmb 1 Wake-up Sleeping Process +S$Abort rmb 1 Keyboard Abort +S$Intrpt rmb 1 Keyboard Interrupt +S$Window rmb 1 Window Change +S$Alarm rmb 1 + + page +********************************** +* Status Codes for GetStat/PutStat +* + org 0 +SS.Opt rmb 1 Read/Write PD Options +SS.Ready rmb 1 Check for Device Ready +SS.Size rmb 1 Read/Write File Size +SS.Reset rmb 1 Device Restore +SS.WTrk rmb 1 Device Write Track +SS.Pos rmb 1 Get File Current Position +SS.EOF rmb 1 Test for End of File +SS.Link rmb 1 Link to Status routines +SS.ULink rmb 1 Unlink Status routines +SS.Feed rmb 1 issue form feed +SS.Frz rmb 1 Freeze DD. information +SS.SPT rmb 1 Set DD.TKS to given value +SS.SQD rmb 1 Sequence down hard disk +SS.DCmd rmb 1 Send direct command to disk +SS.DevNm rmb 1 Return Device name (32-bytes at [X]) +SS.FD rmb 1 Return File Descriptor (Y-bytes at [X]) +SS.Ticks rmb 1 Set Lockout honor duration +SS.Lock rmb 1 Lock/Release record +SS.DStat rmb 1 Return Display Status (CoCo) +SS.Joy rmb 1 Return Joystick Value (CoCo) +SS.BlkRd rmb 1 Block Read +SS.BlkWr rmb 1 Block Write +SS.Reten rmb 1 Retension cycle +SS.WFM rmb 1 Write File Mark +SS.RFM rmb 1 Read past File Mark +SS.ELog rmb 1 Read Error Log +SS.SSig rmb 1 Send signal on data ready +SS.Relea rmb 1 Release device +SS.AlfaS rmb 1 Return Alfa Display Status (CoCo, SCF/GetStat) +SS.Attr equ SS.AlfaS to serve 68K/RBF/SetStat only, thru NET +SS.Break rmb 1 Send break signal out acia +SS.RsBit rmb 1 Reserve bitmap sector (do not allocate in) LSB(X)=sct# + rmb 1 reserved +SS.FDInf equ $20 to serve 68K/RBF/GetStat only, thru NET + rmb 4 reserve $20-$23 for Japanese version (Hoshi) +SS.SetMF rmb 1 reserve $24 for Gimix G68 (Flex compatability?) +SS.Cursr rmb 1 Cursor information for COCO +SS.ScSiz rmb 1 Return screen size for COCO +SS.KySns rmb 1 Getstat/Putstat for COCO keyboard +SS.ComSt rmb 1 Getstat/Putstat for Baud/Parity +SS.Open rmb 1 Putstat to tell driver a path was opened +SS.Close rmb 1 Putstat to tell driver a path was closed +SS.HngUp rmb 1 Putstat to tell driver to hangup phone +* System Specific and User defined codes above $80 + org $80 +SS.AAGBf rmb 1 Putstat to Allocate Additional Graphic Buffer +SS.SLGBf rmb 1 Putstat to Select a different Graphic Buuffer +SS.Mount rmb 1 Network 4 Mount Setstat +SS.RdNet rmb 1 Read Raw Sector from Network 4 Omnidrive +SS.MpGPB rmb 1 Putstat to request a Get/Put Buffer be mapped in workspace +SS.Slots rmb 1 Network 4 slots? getstat +SS.WnSet rmb 1 Set up High Level Windowing Information +SS.MnSel rmb 1 Request High level Menu Handler take determine next event +SS.SBar rmb 1 Putstat to set position block on Window scroll bars +SS.Mouse rmb 1 Return Mouse information packet (COCO) +SS.MsSig rmb 1 Putstat to tell driver to send signal on mouse event +SS.AScrn rmb 1 Allocate a screen for application poking +SS.DScrn rmb 1 Display a screen allocated by SS.AScrn +SS.FScrn rmb 1 Free a screen allocated by SS.AScrn +SS.PScrn rmb 1 Polymorph Screen into different screen type +SS.MScrn rmb 1 Map/unmap screen into process address space (L2V3) + rmb 1 Reserved +SS.Palet rmb 1 Return palette information +SS.Montr rmb 1 Get and Set Monitor Type +SS.ScTyp rmb 1 Get screen type information +SS.GIP rmb 1 Global Input Parameters (SetStat) +SS.UMBar rmb 1 update menu bar (SetStat) +SS.FBRgs rmb 1 return color registers (GetStat) +SS.DfPal rmb 1 set/return default palette registers (Getstat/Setstat) +SS.Tone rmb 1 Generate a tone using 6 bit sound + +SS.GIP2 rmb 1 Global Input Params #2 (L2V3) +SS.AnPal rmb 1 Animate palettes (L2V3) +SS.FndBf rmb 1 Find named buffer (L2V3) +SS.CDSta equ SS.GIP2 XACIA +SS.CDSig equ SS.AnPal XACIA +SS.CDRel equ SS.FndBf XACIA + + + + ttl Direct Page Definitions + page + +********************************** +* Direct Page Variable Definitions +* + org $00 +D.WDAddr rmb 2 +D.WDBtDr rmb 1 + org $20 +D.Tasks rmb 2 Task User Table +D.TmpDAT rmb 2 Temporary DAT Image stack +D.Init rmb 2 Initialization Module ptr +D.Poll rmb 2 Interrupt Polling Routine ptr +D.Time equ . System Time +D.Year rmb 1 +D.Month rmb 1 +D.Day rmb 1 +D.Hour rmb 1 +D.Min rmb 1 +D.Sec rmb 1 +D.Tick rmb 1 +D.Slice rmb 1 current slice remaining +D.TSlice rmb 1 Ticks per Slice +D.Boot rmb 1 Bootstrap attempted flag +D.MotOn rmb 1 Floppy Disk Motor-On time out +D.ErrCod rmb 1 Reset Error Code +D.Daywk rmb 1 day of week, com-trol clock +D.TkCnt rmb 1 Tick Counter +D.BtPtr rmb 2 Address of Boot in System Address space +D.BtSz rmb 2 Size of Boot + org $40 +D.BlkMap rmb 4 Memory Block Map ptr +D.ModDir rmb 4 Module Directory ptrs +D.PrcDBT rmb 2 Process Descriptor Block Table ptr +D.SysPrc rmb 2 System Process Descriptor ptr +D.SysDAT rmb 2 System DAT Image ptr +D.SysMem rmb 2 System Memory Map ptr +D.Proc rmb 2 Current Process ptr +D.AProcQ rmb 2 Active Process Queue +D.WProcQ rmb 2 Waiting Process Queue +D.SProcQ rmb 2 Sleeping Process Queue +D.ModEnd rmb 2 Module Directory end ptr +D.ModDAT rmb 2 Module Dir DAT image end ptr +D.CldRes rmb 2 Cold Restart vector + org $6B +D.Crash rmb 6 Pointer to CC Crash Routine +D.CBStrt rmb $B Reserved for CC warmstart ($71) + org $80 +D.DevTbl rmb 2 I/O Device Table +D.PolTbl rmb 2 I/O Polling Table + rmb 4 reserved +D.PthDBT rmb 2 Path Descriptor Block Table ptr +D.DMAReq rmb 1 DMA Request flag + +******** +* COCO STUFF COMES NEXT +* This area is used for the CoCo Hardware Registers +* + org $90 +D.HINIT rmb 1 GIME INIT0 register (hardware setup $FF90) +D.TINIT rmb 1 GIME INIT1 register (timer/task register $FF91) +D.IRQER rmb 1 Interrupt enable regsiter ($FF92) +D.FRQER rmb 1 Fast Interrupt enable register ($FF93) +D.TIMMS rmb 1 Timer most significant nibble ($FF94) +D.TIMLS rmb 1 Timer least significant byte ($FF95) +D.RESV1 rmb 1 reserved register ($FF96) +D.RESV2 rmb 1 reserved register ($FF97) +D.VIDMD rmb 1 video mode register ($FF98) +D.VIDRS rmb 1 video resolution register ($FF99) +D.BORDR rmb 1 border register ($FF9A) +D.RESV3 rmb 1 reserved register ($FF9B) +D.VOFF2 rmb 1 vertical scroll/offset 2 register ($FF9C) +D.VOFF1 rmb 1 vertical offset 1 register ($FF9D) +D.VOFF0 rmb 1 vertical offset 0 register ($FF9E) +D.HOFF0 rmb 1 horizontal offset 0 register ($FF9F) +D.Speed rmb 1 Speed of COCO CPU 0=slow,1=fast +D.TskIPt rmb 2 Task image Pointer table (CC) +D.MemSz rmb 1 128/512K memory flag (CC) +D.SSTskN rmb 1 System State Task Number (COCO) +D.CCMem rmb 2 Pointer to beginning of CC Memory +D.CCStk rmb 2 Pointer to top of CC Memory +D.Flip0 rmb 2 Change to Task 0 +D.Flip1 rmb 2 Change to reserved Task 1 +D.VIRQ rmb 2 VIRQ Polling routine +D.IRQS rmb 1 IRQ shadow register (CC Temporary) +D.CLTb rmb 2 VIRQ Table address +D.AltIRQ rmb 2 Alternate IRQ Vector (CC) +D.GPoll rmb 2 CC GIME IRQ enable/disable toggle +D.Clock2 rmb 2 CC Clock2 entry address + org $C0 +D.SysSvc rmb 2 System Service Routine entry +D.SysDis rmb 2 System Service Dispatch Table ptr +D.SysIRQ rmb 2 System IRQ Routine entry +D.UsrSvc rmb 2 User Service Routine entry +D.UsrDis rmb 2 User Service Dispatch Table ptr +D.UsrIRQ rmb 2 User IRQ Routine entry +D.SysStk rmb 2 System stack +D.SvcIRQ rmb 2 In-System IRQ service +D.SysTsk rmb 1 System Task number + org $E0 +D.Clock rmb 2 +D.XSWI3 rmb 2 +D.XSWI2 rmb 2 +D.XFIRQ rmb 2 +D.XIRQ rmb 2 +D.XSWI rmb 2 +D.XNMI rmb 2 +D.ErrRst rmb 2 + org $F2 +D.SWI3 rmb 2 +D.SWI2 rmb 2 +D.FIRQ rmb 2 +D.IRQ rmb 2 +D.SWI rmb 2 +D.NMI rmb 2 + +************************** +* Level II Block Map flags +* +NotRAM equ %10000000 Block Not RAM flag +ModBlock equ %00000010 Module in Block +RAMinUse equ %00000001 RAM Block in use flag +* +* Service Dispatch Table special entries +* +IOEntry equ 254 + + ttl Structure Formats + page +************************************ +* Module Directory Entry Definitions +* + org 0 +MD$MPDAT rmb 2 Module DAT Image ptr +MD$MBSiz rmb 2 Memory Block size +MD$MPtr rmb 2 Module ptr +MD$Link rmb 2 Module Link count +MD$ESize equ . Module Directory Entry size + +******************** +* Module Definitions +* +* Universal Module Offsets +* + org 0 +M$ID rmb 2 ID Code +M$Size rmb 2 Module Size +M$Name rmb 2 Module Name +M$Type rmb 1 Type / Language +M$Revs rmb 1 Attributes / Revision Level +M$Parity rmb 1 Header Parity +M$IDSize equ . Module ID Size +* +* Type-Dependent Module Offsets +* +* System, File Manager, Device Driver, Program Module +* +M$Exec rmb 2 Execution Entry Offset +* +* Device Driver, Program Module +* +M$Mem rmb 2 Stack Requirement +* +* Device Driver, Device Descriptor Module +* +M$Mode rmb 1 Device Driver Mode Capabilities +* +* Device Descriptor Module +* + org M$IDSize +M$FMgr rmb 2 File Manager Name Offset +M$PDev rmb 2 Device Driver Name Offset + rmb 1 M$Mode (defined above) +M$Port rmb 3 Port Address +M$Opt rmb 1 Device Default Options +M$DTyp rmb 1 Device Type +IT.DTP equ M$DTyp Descriptor type offset +* +* Configuration Module Entry Offsets +* + org M$IDSize +MaxMem rmb 3 Maximum Free Memory +PollCnt rmb 1 Entries in Interrupt Polling Table +DevCnt rmb 1 Entries in Device Table +InitStr rmb 2 Initial Module Name +SysStr rmb 2 System Device Name +StdStr rmb 2 Standard I/O Pathlist +BootStr rmb 2 Bootstrap Module name +ProtFlag rmb 1 Write protect enable flag +OSLevel rmb 1 OS level +OSVer rmb 1 OS version +OSMajor rmb 1 OS major +OSMinor rmb 1 OS minor +Compat1 rmb 1 compatibility byte + +* -- CC3IO area -- * +MonType rmb 1 Monitor type (0=CMP,1=RGB,2=MONO) +KeyRptS rmb 1 Key repeat start constant +KeyRptD rmb 1 Key repeat delay constant + +* Compatiblity byte definitions +CRCOn equ %00000001 CRC checking on if set, off if clear + + page +************************** +* Module Field Definitions +* +* ID Field +* +M$ID1 equ $87 Module ID code byte one +M$ID2 equ $CD Module ID code byte two +M$ID12 equ M$ID1*256+M$ID2 +* +* Module Type / Language byte +* +* Field Masks +* +TypeMask equ %11110000 Type Field +LangMask equ %00001111 Language Field +* +* Type Values +* +Devic equ $F0 Device Descriptor Module +Drivr equ $E0 Physical Device Driver +FlMgr equ $D0 File Manager +Systm equ $C0 System Module +Data equ $40 Data Module +Multi equ $30 Multi-Module +Sbrtn equ $20 Subroutine Module +Prgrm equ $10 Program Module +* +* Language Values +* +Objct equ 1 6809 Object Code Module +ICode equ 2 Basic09 I-code +PCode equ 3 Pascal P-code +CCode equ 4 C I-code +CblCode equ 5 Cobol I-code +FrtnCode equ 6 Fortran I-code +* +* Module Attributes / Revision byte +* +* Field Masks +* +AttrMask equ %11110000 Attributes Field +RevsMask equ %00001111 Revision Level Field +* +* Attribute Flags +* +ReEnt equ %10000000 Re-Entrant Module +Modprot equ %01000000 Gimix Module protect bit (0=protected, 1=write enable) + +******************** +* Device Type Values +* +DT.SCF equ 0 Sequential Character File Type +DT.RBF equ 1 Random Block File Type +DT.Pipe equ 2 Pipe File Type +DT.SBF equ 3 +DT.NFM equ 4 Network File Manager + +********************* +* CRC Result Constant +* +CRCCon1 equ $80 +CRCCon23 equ $0FE3 + + ttl Process Information + page +******************************** +* Process Descriptor Definitions +* +DefIOSiz equ 16 Default I/O Data Length +NefIOSiz equ 12 On-Net Default I/O Data Length +NumPaths equ 16 Number of Local Paths + + org 0 +P$ID rmb 1 Process ID +P$PID rmb 1 Parent's ID +P$SID rmb 1 Sibling's ID +P$CID rmb 1 Child's ID +P$SP rmb 2 Stack ptr +P$Task rmb 1 Task Number +P$PagCnt rmb 1 Memory Page Count +P$User rmb 2 User Index +P$Prior rmb 1 Priority +P$Age rmb 1 Age +P$State rmb 1 Status +P$Queue rmb 2 Queue Link (Process ptr) +P$IOQP rmb 1 Previous I/O Queue Link (Process ID) +P$IOQN rmb 1 Next I/O Queue Link (Process ID) +P$PModul rmb 2 Primary Module +P$SWI rmb 2 SWI Entry Point +P$SWI2 rmb 2 SWI2 Entry Point +P$SWI3 rmb 2 SWI3 Entry Point +P$Signal rmb 1 Signal Code +P$SigVec rmb 2 Signal Intercept Vector +P$SigDat rmb 2 Signal Intercept Data Address +P$DeadLk rmb 1 Dominant proc ID if I/O locked + rmb $20-. unused +P$DIO rmb DefIOSiz Default I/O ptrs +P$Path rmb NumPaths I/O Path Table +P$DATImg rmb 64 DAT Image +P$Links rmb 32 Block Link counts +P$NIO rmb 6*2 additional DIO ptrs for net, compatible with 68k +P$SelP rmb 1 Selected Path for COCO Windows (Default 0) +P$UTicks rmb 4 proc User Tick counter +P$STicks rmb 4 proc System Tick counter +P$FCalls rmb 4 proc F$ call counter +P$ICalls rmb 4 proc I$ call counter +P$DatBeg rmb 3 proc Date of creation (Y/M/D) +P$TimBeg rmb 3 proc Time of creation (H/M/S) +P$Alarm rmb 6 + rmb $200-. Local stack +P$Stack equ . Top of Stack +P$Size equ . Size of Process Descriptor + +* +* Process State Flags +* +SysState equ %10000000 +TimSleep equ %01000000 +TimOut equ %00100000 +ImgChg equ %00010000 +Suspend equ %00001000 +Condem equ %00000010 +Dead equ %00000001 + + ttl OS-9 I/O Symbolic Definitions + page +************************* +* Path Descriptor Offsets +* + org 0 +PD.PD rmb 1 Path Number +PD.MOD rmb 1 Mode (Read/Write/Update) +PD.CNT rmb 1 Number of Open Images +PD.DEV rmb 2 Device Table Entry Address +PD.CPR rmb 1 Current Process +PD.RGS rmb 2 Caller's Register Stack +PD.BUF rmb 2 Buffer Address +PD.FST rmb 32-. File Manager's Storage +PD.OPT equ . PD GetSts(0) Options +PD.DTP rmb 1 Device Type + rmb 64-. Path options +PDSIZE equ . + +* +* Pathlist Special Symbols +* +PDELIM equ '/ Pathlist Name Separator +PDIR equ '. Directory +PENTIR equ '@ Entire Device + page +**************************** +* File Manager Entry Offsets +* + org 0 +FMCREA rmb 3 Create (Open New) File +FMOPEN rmb 3 Open File +FMMDIR rmb 3 Make Directory +FMCDIR rmb 3 Change Directory +FMDLET rmb 3 Delete File +FMSEEK rmb 3 Position File +FMREAD rmb 3 Read from File +FMWRIT rmb 3 Write to File +FMRDLN rmb 3 ReadLn +FMWRLN rmb 3 WritLn +FMGSTA rmb 3 Get File Status +FMSSTA rmb 3 Set File Status +FMCLOS rmb 3 Close File + +***************************** +* Device Driver Entry Offsets +* + org 0 +D$INIT rmb 3 Device Initialization +D$READ rmb 3 Read from Device +D$WRIT rmb 3 Write to Device +D$GSTA rmb 3 Get Device Status +D$PSTA rmb 3 Put Device Status +D$TERM rmb 3 Device Termination + +********************* +* Device Table Format +* + org 0 +V$DRIV rmb 2 Device Driver module +V$STAT rmb 2 Device Driver Static storage +V$DESC rmb 2 Device Descriptor module +V$FMGR rmb 2 File Manager module +V$USRS rmb 1 use count +DEVSIZ equ . + +******************************* +* Device Static Storage Offsets +* + org 0 +V.PAGE rmb 1 Port Extended Address +V.PORT rmb 2 Device 'Base' Port Address +V.LPRC rmb 1 Last Active Process ID +V.BUSY rmb 1 Active Process ID (0=UnBusy) +V.WAKE rmb 1 Active PD if Driver MUST Wake-up +V.USER equ . Driver Allocation Origin + +******************************** +* Interrupt Polling Table Format +* + org 0 +Q$POLL rmb 2 Absolute Polling Address +Q$FLIP rmb 1 Flip (EOR) Byte ..normally Zero +Q$MASK rmb 1 Polling Mask (after Flip) +Q$SERV rmb 2 Absolute Service routine Address +Q$STAT rmb 2 Static Storage Address +Q$PRTY rmb 1 Priority (Low Numbers=Top Priority) +POLSIZ equ . + +******************** +* VIRQ packet format +* + org 0 +Vi.Cnt rmb 2 count down counter +Vi.Rst rmb 2 reset value for counter +Vi.Stat rmb 1 status byte + +Vi.IFlag equ %00000001 status byte virq flag + + page +************************************* +* Machine Characteristics Definitions +* +R$CC equ 0 Condition Codes register +R$A equ 1 A Accumulator +R$B equ 2 B Accumulator +R$D equ R$A Combined A:B Accumulator +R$DP equ 3 Direct Page register +R$X equ 4 X Index register +R$Y equ 6 Y Index register +R$U equ 8 User Stack register +R$PC equ 10 Program Counter register +R$Size equ 12 Total register package size + +Entire equ %10000000 Full Register Stack flag +FIRQMask equ %01000000 Fast-Interrupt Mask bit +HalfCrry equ %00100000 Half Carry flag +IRQMask equ %00010000 Interrupt Mask bit +Negative equ %00001000 Negative flag +Zero equ %00000100 Zero flag +TwosOvfl equ %00000010 Two's Comp Overflow flag +Carry equ %00000001 Carry bit +IntMasks equ IRQMask+FIRQMask +Sign equ %10000000 sign bit + +true equ 1 useful name +false equ 0 useful name + + ttl Error Code Definitions + pag +************************ +* Error Code Definitions +* +* +* Basic09 Error Codes +* + org 10 +E$UnkSym rmb 1 Unknown symbol +E$ExcVrb rmb 1 Excessive verbage +E$IllStC rmb 1 Illegal statement construction +E$ICOvf rmb 1 I-code overflow +E$IChRef rmb 1 Illegal channel reference +E$IllMod rmb 1 Illegal mode +E$IllNum rmb 1 Illegal number +E$IllPrf rmb 1 Illegal prefix +E$IllOpd rmb 1 Illegal operand +E$IllOpr rmb 1 Illegal operator +E$IllRFN rmb 1 Illegal record field name +E$IllDim rmb 1 Illegal dimension +E$IllLit rmb 1 Illegal literal +E$IllRet rmb 1 Illegal relational +E$IllSfx rmb 1 Illegal type suffix +E$DimLrg rmb 1 Dimension too large +E$LinLrg rmb 1 Line number too large +E$NoAssg rmb 1 Missing assignment statement +E$NoPath rmb 1 Missing path number +E$NoComa rmb 1 Missing coma +E$NoDim rmb 1 Missing dimension +E$NoDO rmb 1 Missing DO statement +E$MFull rmb 1 Memory full +E$NoGoto rmb 1 Missing GOTO +E$NoLPar rmb 1 Missing left parenthesis +E$NoLRef rmb 1 Missing line reference +E$NoOprd rmb 1 Missing operand +E$NoRPar rmb 1 Missing right parenthesis +E$NoTHEN rmb 1 Missing THEN statement +E$NoTO rmb 1 Missing TO statement +E$NoVRef rmb 1 Missing variable reference +E$EndQou rmb 1 Missing end quote +E$SubLrg rmb 1 Too many subscripts +E$UnkPrc rmb 1 Unknown procedure +E$MulPrc rmb 1 Multiply defined procedure +E$DivZer rmb 1 Divice by zero +E$TypMis rmb 1 Operand type mismatch +E$StrOvf rmb 1 String stack overflow +E$NoRout rmb 1 Unimplemented routine +E$UndVar rmb 1 Undefined variable +E$FltOvf rmb 1 Floating Overflow +E$LnComp rmb 1 Line with compiler error +E$ValRng rmb 1 Value out of range for destination +E$SubOvf rmb 1 Subroutine stack overflow +E$SubUnd rmb 1 Subroutine stack underflow +E$SubRng rmb 1 Subscript out of range +E$ParmEr rmb 1 Paraemter error +E$SysOvf rmb 1 System stack overflow +E$IOMism rmb 1 I/O type mismatch +E$IONum rmb 1 I/O numeric input format bad +E$IOConv rmb 1 I/O conversion: number out of range +E$IllInp rmb 1 Illegal input format +E$IOFRpt rmb 1 I/O format repeat error +E$IOFSyn rmb 1 I/O format syntax error +E$IllPNm rmb 1 Illegal path number +E$WrSub rmb 1 Wrong number of subscripts +E$NonRcO rmb 1 Non-record type operand +E$IllA rmb 1 Illegal argument +E$IllCnt rmb 1 Illegal control structure +E$UnmCnt rmb 1 Unmatched control structure +E$IllFOR rmb 1 Illegal FOR variable +E$IllExp rmb 1 Illegal expression type +E$IllDec rmb 1 Illegal declarative statement +E$ArrOvf rmb 1 Array size overflow +E$UndLin rmb 1 Undefined line number +E$MltLin rmb 1 Multiply defined line number +E$MltVar rmb 1 Multiply defined variable +E$IllIVr rmb 1 Illegal input variable +E$SeekRg rmb 1 Seek out of range +E$NoData rmb 1 Missing data statement +* +* System Dependent Error Codes +* + org 186 +E$StkOvf rmb 1 Stack overflow +E$IllArg rmb 1 Illegal argument + rmb 1 reserved +E$ICoord rmb 1 Illegal coordinates +E$Bug rmb 1 Bug (should never be returned) +E$BufSiz rmb 1 Buffer size is too small +E$IllCmd rmb 1 Illegal command +E$TblFul rmb 1 Screen or window table is full +E$BadBuf rmb 1 Bad/Undefined buffer number +E$IWDef rmb 1 Illegal window definition +E$WUndef rmb 1 Window undefined +* +* Standard OS-9 Error Codes +* + org 200 +E$PthFul rmb 1 Path Table full +E$BPNum rmb 1 Bad Path Number +E$Poll rmb 1 Polling Table Full +E$BMode rmb 1 Bad Mode +E$DevOvf rmb 1 Device Table Overflow +E$BMID rmb 1 Bad Module ID +E$DirFul rmb 1 Module Directory Full +E$MemFul rmb 1 Process Memory Full +E$UnkSvc rmb 1 Unknown Service Code +E$ModBsy rmb 1 Module Busy +E$BPAddr rmb 1 Bad Page Address +E$EOF rmb 1 End of File + rmb 1 +E$NES rmb 1 Non-Existing Segment +E$FNA rmb 1 File Not Accesible +E$BPNam rmb 1 Bad Path Name +E$PNNF rmb 1 Path Name Not Found +E$SLF rmb 1 Segment List Full +E$CEF rmb 1 Creating Existing File +E$IBA rmb 1 Illegal Block Address +E$HangUp rmb 1 Carrier Detect Lost +E$MNF rmb 1 Module Not Found + rmb 1 +E$DelSP rmb 1 Deleting Stack Pointer memory +E$IPrcID rmb 1 Illegal Process ID +E$BPrcID equ E$IPrcID Bad Process ID (formerly #238) + rmb 1 +E$NoChld rmb 1 No Children +E$ISWI rmb 1 Illegal SWI code +E$PrcAbt rmb 1 Process Aborted +E$PrcFul rmb 1 Process Table Full +E$IForkP rmb 1 Illegal Fork Parameter +E$KwnMod rmb 1 Known Module +E$BMCRC rmb 1 Bad Module CRC +E$USigP rmb 1 Unprocessed Signal Pending +E$NEMod rmb 1 Non Existing Module +E$BNam rmb 1 Bad Name +E$BMHP rmb 1 (bad module header parity) +E$NoRam rmb 1 No (System) Ram Available +E$DNE rmb 1 Directory not empty +E$NoTask rmb 1 No available Task number + rmb $F0-. reserved +E$Unit rmb 1 Illegal Unit (drive) +E$Sect rmb 1 Bad SECTor number +E$WP rmb 1 Write Protect +E$CRC rmb 1 Bad Check Sum +E$Read rmb 1 Read Error +E$Write rmb 1 Write Error +E$NotRdy rmb 1 Device Not Ready +E$Seek rmb 1 Seek Error +E$Full rmb 1 Media Full +E$BTyp rmb 1 Bad Type (incompatable) media +E$DevBsy rmb 1 Device Busy +E$DIDC rmb 1 Disk ID Change +E$Lock rmb 1 Record is busy (locked out) +E$Share rmb 1 Non-sharable file busy +E$DeadLk rmb 1 I/O Deadlock error + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/pipedefs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/pipedefs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,76 @@ + nam PipeDefs + ttl OS-9 Pipe Definitions + +* OS-9 Pipe Definitions +* +* IOMan equates duplicated for PipeMan use +* + +NPATHS set 16 ;Maximum local paths per task -- must match IOMan +NameMax set 29 ;Maximum length of a file name + +* +* Device Driver Static Storage Layout +* + org V.User +V.List rmb 2 ;Pointer to 1st pipe's pipe buffer +PManMem equ . ;Device driver memory (drive table equivalent) + +* +* Pipe Buffer Data Structure +* + org 0 +PP.PD rmb 2 ;Pointer to shared path descriptor +PP.Next rmb 2 ;Pointer to next pipe buffer in system map +PP.Prev rmb 2 ;Pointer to previous pipe buffer in system map +PP.Rsrv rmb 2 ;Reserved +PP.Data equ . ;Data buffer begins at this offset + +* +* Unique Path Descriptor Variables +* + org PD.FST +*** PP.Read must have bit 4 clear; PP.Writ must be PP.Read XOR 4 +PD.Read equ . +PD.RPID rmb 1 ;Process ID of reader waiting on signal +PD.RCT rmb 1 ;Number of blocked readers +PD.RSIG rmb 1 ;Signal to send reader +PD.REOR rmb 1 ;Read EOR character +PD.Writ equ . +PD.WPID rmb 1 ;Process ID of writer waiting on signal +PD.WCT rmb 1 ;Number of blocked writers +PD.WSIG rmb 1 ;Signal to send writer +PD.WEOR rmb 1 ;Write EOR character (dummy) +*** End of special section +PD.End rmb 2 ;Pointer to end of pipe buffer +PD.NxtI rmb 2 ;Next in pointer +PD.NxtO rmb 2 ;Next out pointer +PD.RFlg rmb 1 ;"Ready" flag +PD.Wrtn rmb 1 ;"Written" flag +PD.BCnt rmb 2 ;# queue elements currently bufered +PD.Own rmb 1 ;Process ID of pipe original creator +PD.Keep rmb 1 ;Non-zero if pipe has been kept open artificailly +PD.QSiz rmb 2 ;Max. elements in queue (copied from OPT section) + +* +* Path descriptor option section +* +* Note that PD.Name overlaps with the last byte of PD.ECnt. +* PD.ECnt is copied to PD.QSiz as part of OPEN or CREATE, +* to make room for the pipe name. +* + org (PD.OPT+1) +PD.ESiz rmb 1 ;Size of each queue element +PD.ECnt rmb 2 ;Max. elements in queue (initial position) + +* +* Device Descriptor definitions +* +IT.PDC equ $12 ;Pipe device class (like IT.DTP, IT.DVC) + org IT.PDC + rmb 1 ;Leave room for device class +IT.ESiz rmb 1 ;Size of each queue element +IT.ECnt rmb 2 ;Max. elements in queue (initial position) + +* End of pipedefs + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/pipedefs.l2v3 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/pipedefs.l2v3 Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,102 @@ + opt -l + ttl OS9 Level 2 Pipe Definitions + +* +* Copyright 1988 by Microware Systems Corporation +* All Rights Reserved +* +* Named pipe equates by Burke & Burke. +* All rights assigned to Microware Systems Corporation. +* +* This file contains proprietary information of Microware Systems +* Corporation. Persons accessing this file will be held strictly +* accountable for their use of the information herein. +* + +* +* OS9 Level 2 Pipe Definitions +* +* Modification History +* -------------------- +* +* Date Who Description +* -------- --- ----------------------------------------- +* 12/03/88 cjb Coded from new PIPEMAN comments +* + +* +* IOMan equates duplicated for PipeMan use +* + +NPATHS set 16 ;Maximum local paths per task -- must match IOMan +NameMax set 29 ;Maximum length of a file name + +* +* Device Driver Static Storage Layout +* + org V.User +V.List rmb 2 ;Pointer to 1st pipe's pipe buffer +PManMem equ . ;Device driver memory (drive table equivalent) + +* +* Pipe Buffer Data Structure +* + org 0 +PP.PD rmb 2 ;Pointer to shared path descriptor +PP.Next rmb 2 ;Pointer to next pipe buffer in system map +PP.Prev rmb 2 ;Pointer to previous pipe buffer in system map +PP.Rsrv rmb 2 ;Reserved +PP.Data equ . ;Data buffer begins at this offset + +* +* Unique Path Descriptor Variables +* + org PD.FST +*** PP.Read must have bit 4 clear; PP.Writ must be PP.Read XOR 4 +PD.Read equ . +PD.RPID rmb 1 ;Process ID of reader waiting on signal +PD.RCT rmb 1 ;Number of blocked readers +PD.RSIG rmb 1 ;Signal to send reader +PD.REOR rmb 1 ;Read EOR character +PD.Writ equ . +PD.WPID rmb 1 ;Process ID of writer waiting on signal +PD.WCT rmb 1 ;Number of blocked writers +PD.WSIG rmb 1 ;Signal to send writer +PD.WEOR rmb 1 ;Write EOR character (dummy) +*** End of special section +PD.End rmb 2 ;Pointer to end of pipe buffer +PD.NxtI rmb 2 ;Next in pointer +PD.NxtO rmb 2 ;Next out pointer +PD.RFlg rmb 1 ;"Ready" flag +PD.Wrtn rmb 1 ;"Written" flag +PD.BCnt rmb 2 ;# queue elements currently bufered +PD.Own rmb 1 ;Process ID of pipe original creator +PD.Keep rmb 1 ;Non-zero if pipe has been kept open artificailly +PD.QSiz rmb 2 ;Max. elements in queue (copied from OPT section) + +* +* Path descriptor option section +* +* Note that PD.Name overlaps with the last byte of PD.ECnt. +* PD.ECnt is copied to PD.QSiz as part of OPEN or CREATE, +* to make room for the pipe name. +* + org (PD.OPT+1) +PD.ESiz rmb 1 ;Size of each queue element +PD.ECnt rmb 2 ;Max. elements in queue (initial position) + org (PD.OPT+3) +PD.Name rmb NameMax ;Name buffer for named pipe. + +* +* Device Descriptor definitions +* +IT.PDC equ $12 ;Pipe device class (like IT.DTP, IT.DVC) + org IT.PDC + rmb 1 ;Leave room for device class +IT.ESiz rmb 1 ;Size of each queue element +IT.ECnt rmb 2 ;Max. elements in queue (initial position) + +* End of pipedefs + + opt l + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/rbfdefs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/rbfdefs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,225 @@ + nam RBFDefs + ttl Random Block File Manager Definitions + +********************** +* Modification History +* +* Date Changes Made by +* -------- ------------------------------------------------------------ --- +* 82/07/13 PD.Exten added to path descriptor rfd +* 82/07/13 PE entries defined rfd +* 82/07/15 V.FileHd inserted in drive static rfd +* 82/09/10 Level One/ Level two cond added WGP +* 82/09/17 Record Lock cond added WGP +* 82/09/17 PD.SLE renamed to PD.Creat rfd +* 82/09/17 V.DiskID, V.BMapSz, V.MapSct added for +* smart multi-sector bitmap searching rfd +* 82/09/20 reserved areas added in static storage. +* 83/06/07 Added InDriver flag in PD.SMF. rfd +* 83/06/13 Added PE.Req tmp save for PE.Lock rfd +* 83/08/08 reserved PD.SToff for Japanese rfd +* 83/11/19 Added V.ResBit in drive tables. rfd +* 83/12/12 Added PE.Prior to save process priority. rfd +* 83/12/13 Added BufBusy bit in state flag (PD.SMF) rfd +* 84/07/06 Added Bit Definitions for DD.FMT MGH +* 87/06/23 Updated with Dev Desc Info KKD + +******************************* +* RBF Device Descriptor Offsets +* + org M$DTyp + rmb 1 Device type (IT.DTP) (1=RBF) +IT.DRV rmb 1 Drive number +IT.STP rmb 1 Step rate +IT.TYP rmb 1 Disk device type (5" 8" other) +IT.DNS rmb 1 Density capability +IT.CYL rmb 2 Number of cylinders +IT.SID rmb 1 Number of surfaces +IT.VFY rmb 1 0=verify disk writes +IT.SCT rmb 2 Default sectors/track +IT.T0S rmb 2 Default sectors/track tr00,s0 +IT.ILV rmb 1 Sector interleave offset +IT.SAS rmb 1 Segment allocation size + +************************************* +* IT.TYP/IT.DNS/IT.STP definitions +* +TYP.5 equ %00000000 5" media +TYP.8 equ %00000001 8" media +TYP.CCF equ %00100000 CoCo format +TYP.NCCF equ %00000000 Non-CoCo format +TYP.SOF equ %00000000 Standard OS-9 format +TYP.NSF equ %01000000 Non-standard format +TYP.FLP equ %00000000 Floppy disk +TYP.HARD equ %10000000 Hard disk + +DNS.FM equ %00000000 Single-density (FM) +DNS.MFM equ %00000001 Double-density (MFM) +DNS.STD equ %00000000 Single track density (48 tpi) +DNS.DTD equ %00000010 Single track density (96 tpi) + +STP.30ms equ 0 30ms step rate +STP.20ms equ 1 20ms step rate +STP.12ms equ 2 12ms step rate +STP.6ms equ 3 6ms step rate + +************************************* +* Random Block Path Descriptor Format +* + org PD.FST +PD.SMF rmb 1 State flags +PD.CP rmb 4 Current logical byte position +PD.SIZ rmb 4 File size +PD.SBL rmb 3 Segment beginning lsn +PD.SBP rmb 3 Segment beginning psn +PD.SSZ rmb 3 Segment size +PD.DSK rmb 2 Disk id +PD.DTB rmb 2 Drive table ptr + org PD.OPT + rmb 1 Device type +PD.DRV rmb 1 Drive number +PD.STP rmb 1 Step rate +PD.TYP rmb 1 Disk device type (5" 8" other) +PD.DNS rmb 1 Density capability +PD.CYL rmb 2 Number of cylinders +PD.SID rmb 1 Number of surfaces +PD.VFY rmb 1 0=verify disk writes +PD.SCT rmb 2 Default sectors/track +PD.T0S rmb 2 Default sectors/track tr00,s0 +PD.ILV rmb 1 Sector interleave offset +PD.SAS rmb 1 Segment allocation size +PD.TFM rmb 1 DMA Transfer Mode +PD.Exten rmb 2 Path Extension (PE) for record locking +PD.SToff rmb 1 Sector/Track offsets (for "foreign" disk formats) +PD.ATT rmb 1 File attributes +PD.FD rmb 3 File descriptor psn +PD.DFD rmb 3 Directory file descriptor psn +PD.DCP rmb 4 File directory entry ptr +PD.DVT rmb 2 User readable dev tbl ptr + +* State Flags +BUFMOD equ $01 Buffer modified +SINBUF equ $02 Sector in buffer +FDBUF equ $04 File descriptor in buffer +*EOFSEC equ $08 End of file sector +*EOF equ $10 End of file +InDriver equ $20 Currently in Disk Driver, or queued +BufBusy equ $40 Buffer is currently busy + + ifne Level-1 +************************************ +* Random Block Path Extension Format +* + org 0 +PE.PE rmb 1 PE path number +PE.PDptr rmb 2 back ptr to this PE's Path Descriptor +PE.NxFil rmb 2 Drive Open-File list ptr +PE.Confl rmb 2 circular File Conflict list +PE.Lock rmb 1 Path lockout status +PE.LoLck rmb 4 Low Locked Logical addr +PE.HiLck rmb 4 High Locked Logical addr +PE.Wait rmb 2 PE ptr to (next) locked-out PE +PE.TmOut rmb 2 Max ticks to wait for locked segment +PE.Owner rmb 1 Process ID of owner of locked segment +PE.Req rmb 1 temp for PE.Lock in GAIN when LockSeg fails +PE.Prior rmb 1 tmp for process priority while in driver + rmb 32-. reserved +PE.FilNm rmb 32 temp for filename during directory search + +* PE.Lock status codes +Unlocked equ 0 no portion of file is locked +RcdLock equ 1 record from LoLck to HiLck locked +FileLock equ 2 entire file locked +EofLock equ 4 End of file is locked + endc + +*********************** +* LSN0 Disk Data Format +* + org 0 +DD.TOT rmb 3 Total number of sectors +DD.TKS rmb 1 Track size in sectors +DD.MAP rmb 2 Number of bytes in allocation bit map +DD.BIT rmb 2 Number of sectors/bit +DD.DIR rmb 3 Address of root directory fd +DD.OWN rmb 2 Owner +DD.ATT rmb 1 Attributes +DD.DSK rmb 2 Disk id +DD.FMT rmb 1 Disk format; density/sides +DD.SPT rmb 2 Sectors/track +DD.RES rmb 2 Reserved for future use +DD.SIZ equ . Device descriptor minimum size +DD.BT rmb 3 System bootstrap sector +DD.BSZ rmb 2 Size of system bootstrap +DD.DAT rmb 5 Creation date +DD.NAM rmb 32 Volume name +DD.OPT rmb 32 option area + +* DD.FMT Bit Definitions +FMT.SIDE equ %00000001 Single Side=0, Double Side=1 +FMT.DNS equ %00000010 Single DNS=0, Double DNS=1 +FMT.TDNS equ %00000100 48tpi=0, 96tpi=1 +FMT.T0DN equ %00100000 Track 0 DNS, see FMT.DNS + +************************ +* File Descriptor Format +* + org 0 +FD.ATT rmb 1 Attributes +FD.OWN rmb 2 Owner +FD.DAT rmb 5 Date last modified +FD.LNK rmb 1 Link count +FD.SIZ rmb 4 File size +FD.Creat rmb 3 Segment list extension +FD.SEG equ . Beginning of segment list +* Segment List Entry Format + org 0 +FDSL.A rmb 3 Segment beginning physical sector number +FDSL.B rmb 2 Segment size +FDSL.S equ . Segment list entry size +FD.LS1 equ FD.SEG+((256-FD.SEG)/FDSL.S-1)*FDSL.S +FD.LS2 equ (256/FDSL.S-1)*FDSL.S +MINSEC set 16 + +************************ +* Directory Entry Format +* + org 0 +DIR.NM rmb 29 File name +DIR.FD rmb 3 File descriptor physical sector number +DIR.SZ equ . Directory record size + +**************** +* Static Storage +* +* Overall Disk Static Storage +* +* Note: This does not reserve any memory for drive tables. Each Driver is +* responsible for reserving sufficient memory for the appropriate +* number of tables. +* + org V.USER Reserve required ($06) +V.NDRV rmb 1 Number of drives ($07) + rmb 8 reserved ($08) +DRVBEG equ . Beginning of drive tables ($10) +* +* Global Storage For Disk Drive Tables +* Each Table Contains The First 'DD.Siz' Bytes +* From Sector 0, And The Current Track, Stepping Rate, +* Bit-Map Use Flag, And Disk Type +* + org 0 + rmb DD.SIZ Device descriptor, sector 0 +V.TRAK rmb 2 Current track +V.BMB rmb 1 Bit-map use flag +V.FileHd rmb 2 open file list for this drive +V.DiskID rmb 2 Disk ID +V.BMapSz rmb 1 Bitmap Size +V.MapSct rmb 1 lowest reasonable bitmap sector +V.ResBit rmb 1 reserved bitmap sector (for compaction) +V.ScTkOf rmb 1 Sector/Track byte (Combined from descriptor) +V.ScOfst rmb 1 Sector offset split from byte above +V.TkOfst rmb 1 Track offset split from byte above + rmb 4 reserved +DRVMEM equ . + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/scfdefs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/scfdefs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,192 @@ + nam SCFDefs + ttl Sequential File Manager (SCF) Definitions + +***************** +* Edition History +* +* Date Changes Made by +* -------- ------------------------------------------------------------ --- +* 84/01/11 Added V.KANJI, V.KBUF, V.MODADR for new kanji input process Y.O +* 85/04/20 Added V.PDLHd Path Descriptor List Head MGH +* 85/04/21 Added PD.PLP and PD.PST for modem handling MGH +* 87/06/23 Updated with Dev Desc info KKD +* 98/10/03 Consolidated L1/L2 scfdefs BGP + + +******************************* +* SCF Device Descriptor Offsets +* + org M$DTyp +IT.DVC rmb 1 Device class +IT.UPC rmb 1 Uppercase flag +IT.BSO rmb 1 Backspace behavior +IT.DLO rmb 1 Delete behavior +IT.EKO rmb 1 Echo flag +IT.ALF rmb 1 Auto linefeed flag +IT.NUL rmb 1 End-of-line null count +IT.PAU rmb 1 Page pause flag +IT.PAG rmb 1 Numbe rof lines per page +IT.BSP rmb 1 Backspace character +IT.DEL rmb 1 Delete-line character +IT.EOR rmb 1 End-of-record character +IT.EOF rmb 1 End-of-file character +IT.RPR rmb 1 Reprint-line character +IT.DUP rmb 1 Duplicate-last-line character +IT.PSC rmb 1 Pause character +IT.INT rmb 1 Interrupt character +IT.QUT rmb 1 Quit character +IT.BSE rmb 1 Backspace echo character +IT.OVF rmb 1 Bell character +IT.PAR rmb 1 Parity +IT.BAU rmb 1 Baud rate +IT.D2P rmb 2 Attached device name string offset +IT.XON rmb 1 X-ON character +IT.XOFF rmb 1 X-OFF character +IT.COL rmb 1 Number of columns for display +IT.ROW rmb 1 Number of rows for display +IT.XTYP rmb 1 Extended type (added by BRI) + + ifgt Level-1 +* Window Descriptor Additions +* For CoCo window, where IT.PAR = $80 + org IT.ROW+1 +IT.WND rmb 1 Window number (matches device name) ($2E) +IT.VAL rmb 1 Use defaults on Init (0=no, 1=yes) +IT.STY rmb 1 Screen type default +IT.CPX rmb 1 Column start default +IT.CPY rmb 1 Row start default +IT.FGC rmb 1 Foreground color default +IT.BGC rmb 1 Background color default +IT.BDC rmb 1 Border color default + endc + + pag +************************************************************ +* Static storage requirements +* SCF Devices must reserve this space for SCF +* + org V.USER +V.TYPE rmb 1 Device type or parity +V.LINE rmb 1 Lines left until end of page +V.PAUS rmb 1 Immediate Pause request +V.DEV2 rmb 2 Attached device's static +V.INTR rmb 1 Interrupt char +V.QUIT rmb 1 Quit char +V.PCHR rmb 1 Pause char +V.ERR rmb 1 Accumulated errors +V.XON rmb 1 X-On char +V.XOFF rmb 1 X-Off char +V.KANJI rmb 1 Kanji mode flag +V.KBUF rmb 2 Kana - Kanji convert routine work address +V.MODADR rmb 2 Kana - Kanji convert module address +V.PDLHd rmb 2 Open path descriptor list head pointer +V.RSV rmb 5 Reserve bytes for future expansion +V.SCF equ . Total SCF manager static overhead + +*********************** +* Character Definitions +* +C$NULL set 0 Null char +C$RPET set $01 (ctl A - SOH) Repeat last input line +C$INTR set $03 (ctl C - ETX) Keyboard interrupt +C$RPRT set $04 (ctl D - EOT) Reprint current input line +C$QUIT set $05 (ctl E - ENQ) Keyboard Abort +C$BELL set $07 (ctl G - BEL) Line overflow warning +C$BSP set $08 (ctl H - BS ) Back space +C$EL set $05 Erase Line +C$LF set $0A Line feed +C$HOME set $0B Home position Code +C$Clsgr set $15 Graphic screen clear (use FM-11) +C$Clsall set $16 Graphic & character clear (use FM-11) +C$CR set $0D Carriage return +C$FORM set $0C (ctl L - FF ) Form Feed ... screen clear +C$SI set $0F Shift IN Code +C$SO set $0E Shift OUT Code +C$XON set $11 (ctl Q - DC1) Transmit Enable +C$XOFF set $13 (ctl S - DC3) Transmit Disable +C$PAUS set $17 (ctl W - ETB) Pause character +C$DEL set $18 (ctl X - CAN) Delete line +C$EOF set $1B (ctl [ - ESC) END of file +C$RGT set $1C Cursor right +C$LFT set $1D Cursor left +C$UP set $1E Cursor up +C$DWN set $1F Cursor down +C$SPAC set $20 Space +C$PERD set '. +C$COMA set ', + + pag +************************* +* FILE DESCRIPTOR OFFSETS +* + org PD.FST +PD.DV2 rmb 2 OUTPUT DEV TBL PTR +PD.RAW rmb 1 READ/WRITE OR RDLIN/WRLIN MODE +PD.MAX rmb 2 READLINE HIGH BYTE COUNT +PD.MIN rmb 1 DEVICES ARE "MINE" IF CLEAR +PD.STS rmb 2 Status routine module addr +PD.STM rmb 2 Reserved for Status routine + org PD.OPT + rmb 1 DEVICE TYPE +PD.UPC rmb 1 CASE (0=BOTH, 1=UPPER ONLY) +PD.BSO rmb 1 BACKSP (0=BSE, 1=BSE,SP,BSE) +PD.DLO rmb 1 DELETE (0=BSE OVER LINE, 1=CRLF) +PD.EKO rmb 1 ECHO (0=NO ECHO) +PD.ALF rmb 1 AUTOLF (0=NO AUTO LF) +PD.NUL rmb 1 END of LINE NULL COUNT +PD.PAU rmb 1 PAUSE (0=NO END of PAGE PAUSE) +PD.PAG rmb 1 LINES PER PAGE +PD.BSP rmb 1 BACKSPACE charACTER +PD.DEL rmb 1 DELETE LINE charACTER +PD.EOR rmb 1 END of RECORD char (READ ONLY) +PD.EOF rmb 1 END of FILE char +PD.RPR rmb 1 REPRINT LINE char +PD.DUP rmb 1 DUP LAST LINE char +PD.PSC rmb 1 PAUSE char +PD.INT rmb 1 KBD INTR char (ctl c) +PD.QUT rmb 1 KBD QUIT char (ctl q) +PD.BSE rmb 1 BACKSPACE ECHO charACTER +PD.OVF rmb 1 LINE OVERFLOW char (BELL) +PD.PAR rmb 1 PARITY CODE +PD.BAU rmb 1 ACIA BAUD RATE (Color Computer) +PD.D2P rmb 2 OFFSET of DEV2 name +PD.XON rmb 1 ACIA X-ON char +PD.XOFF rmb 1 ACIA X-OFF char +OPTCNT equ .-PD.OPT Total user settable options +PD.ERR rmb 1 Most recent I/O error status +PD.TBL rmb 2 Device Table addr (copy) +PD.PLP rmb 2 Path Descriptor List Pointer +PD.PST rmb 1 Current Path Status + +******************************************** +* PD.PST values Path Descriptor Status byte +* +PST.DCD equ %00000001 Set if DCD is lost on Serial port + + pag +************************************************************ +* +* SCF PD.PAR definitions +* +* Baud rate +B110 equ 0 +B300 equ 1 +B600 equ 2 +B1200 equ 3 +B2400 equ 4 +B4800 equ 5 +B9600 equ 6 +B19200 equ 7 +* Word size +WORD8 equ %00000000 +WORD7 equ %00100000 +* Parity +PARNONE equ %00000000 +PARODD equ %00100000 +PAREVEN equ %01100000 +PARMARK equ %10100000 +PARSPACE equ %11100000 +* Stop bits +STOP1 equ %00000000 +STOP2 equ %00010000 + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/systype.l1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/systype.l1 Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,90 @@ + nam SysType.l1 + ttl CoCo OS-9 Level One System Type Definitions + +***************** +* Edition History +* +* Date Changes Made by +* -------- ------------------------------------------------------------ --- +* 98/10/13 Added defs by Bruce Isted from his Eliminator archive BGP +* 98/10/31 Merged cc3global.defs into this file BGP +* 99/05/09 Changed for OS-9 Level One BGP + +********************** +* CPU Type Definitions +* + org 1 +Color rmb 1 +COLOR3 rmb 1 +CPUType set Color + +****************************** +* Clock Speed Type Definitions +* +OneMHz equ 1 +TwoMHz equ 2 +CPUSpeed set OneMHz + +********************************** +* Power Line Frequency Definitions +* +Hz50 equ 1 Assemble clock for 50 hz power +Hz60 equ 2 Assemble clock for 60 hz power +PwrLnFrq set Hz60 Set to Appropriate freq + +********************************** +* PIA Definitions +* +PIA.U4 equ $FF00 +PIA.U8 equ $FF20 + +****************** +* ACIA type set up +* + org 1 +ACIA6850 rmb 1 MC6850 acia. +ACIA6551 rmb 1 SY6551 acia. +ACIA2661 rmb 1 SC2661 acia. +ACIATYPE set ACIA6551 + +HW.Page set $FF Device descriptor hardware page + +****************** +* Device addresses +* +A.AciaP set $FF68 Aciapak Address +A.ModP set $FF6C ModPak Address +DPort set $FF40 Disk controller base address +MPI.Slct set $FF7F Multi-Pak slot select +MPI.Slot set $03 Multi-Pak default slot +*** Eliminator addresses +WD05Port set $FF70 +A.DACIA1 set $FF60 +A.DACIA2 set A.DACIA1+4 +PPIABase set WD05Port+6 +RTC.Base set WD05Port+2 + +* +* VDG Devices +* +A.TermV set $FFC0 VDG Term +A.V1 set $FFC1 Possible additional VDG Devices +A.V2 set $FFC2 +A.V3 set $FFC3 +A.V4 set $FFC4 +A.V5 set $FFC5 +A.V6 set $FFC6 +A.V7 set $FFC7 + +**************************************** +* Special character Bit position equates +* +SHIFTBIT equ %00000001 +CNTRLBIT equ %00000010 +ALTERBIT equ %00000100 +UPBIT equ %00001000 +DOWNBIT equ %00010000 +LEFTBIT equ %00100000 +RIGHTBIT equ %01000000 +SPACEBIT equ %10000000 + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/defs/systype.l2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/defs/systype.l2 Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,803 @@ + nam SysType.l2 + ttl CoCo 3 OS-9 Level 2 System Type Definitions + +***************** +* Edition History +* +* Date Changes Made by +* -------- ------------------------------------------------------------ --- +* 98/10/13 Added defs by Bruce Isted from his Eliminator archive BGP +* 98/10/31 Merged cc3global.defs into this file BGP + +********************** +* CPU Type Definitions +* + org 1 +Color rmb 1 +COLOR3 rmb 1 +CPUType set COLOR3 + +****************************** +* Clock Speed Type Definitions +* +OneMHz equ 1 +TwoMHz equ 2 +CPUSpeed set OneMHz + +********************************** +* Power Line Frequency Definitions +* +Hz50 equ 1 Assemble clock for 50 hz power +Hz60 equ 2 Assemble clock for 60 hz power +PwrLnFrq set Hz60 Set to Appropriate freq + +****************** +* ACIA type set up +* + org 1 +ACIA6850 rmb 1 MC6850 acia. +ACIA6551 rmb 1 SY6551 acia. +ACIA2661 rmb 1 SC2661 acia. +ACIATYPE set ACIA6551 + +**************************************** +* Dynamic Address Translator Definitions +* +DAT.BlCt equ 8 D.A.T. blocks/address space +DAT.BlSz equ (256/DAT.BlCt)*256 D.A.T. block size +DAT.ImSz equ DAT.BlCt*2 D.A.T. Image size +DAT.Addr equ -(DAT.BlSz/256) D.A.T. MSB Address bits +DAT.Task equ $FF91 Task Register address +DAT.TkCt equ 32 Number of DAT Tasks +DAT.Regs equ $FFA0 DAT Block Registers base address +DAT.Free equ $333E Free Block Number +DAT.BlMx equ $3F Maximum Block number +DAT.BMSz equ $40 Memory Block Map size +DAT.WrPr equ 0 no write protect +DAT.WrEn equ 0 no write enable +SysTask equ 0 Coco System Task number +IOBlock equ $3F +ROMBlock equ $3F +IOAddr equ $7F +ROMCount equ 1 number of blocks of ROM (High RAM Block) +RAMCount equ 1 initial blocks of RAM +MoveBlks equ DAT.BlCt-ROMCount-2 Block numbers used for copies +BlockTyp equ 1 chk only first bytes of RAM block +ByteType equ 2 chk entire block of RAM +Limited equ 1 chk only upper memory for ROM modules +UnLimitd equ 2 chk all NotRAM for modules +* NOTE: this check assumes any NotRAM with a module will +* always start with $87CD in first two bytes of block +RAMCheck equ BlockTyp chk only beg bytes of block +ROMCheck equ Limited chk only upper few blocks for ROM +LastRAM equ IOBlock maximum RAM block number + +*************************** +* Color Computer 3 Specific +* +CPUType set Color3 +CPUSpeed set TwoMHz +MappedIO equ True (Actually False but it works better this way) + +******************** +* Hardware addresses +* +GIMERegs equ $FF00 Base address of GIME registers +IrqEnR equ $FF92 GIME IRQ enable/status register +BordReg equ $FF9A Border color register +PalAdr equ $FFB0 Palette registers +PIA0Base equ $FF00 +PIA1Base equ $FF20 + +HW.Page set $07 Device descriptor hardware page + +****************** +* Device addresses +* +A.AciaP set $FF68 Aciapak Address +A.ModP set $FF6C ModPak Address +DPort set $FF40 Disk controller base address +MPI.Slct set $FF7F Multi-Pak slot select +MPI.Slot set $03 Multi-Pak default slot +*** Eliminator addresses +WD05Port set $FF70 +A.DACIA1 set $FF60 +A.DACIA2 set A.DACIA1+4 +PPIABase set WD05Port+6 +RTC.Base set WD05Port+2 + +* +* VDG Devices +* +A.TermV set $FFC0 VDG Term +A.V1 set $FFC1 Possible additional VDG Devices +A.V2 set $FFC2 +A.V3 set $FFC3 +A.V4 set $FFC4 +A.V5 set $FFC5 +A.V6 set $FFC6 +A.V7 set $FFC7 +* +* Window Devices +* + org $FF9F +A.W rmb 1 $FF9F Generic Window Descriptor +A.TermW rmb 1 $FFA0 Windowing Term +A.W1 rmb 1 $FFA1 +A.W2 rmb 1 $FFA2 +A.W3 rmb 1 $FFA3 +A.W4 rmb 1 $FFA4 +A.W5 rmb 1 $FFA5 +A.W6 rmb 1 $FFA6 +A.W7 rmb 1 $FFA7 +A.W8 rmb 1 $FFA8 +A.W9 rmb 1 $FFA9 +A.W10 rmb 1 $FFAA +A.W11 rmb 1 $FFAB +A.W12 rmb 1 $FFAC +A.W13 rmb 1 $FFAD +A.W14 rmb 1 $FFAE +A.W15 rmb 1 $FFAF + +**************************************** +* Special character Bit position equates +* +SHIFTBIT equ %00000001 +CNTRLBIT equ %00000010 +ALTERBIT equ %00000100 +UPBIT equ %00001000 +DOWNBIT equ %00010000 +LEFTBIT equ %00100000 +RIGHTBIT equ %01000000 +SPACEBIT equ %10000000 + +********************************** +* Pointer Device Packet Definition +* + org 0 +Pt.Valid rmb 1 Is returned info valid (0=no/1=yes) +Pt.Actv rmb 1 Active Side 0=off/1=Right/2=left +Pt.ToTm rmb 1 Time out Initial value + rmb 2 reserved +Pt.TTTo rmb 1 Time Till Timeout +Pt.TSSt rmb 2 Time Since Start Counter +Pt.CBSA rmb 1 Current Button State Button A +Pt.CBSB rmb 1 Current Button State Button B +Pt.CCtA rmb 1 Click Count Button A +Pt.CCtB rmb 1 Click Count Button B +Pt.TTSA rmb 1 Time This State Counter Button A +Pt.TTSB rmb 1 Time This State Counter Button B +Pt.TLSA rmb 1 Time Last State Counter Button A +Pt.TLSB rmb 1 Time Last State Counter Button B + rmb 2 Reserved +Pt.BDX rmb 2 Button down X value EXPERIMENTAL +Pt.BDY rmb 2 Button down Y value +Pt.Stat rmb 1 Window Pointer type location +Pt.Res rmb 1 Resolution (0..640 by: 0=ten/1=one) +Pt.AcX rmb 2 Actual X Value +Pt.AcY rmb 2 Actual Y Value +Pt.WRX rmb 2 Window Relative X +Pt.WRY rmb 2 Window Relative Y +Pt.Siz equ . Packet Size 32 bytes + +************************** +* window regions for mouse +* +WR.Cntnt equ 0 content region +WR.Cntrl equ 1 control region +WR.OfWin equ 2 off window + +************************************* +* Standard system get/put buffer defs +* +* +* system group numbers +* + org 200 +Grp.Fnt rmb 1 font group +Grp.Clip rmb 1 clipboard group +Grp.Ptr rmb 1 pointer group +Grp.Pat2 rmb 1 pattern group 2 color +Grp.Pat4 rmb 1 pattern group 4 color +Grp.Pat6 rmb 1 pattern group 16 color +* +* font buffer numbers +* + org 1 +Fnt.S8x8 rmb 1 standard 8x8 font +Fnt.S6x8 rmb 1 standard 6x8 font +Fnt.G8x8 rmb 1 standard graphics 8x8 font +* +* pattern buffer numbers +* + org 1 +Pat.Dot rmb 1 +Pat.Vrt rmb 1 +Pat.Hrz rmb 1 +Pat.XHtc rmb 1 +Pat.LSnt rmb 1 +Pat.RSnt rmb 1 +Pat.SDot rmb 1 +Pat.BDot rmb 1 +* +* pointer buffer numbers +* + org 1 +Ptr.Arr rmb 1 Arrow pointer +Ptr.Pen rmb 1 Pencil pointer +Ptr.LCH rmb 1 Large cross hair pointer +Ptr.Slp rmb 1 Wait timer pointer +Ptr.Ill rmb 1 Illegal action pointer +Ptr.Txt rmb 1 Text pointer +Ptr.SCH rmb 1 Small cross hair pointer + +******************************** +* Window/Menu Bar Data Structure +* +* To be used in SS.WnSet SETSTAT to set up a Framed Window +* for use in the high level windowing package. +* +NUMMENS equ 10 maximum number of menus on menu bar +NUMITMS equ 20 maximum number of items in a menu +MXTTLEN equ 15 max chars for menu and item names +WINSYNC equ $C0C0 synch bytes for window validation +* +* Menu Item Descriptor : (MN.ITEMS) +* one required for each item within the menu +* + org 0 +MI.TTL rmb MXTTLEN item name +MI.ENBL rmb 1 enable flag +MI.RES rmb 5 reserved bytes +MI.SIZ equ . size of menu item descriptor +* +* Menu Descriptor : +* one for each menu on the manu bar +* each is pointed to by MB.MPTR below +* + org 0 +MN.TTL rmb MXTTLEN menu title +MN.ID rmb 1 menu id number (1-255) +MN.XSIZ rmb 1 horiz. size of desired pull down +MN.NITS rmb 1 number of items in menu +MN.ENBL rmb 1 enable flag +MN.RES rmb 2 reserved bytes +MN.ITEMS rmb 2 pointer to array of menu items +MN.SIZ equ . size of menu descriptor +* +* Window Descriptor: +* one required for each application in a framed window +* + org 0 +WN.TTL rmb 20 title of window for title bar +WN.NMNS rmb 1 number of menus in menu bar +WN.XMIN rmb 1 minimal horiz. size for application to run +WN.YMIN rmb 1 minimal vert. size for application to run +WN.SYNC rmb 2 synch bytes ($C0C0) +WN.RES rmb 7 reserved bytes +WN.BAR rmb 2 pointer to arry of menu descriptors +WN.SIZ equ . size of window/menu bar descriptor + +************************* +* Window Type Definitions +* +* To be used in setting up the border of the window in +* the SS.WnSel SETSTAT +* + org 0 +WT.NBox rmb 1 No Box +WT.FWin rmb 1 Framed Window +WT.FSWin rmb 1 Framed Window w/Scroll Bars +WT.SBox rmb 1 Shadowed Box +WT.DBox rmb 1 Double Box +WT.PBox rmb 1 Plain Box + +************************************* +* Pre-Defined Menu IDs for the system +* + org 1 +MId.Mov rmb 1 move box +MId.Cls rmb 1 close box +MId.Grw rmb 1 grow box +MId.SUp rmb 1 scroll up +MId.SDn rmb 1 scroll down +MId.SRt rmb 1 scroll right +MId.SLt rmb 1 scroll left +MId.Chr rmb 1 character was depressed + org 20 +MId.Tdy rmb 1 Tandy menu +MId.Fil rmb 1 Files Menu +MId.Edt rmb 1 Edit Menu +MId.Sty rmb 1 Styles menu +MId.Fnt rmb 1 Font menu + + +****************************************************************************** +****************************************************************************** +** ** +** OS-9 Windowing system Global data definitions ** +** ** +****************************************************************************** +****************************************************************************** +** ** +** System memory block 0 layout: ** +** ** +** $0000-$0001 : FHL/Isted WD 1002-05 - interface base address ** +** $0002 : FHL/Isted WD 1002-05 - boot device physical drive # ** +** $0008 : Bruce Isted Serial mouse - button counter & rx count ** +** $0009-$000B : Bruce Isted Serial mouse - RX buffer ** +** $000C-$000D : Bruce Isted Serial mouse - Current X position ** +** $000E-$000F : Bruce Isted Serial mouse - Current Y position ** +** $0010-$001F : unused (User definable) ** +** $0020-$00FF : system direct page & some IRQ vectors ** +** $0100-$011F : Task usage table ** +** $0120-$01FF : Virtual DAT tasks (pointed to by 0 = YES) $1E +DevPar rmb 2 high bit=window device $1F +ULCase rmb 1 special key flags (Capslck & keyboard mouse) $21 +KySnsFlg rmb 1 flag for key sense setstat $22 +ScrChg rmb 1 screen change flag $23 +SS.SigID rmb 1 data ready process ID $24 +SS.SigSg rmb 1 data ready signal code $25 +MS.SigID rmb 1 mouse signal process ID $26 +MS.SigSg rmb 1 mouse signal signal code $27 +MS.Smpl rmb 1 mouse sample rate $28 +MS.Time rmb 1 mouse timeout value $29 +MS.Side rmb 1 MSB of mouse auto-follow flag $2A +PrtSide rmb 1 auto follow mouse flag $2B +ParmCnt rmb 1 parameter count $2C +ParmVct rmb 2 parameter vector $2D +PrmStrt rmb 2 pointer to params start $2F +NxtPrm rmb 2 pointer to next param storage $31 +EndPtr rmb 1 last character read offset $33 +InpPtr rmb 1 next character read offset $34 +WinNum rmb 1 window table entry # $35 +DWNum rmb 1 dwnum from descriptor $36 +CallCde rmb 1 internal comod call code # $37 +CC3Parm rmb 128-. global parameter area +ReadBuf rmb 256-. read input buffer (keyboard) +CC3DSiz equ . + +***************************************************************************** +* GrfInt/WindInt global memory area +* This area sits in system block 0 from $1000 to $10ff +WGlobal equ $1000 useful value (points to address starting below) + org 0 +G.CurTik rmb 1 Constant - # Clock ticks/cursor updates (2) +G.CntTik rmb 1 Current tick count for cursor updates +G.GfBusy rmb 1 Grfdrv is busy flag (1=busy) +g0003 rmb 2 NEW: UNUSED +g0005 rmb 2 ??? +G.GrfStk rmb 2 grfdrv stack pointer ($07) +G.MonTyp rmb 1 monitor type +g000A equ . Old label for compatibility +G.CrDvFl rmb 1 Are we current device flag (only set when all +* Parms have been moved to Dev Mem) +* 0=We are not on our device +* 1=We are the current device +* (Used by comod (GRF/WIND/VDGInt) to determine +* whether or not to update GIME regs themselves +* If not current device, they don't.) +g000B rmb 1 current device's V.TYPE +G.CurDvM rmb 2 current device memory pointer for co-module use +G.WIBusy rmb 1 WindInt is busy flag (1=busy) +G.AlPckt rmb 6 F$Alarm time packet +G.AlPID rmb 1 F$Alarm proc ID ($15) +G.AlSig rmb 1 F$Alarm signal code ($16) +G.BelVec rmb 2 BELL routine vector +G.DefPal rmb 2 pointer to default palette data in global mem +G.TnCnt rmb 1 SS.Tone duration counter +G.BelTnF rmb 1 BELL tone flag +g001D rmb 3 +G.CurDev rmb 2 current device's static memory pointer ($20) +G.PrWMPt rmb 2 previous window static mem pointer $(22) +G.BCFFlg rmb 1 bit coded co-module found flags ($24) +* 00000010 : VDGInt found +* 10000000 : GrfDrv found +g0025 rmb 1 +G.KTblLC rmb 1 Key table entry# last checked (1-3) +* ifeq TC9-true +*CurLght rmb 1 current keyboard light settings +* else +G.LastCh rmb 1 last keyboard character (ASCII value) +* endc +G.LKeyCd rmb 1 last keyboard code +G.KyRept rmb 1 key repeat counter +* A secondary 3 key table (same format as g002D below) +G.2Key1 rmb 1 +G.2Key2 rmb 1 +G.2Key3 rmb 1 +* Up to 3 keys can be registerd at once, and they are stored here. If more +* than 3 are hit, the last key is overwritten with the very last key down that +* was checked. Format for all three is the same as the PIA column/row byte @ +* KeyFlag below. +G.Key1 rmb 1 Key 1 being held down (Row/Column #) +G.Key2 rmb 1 Key 2 being held down (Row/Column #) +G.Key3 rmb 1 Key 3 being held down (Row/Column #) +G.ShftDn rmb 1 SHIFT key down flag (COM'd) ($30) +G.CntlDn rmb 1 CTRL key down flag (0=NO) +G.KeyFlg rmb 1 Keyboard PIA bit #'s for columns/rows +* %00000111-Column # (Output, 0-7) +* %00111000-Row # (Input, 0-6) +G.AltDwn rmb 1 ALT key down flag (0=NO) +G.KySns rmb 1 key sense byte +G.KySame rmb 1 same key flag +G.CapLok rmb 1 CapsLock/SysRq key down flag + rmb 1 +g0038 rmb 1 grfdrv initialized flag + rmb 2 +G.MSmpRt rmb 1 Current mouse sample # (# ticks till next read) +G.Mouse rmb Pt.Siz mouse packet ($3C) +g005C rmb 2 Temp for relative mouse X coord calculation +g005E rmb 2 Temp for relative mouse Y coord calculation +G.MSmpRV rmb 1 Mouse sample reset value (# ticks till next read) +G.KyDly rmb 1 initial key repeat delay constant +G.KySpd rmb 1 secondary key repeat delay constant +* ifeq TC9-true +*KeyParm rmb 1 keyboard command parameter byte +* else +G.KyMse rmb 1 keyboard mouse flag +* endc +G.Clear rmb 1 "one-shot" CapsLock/SysRq key flag +G.KyButt rmb 1 keyboard F1 and F2 "fire" button info +G.AutoMs rmb 1 Auto-follow mouse flag for current device (0=NO) +G.MseMv rmb 1 mouse moved flag +G.CoTble rmb 6 co-module table +G.GrfEnt rmb 2 GRFDRV Entry address ($6E) +g0070 rmb 1 # bytes to move in 1 block (1-72) +G.WUseTb rmb 4 windows in use bit table (0=unused, 32 windows) ($71) +G.GfxTbl rmb 2 Pointer to GFX tables ($75) +G.WrkWTb rmb $40 Work window table. WindInt only ($77) +g00B7 rmb 2 Current Device static mem ptr for WindInt +g00B9 rmb 2 Current window table ptr for WindInt +g00BB rmb 2 Pointer to work window table (g0077+$10) +g00BD rmb 1 Current screen type for work window table +g00BE rmb 1 Topmost overlay window # when check for title bars +g00BF rmb 1 Flag for keypress while processing menu select +g00C0 rmb 2 Ptr to current path descriptor +G.WindBk rmb 2 shift-clear routine vector +G.MsInit rmb 2 set mouse routine vector +G.MsSig rmb 1 mouse signal flag +G.DefPls rmb 16 Default palettes (2 repeats of 8 is default) ($C7) +g00D7 rmb 41 + +***************************************************************************** +* GrfDrv global memory data definitions +* This area sits in system block 0 from $1100 to $119E +GrfMem equ $1100 useful label used to point to mem starting below + org 0 +gr0000 rmb 1 Pixel mask for 1st byte of GP line +gr0001 rmb 1 Pixel mask for last byte of a GP line +gr0002 rmb 2 Ptr to table of bit masks for colors +gr0004 rmb 1 # of bytes wide GP buffer is (including partials) +gr0005 rmb 1 # pixels per byte in GP Buffer +gr0006 rmb 1 # of pixels used in 1st byte of GP buffer line +gr0007 rmb 1 # of pixels used in last byte of GP buffer line +gr0008 rmb 1 Bit mask that is common to both screen & GP buffer +gr0009 rmb 1 # bytes for width of overlay window +gr000A rmb 1 # bytes to offset to get to next line after +* overlay width has been copied +gr000B rmb 1 +gr000C rmb 2 Cursor address for proportional spacing? +gr000E rmb 1 +gr000F rmb 1 Left-based bit mask for proportional spacing? +gr0010 rmb 2 Vector for text to gfx screen (either prop. or normal) +gr0012 rmb 6 +gr0018 rmb 2 Working Center X coord for Circle/Ellipse +gr001A rmb 2 Working Center Y coord for Circle/Ellipse +gr001C rmb 2 Some variable for Circle/Ellipse (initially 0) +gr001E rmb 2 Working Y radius value for Circle/Ellipse +gr0020 rmb 2 Arc 'clip line' X01 +gr0022 rmb 2 Arc 'clip line' Y01 +gr0024 rmb 2 Arc 'clip line' X02 +gr0026 rmb 2 Arc 'clip line' Y02 +gr0028 rmb 1 full-byte background color to FFILL on mask +gr0029 rmb 1 pixels per byte: set up by FFILL +gr002A rmb 1 Flag for FFill: 1=no error, 0=Stack overflow error +gr002B rmb 1 current Y-direction to travel in FFILL +gr002C rmb 2 +gr002E rmb 2 current window table entry +gr0030 rmb 2 current screen table ptr +gr0032 rmb 1 Last block # we used for buffers +gr0033 rmb 2 Last offset we used for buffers +gr0035 rmb 1 group +gr0036 rmb 2 offset +gr0038 rmb 1 group returned (new) +gr0039 rmb 1 0=Text cursor inverted off, >0 is inverted on +gr003A rmb 1 0=Graphics cursor XOR'd off,>0 is XOR'd on scrn +gr003B rmb 2 end of vars ptr? +gr003D rmb 2 Last X coordinate Graphics cursor was ON at +gr003F rmb 2 Last Y coordinate Graphics cursor was ON at +gr0041 rmb 2 Screen address for start of current gfx cursor +gr0043 rmb 1 Pixel mask for start of gfx cursor +gr0044 rmb 1 Block # Graphics cursor is in +gr0045 rmb 2 Offset in block Graphics cursor is in +gr0047 rmb 2 'Working' X coordinate +gr0049 rmb 2 'Working' Y coordinate +gr004B rmb 2 current X +gr004D rmb 2 current Y +gr004F rmb 2 X Size (in bytes) +gr0051 rmb 2 Y Size (in bytes) +gr0053 rmb 2 Horizontal radius (circle/ellipse/arc) +gr0055 rmb 2 Vertical radius (circle/ellipse/arc) +gr0057 rmb 1 group +gr0058 rmb 1 buffer # +gr0059 rmb 1 save switch for overlay +gr005A rmb 1 PRN +gr005B rmb 2 X coordinate of Graphics cursor +gr005D rmb 2 Y coordinate of Graphics cursor +gr005F rmb 1 ATD: new video mode for 24/25/28-line windows +Gr.STYMk rmb 1 STY marker +gr0061 rmb 1 foreground RGB data +gr0062 rmb 1 background RGB data +gr0063 rmb 1 bytes/row (on current screen...not window) +gr0064 rmb 2 PSet vector +gr0066 rmb 2 pset offset +gr0068 rmb 2 LSet vector +gr006A rmb 2 max X co-ordinate +gr006C rmb 2 max Y co-ordinate +gr006E rmb 2 X pixel count +gr0070 rmb 2 Y pixel count +gr0072 rmb 2 Screen address of pixel we are doing +gr0074 rmb 1 Pixel mask for pixel we are doing +gr0075 rmb 2 ??? Pixel mask for last byte of GP buffer? +gr0077 rmb 2 Vector for right direction FFill +gr0079 rmb 1 bit mask for 1st pixel in byte for right dir. FFill +gr007A rmb 2 Vector for left direction FFill +gr007C rmb 1 bit mask for last pixel in byte for left dir. FFill +gr007D rmb 1 buffer block # +gr007E rmb 2 buffer offset # +gr0080 rmb 2 Buffer length (in bytes) +gr0082 rmb 3 3 byte extended screen address +gr0085 rmb 2 temp +gr0087 rmb 16 grfdrv (sysmap 1) DAT image +gr0097 rmb 1 temp +gr0098 rmb 1 temp +* In ARC, 97-98 is the width of the clip line in pixels (after scaling) +gr0099 rmb 2 temp +* In ARC, 99-9A is the height of the clip line in pixels (after scaling) +gr009B rmb 1 counter temp +gr009C rmb 1 +gr009D rmb 2 offset to buffer in block +gr009F rmb 1 +gr00A0 rmb 1 # lines left to do of GP buffer onto screen +gr00A1 rmb 2 vector routine for (changes lots) +* In ARC A1-A2 is the vector to the proper clipping routine +gr00A3 rmb 2 Vector for shifting GP buffers +gr00A5 rmb 2 Vector for shifting GP buffers (can dupe A1) +gr00A7 rmb 2 +gr00A9 rmb 2 NEW: Window tbl ptr for last window GRFDRV used +gr00AB rmb 256-. ??? UNUSED? +* GPLoad buffer - $1200 in system block 0 +GPBuf rmb 72 common move buffer for gpload/get/put +gb0000 equ 72 Size of get/put buffer ($48) + +***************************************************************************** +* Window table entry structure +* These tables sit in system block 0 and there is 1 for every window init'd +* including any overlay windows. +MaxWind equ 32 maximum allowable window tables +WinBase equ $1290 base address to start of window tables + org -$10 +Wt.STbl rmb 2 Screen table pointer ($FFFF=Not used) -$10 +Wt.BLnk rmb 1 overlay window parent entry # ($FF=base) -$0E +Wt.LStrt rmb 2 screen logical start address -$0D +Wt.CPX rmb 1 current X coord. start -$0B +Wt.CPY rmb 1 current Y coord. start -$0A +Wt.SZX rmb 1 current X size (CWArea) -$09 +Wt.SZY rmb 1 current Y size (CWArea) -$08 +Wt.SXFct rmb 1 X scaling factor -$07 +Wt.SYFct rmb 1 Y scaling factor (0=no scaling) -$06 +Wt.Cur rmb 2 cursor physical address on screen -$05 +Wt.FMsk rmb 1 font bit mask (based from left) -$03 +Wt.CurX rmb 2 X coord of cursor -$02 +Wt.CurY rmb 2 Y Coord of cursor $00 +Wt.XBCnt rmb 1 width of window (in bytes) $02 +Wt.CWTmp rmb 1 bytes wide each text chr (1,2,4) $03 +Wt.BRow rmb 2 bytes/text row (8x width in gfx) $04 +Wt.Fore rmb 1 foreground palette # $06 +Wt.Back rmb 1 background palette # $07 +Wt.Attr rmb 1 default attributes (FUTTTBBB) $08 +Wt.BSW rmb 1 character BSW switches $09 +Wt.LSet rmb 1 LSet type $0A +Wt.FBlk rmb 1 Font memory block # $0B +Wt.FOff rmb 2 Font offset in block $0C +Wt.PBlk rmb 1 PSet memory block # $0E +Wt.POff rmb 2 PSet offset in block $0F +Wt.OBlk rmb 1 Overlay memory block # $11 +Wt.OOff rmb 2 Overlay offset in block $12 +Wt.LVec rmb 2 LSet vector $14 +Wt.PVec rmb 2 PSet vector $16 +Wt.GBlk rmb 1 GCursor memory block # $18 +Wt.GOff rmb 2 GCursor offset in block $19 +Wt.MaxX rmb 2 Maximum X cord. (0-79,0-639) $1B +Wt.MaxY rmb 2 Maximum Y cord. (0-24,0-191) $1D +Wt.BLen rmb 2 bytes left in GPLoad block below $1F +Wt.NBlk rmb 1 memory block # for next GPLoad $21 +Wt.NOff rmb 2 Offset in block for next GPLoad $22 +Wt.LStDf rmb 2 screen logical start default $24 +* NOTE: The following default settings are what the window was initialized +* with, and thus are the MAXIMUM start/size the window can handle +* until it is restarted (DWEnd & DWSet) +* They also appear to be used in WindInt to determine the coords & +* sizes for control+content regions +Wt.DfCPX rmb 1 default X cord. start $26 +Wt.DfCPY rmb 1 default Y cord. start $27 +Wt.DfSZX rmb 1 default X size $28 +Wt.DfSZY rmb 1 default Y size $29 +Wt.Res rmb 6 unused $2A-$2F +Wt.Siz equ .+$10 + +***************************************************************************** +* Screen table entrys +* These tables sit in system block 0 base=$1A80 + +STblMax equ 16 Maximum number of screen tables +STblBse equ $1A80 base address of screen tables + org 0 +St.Sty rmb 1 Screen type $00 +St.SBlk rmb 1 Ram block start # $01 +St.LStrt rmb 2 Screen logical start (for GIME) $02 +St.BRow rmb 1 Bytes per row $04 +St.Brdr rmb 1 Border palette register # $05 +St.Fore rmb 1 Foreground palette register # $06 +St.Back rmb 1 Background palette register # $07 +St.ScSiz rmb 1 screen size: 24..28 lines $08 +St.Res rmb 7 UNUSED??? $09 +* NOTE: SHOULD USE ONE OF THESE UNUSED BYTES TO KEEP THE # OF DEVICE WINDOW +* TABLES THAT ARE USING THIS SCREEN TABLE. DWSET & DWEND WOULD KEEP TRACK OF +* THESE, AND THE WINDINT TITLE BAR ROUTINE WOULD CHECK IT. IF IT IS ONLY 1, +* IT WON'T BOTHER CHANGING THE TITLE BAR WHEN SELECTING WINDOWS +St.Pals rmb 16 Palette register contents $10 +St.Siz equ . + +***************************************************************************** +* Graphics buffer tables +* They contain a 20 byte header (shown below), followed by the raw pixel +* data. + org 0 +Grf.Bck rmb 1 back block link # $00 +Grf.Off rmb 2 back block header offset $01 +Grf.Grp rmb 1 group # $03 +Grf.Buff rmb 1 buffer # $04 +Grf.BSz rmb 2 buffer size (not including header) $05 +Grf.XSz rmb 2 X size (in pixels) $07 +Grf.YSz rmb 2 Y size (in pixels/bytes) $09 +Grf.XBSz rmb 1 X size in bytes $0B +Grf.LfPx rmb 1 # pixels used in first byte of line $0C +Grf.RtPx rmb 1 # pixels used in last byte of line $0D +Grf.STY rmb 1 Screen type buffer intended for $0E +Grf.NBlk rmb 1 number blocks used $0F +Grf.Pal rmb 16 Copy of palette registers? $10 +Grf.Siz equ . $20 + +***************************************************************************** +* GFX tables (1 for each window, 18 ($12) bytes each) pointed to by +* $1075-$0176 +* GRFINT only uses gt0001-gt0004, the rest is exclusive to WINDINT + org 0 +Gt.WTyp rmb 1 WindInt window type (Framed, Scroll Bar, etc.) $00 +Gt.GXCur rmb 2 X coord of graphics cursor $01 +Gt.GYCur rmb 2 Y coord of graphics cursor $03 +Gt.DPtr rmb 2 Ptr to WindInt window descriptor $05 +Gt.FClr rmb 1 Foreground color $07 +Gt.BClr rmb 1 Background color $08 +Gt.FMsk rmb 1 Foreground mask $09 +Gt.BMsk rmb 1 Background mask $0A +Gt.GBlk rmb 1 Block # of graphics cursor $0B +Gt.GOff rmb 2 Offset into block of graphics cursor $0C +Gt.Proc rmb 1 Process # of window creator $0E +Gt.PBlk rmb 1 Process descriptor block # of creator $0F +Gt.Res rmb 2 ??? RESERVED ??? $10 +GTabSz equ . + +***************************************************************************** +* This table is located in the graphics table memory and is offset from +* graphics table pointer stored at $1075-$1076. This is used exclusively by +* WindInt. +* NOTE: USING UNUSED BYTES IN CC3 GLOBAL MEM, SET UP SEPARATE PTRS FOR EACH +* OF THE BELOW SO WE CAN SPEED UP ACCESS BY NOT HAVING TO DO A LOAD/LEAx +* COMBINATION EVERY TIME + org $0240 + rmb WN.SIZ copy of last accessed window descriptor + rmb MN.SIZ copy of last accessed menu descriptor + rmb MI.SIZ copy of last accessed item descriptor + rmb 65 menu handling table (16 entrys of 4 bytes) + +***************************************************************************** +* WindInt menu handling table entry definition + org 0 +MnuXNum rmb 1 menu # +MnuXStrt rmb 1 X start text co-ordinate +MnuXEnd rmb 1 X end text co-ordinate + rmb 1 unused? +MnuHSiz equ . + +***************************************************************************** +* Character binary switches +TChr equ %10000000 transparent characters +Under equ %01000000 underline characters +Bold equ %00100000 bold characters +Prop equ %00010000 proportional spacing of characters +Scale equ %00001000 automatic window scaling +Invers equ %00000100 inverse characters +NoCurs equ %00000010 no cursor display +Protect equ %00000001 device window protection + +***************************************************************************** +* Screen types (high bit set=hardware text, else graphics) in GRFDRV +Current equ $ff Current screen +* equ 1 640x200x2 +* equ 2 320x200x4 +* equ 3 640x200x4 +* equ 4 320x200x16 +* equ $85 80 column text +* equ $86 40 column text + +************************************* +* Window default palette color codes +* + org 0 +White. rmb 1 +Blue. rmb 1 +Black. rmb 1 +Green. rmb 1 +Red. rmb 1 +Yellow. rmb 1 +Magenta. rmb 1 +Cyan. rmb 1 + +* end of cc3global.defs diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/Makefile Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,50 @@ +# OS-9 Level 2 V3 Commands/Utilities +# + +include ../../Makefile.rules + +#AS = os9 /mnt2/src/ocem/os9/asm +#ASOUT = o= +AS = xasm +ASOUT = -o= +AFLAGS = -q +DEPENDS = ./Makefile + +CMDS = attr askmontype binex build cobbler copy date \ + deiniz del deldir ddir dir dirm display dmem dump echo exbin \ + free ident idir iniz link list load login makdir mdir \ + merge mfree mmap montype pmap proc procs pwd pxd rename save \ + setime shell_21 sleep swread swset tee tmode tsmon unlink \ + verify wcreate xmode +SUBS = gfx inkey +ALLOBJS = $(CMDS) $(SUBS) + +SHELLMODS = shell_21 build copy date deiniz del dir display echo iniz \ + link list load mdir merge mfree procs tmode unlink +UTILPAK1 = attr deldir dirm dmem free ident mmap proc rename setime tmode +UTILPAK2 = ddir idir pmap xmode + +all: $(ALLOBJS) shell utilpak1 utilpak2 $(DEPENDS) + chmod a+rx $(ALLOBJS) shell utilpak1 utilpak2 + +shell: $(SHELLMODS) $(DEPENDS) + cat $(SHELLMODS)>$@ + @echo "*** Be sure the size of this file is less than 7681 bytes! ***" + @ls -l $@ + @echo + +utilpak1: $(UTILPAK1) $(DEPENDS) + cat $(UTILPAK1)>$@ + @echo "*** Be sure the size of this file is less than 7681 bytes! ***" + @ls -l $@ + @echo + +utilpak2: $(UTILPAK2) $(DEPENDS) + cat $(UTILPAK2)>$@ + @echo "*** Be sure the size of this file is less than 7681 bytes! ***" + @ls -l $@ + @echo + +clean: + $(RM) $(ALLOBJS) shell utilpak1 utilpak2 + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/RunB Binary file CoCoOS9/level2v3/CMDS/RunB has changed diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/askmontype.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/askmontype.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,114 @@ +******************************************************************** +* AskMonType - Query based monitor type utility +* +* $Id: askmontype.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Created BG 97/??/?? + + nam AskMonType + ttl Query based monitor type utility + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 1 + + mod eom,name,tylg,atrv,start,size + +key rmb 1 +orgopts rmb 32 +modopts rmb 32 +stack rmb 200 +size equ . + +name fcs /AskMonType/ + fcb edition + +start leax >CurOff,pcr + ldy #CurOffL + lbsr WriteMsg + clra + clrb + leax orgopts,u + os9 I$GetStt + leax modopts,u + os9 I$GetStt + clr 4,x + clr 16,x + clr 17,x + clrb + os9 I$SetStt +AskMon leax >MonSelct,pcr + ldy #MonSelL + lbsr WriteMsg +AskMon2 lbsr ReadKey + cmpa #'1 + beq DoTV + cmpa #'2 + beq DoMono + cmpa #'3 + beq DoRGB + leax >Bell,pcr + ldy #BellL + lbsr WriteMsg + bra AskMon2 +DoTV ldx #$0000 TV/composite monitor + bra ChgMon +DoMono ldx #$0002 monochrome monitor + bra ChgMon +DoRGB ldx #$0001 RGB monitor +ChgMon ldd #$01*256+SS.Montr + os9 I$SetStt make the monitor setting + leax >CurOn,pcr + ldy #CurOnL + lbsr WriteMsg + leax orgopts,u + clra + clrb + os9 I$SetStt + clrb + os9 F$Exit + +ReadKey pshs y,x,b + clra stdin + leax key,u + ldy #1 + os9 I$Read + lda key,u + puls pc,y,x,b + +WriteMsg pshs y,x,b,a + lda #1 stdout + os9 I$Write + puls pc,y,x,b,a + + +CurOff fdb $0520 +CurOffL equ *-CurOff +CurOn fdb $0521 +CurOnL equ *-CurOn + +MonSelct fcb C$FORM + fcb $02,$20,$22 + fcc / SELECT YOUR DISPLAY TYPE/ + fcb C$LF,C$CR,C$LF,C$CR,C$LF,C$CR + fcc " (1) TV/Composite Monitor" + fcb C$LF,C$CR,C$LF,C$CR + fcc / (2) Monochrome Monitor/ + fcb C$LF,C$CR,C$LF,C$CR + fcc / (3) RGB Monitor/ + fcb C$LF,C$CR +MonSelL equ *-MonSelct + +Bell fcb C$BELL +BellL equ *-Bell + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/attr.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/attr.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,257 @@ +******************************************************************** +* Attr - Modify file attributes +* +* $Id: attr.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 11 Original Tandy distribution version + + nam Attr + ttl Modify file attributes + +* Disassembled 98/09/11 11:44:51 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + use rbfdefs + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 11 + + mod eom,name,tylg,atrv,start,size + +fpath rmb 1 +rawpath rmb 1 +parmptr rmb 2 +cmdperms rmb 2 +u0006 rmb 1 +u0007 rmb 1 +pathopts rmb 20 +u001C rmb 2 +u001E rmb 1 +u001F rmb 9 +u0028 rmb 32 +filename rmb 32 +fdesc rmb 16 +u0078 rmb 46 +u00A6 rmb 414 +size equ . + +name fcs /Attr/ + fcb edition + +L0012 fcb C$LF + fcc "Use: Attr {[-]}" + fcb C$LF + fcc " opts: -d s r w e pr pw pe -a" + fcb C$CR +L0052 fcb C$LF + fcc "You do not own that file." + fcb C$CR +L006D fcb C$LF + fcc "Use Makdir to create a directory" + fcb C$CR +L008F fcb C$LF + fcc "ERROR; the directory is not empty" + fcb C$CR +L00B2 fcc "dsewrewr" + fcb $FF + +start stx L00B2,pcr + leay L0012,pcr +L01B0 pshs b + lda #2 + ldy #256 + os9 I$WritLn + comb + puls b +L01BE os9 F$Exit +L01C1 clrb + leax >L0052,pcr + bra L01B0 +L01C8 leax >L006D,pcr + clrb + bra L01B0 +L01CF pshs u,y,x + lda L008F,pcr + clrb + bra L01B0 +L01F7 puls u,y,x + cmpb #$D3 + bne L01AC + rts +L01FE fdb $ff41 + fdb $ff80,$44ff,$4053,$ff01,$52ff,$0257,$ff04,$45ff + fdb $0850,$52ff,$1050,$57ff,$2050,$45ff + fcb $00 +L021D clr L01FE,pcr +L0237 ldb ,y+ + pshs y,x + beq L027F +L023D lda ,x+ + eora ,y+ + anda #$DF + beq L023D + lda -1,y + bmi L0251 + puls y,x +L024B lda ,y+ + bpl L024B + bra L0237 +L0251 lda ,-x + cmpa #$30 + bcc L027F + cmpb #$FF + beq L0278 + bitb #$80 + beq L0268 + tst L0217,pcr + lda #$01 + ldy #$0022 + os9 I$Write + leax L01F9,pcr + lda #$01 + ldy #$001E + os9 I$Write + leax u000C,u + lda #$00 + ldy #$0015 + os9 I$ReadLn + leay -$01,y + cmpy #$0000 + bne L0120 +L00CA lda L0239,pcr + pshs y + ldy #$003C + lda #$01 + os9 I$Write + leax L01D7,pcr + lda #$02 + ldy #$00FF + os9 I$WritLn + lbra L011C +L01B6 pshs b,a + lda ,x+ + tfr a,b + lsra + lsra + lsra + lsra + bsr L01CC + sta ,y+ + tfr b,a + bsr L01CC + sta ,y+ + puls pc,b,a +L01CC anda #$0F + adda #$30 + cmpa #$39 + bls L01D6 + adda #$07 +L01D6 rts +L01D7 fcc "** NON-HEX CHARACTER ENCOUNTERED" + fcb $07,C$CR +L01F9 fcc "Enter name for header record: " +L0217 fcc "Enter starting address for file: $" +L0239 fcb $07,C$CR,C$LF + fcc "** Not a binary load module file. Proceed anyway (Y/N)? " + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/build.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/build.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,64 @@ +******************************************************************** +* Build - Simple text file creation utility +* +* $Id: build.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 6 Original Tandy distribution version + + nam Build + ttl Simple text file creation utility + +* Disassembled 98/09/10 23:19:12 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 6 + + mod eom,name,tylg,atrv,start,size + +FPath rmb 1 +LineBuff rmb 578 +size equ . + +name fcs /Build/ + fcb edition + +start ldd #(WRITE.*256)+UPDAT. + os9 I$Create + bcs Exit + sta OS9Boot,pcr point to the OS9Boot name +L0162 lda ,y+ get a byte from the name + sta ,x+ save in my buffer + bpl L0162 copy it over + + leax ,u both are zero in a level II system + lda L0015,pcr temporary DAT image + tfr x,d + ldx #$0000 get copy of direct page + ldy #$0090 first $90 bytes + ldu #Buffer to a buffer + os9 F$CpyMem copy memory + lbcs Exit + + leax >L0015,pcr + tfr x,d use it as temporary DAT image + ldx >Buffer+D.SysDAT get pointer to system DAT image + ldy #$0010 get a copy of it + ldu #SysDAT point to room for the system DAT image + os9 F$CpyMem get the system DAT image + lbcs Exit + ldx #Buffer + ldd L00D1,pcr + clrb + bra Print + +L048F leax >L0051,pcr + clrb + bra Print + +L0496 leax >L008E,pcr + clrb + bra Print + +L049D leax >L00F2,pcr + bra Print + +HelpMsg fcb C$LF + fcc 'Use: COBBLER [-k] [-b] ' + fcb C$LF + fcc / to create a new system disk by writing an OS9Boot file/ + fcb C$LF + fcc / and a boot (kernel) track to the specified drive./ + fcb C$LF,C$LF + fcc / -k = don't write the kernel track/ + fcb C$LF + fcc / Hard disk drives never have the kernel track written./ + fcb C$LF + fcc / -b = don't write the OS9Boot file/ + fcb C$CR + +L0051 fcb C$LF + fcc /Error writing kernel track or LSN0./ + fcb C$CR + +L008E fcb C$LF + fcc /Warning - file(s) present on track 34/ + fcb C$LF + fcc / - this track not rewritten./ + fcb C$CR + +L00D1 fcb C$LF + fcc /Error - OS9boot file fragmented/ + fcb C$CR + +L00F2 fcb C$LF + fcc /Error - can't find boot track in memory/ + fcb C$CR + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/copy.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/copy.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,320 @@ +******************************************************************** +* Copy - File copy utility +* +* $Id: copy.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 10 Reworked RML + + nam Copy + ttl File copy utility + +* Edition 10 rewrite 10/28/88 - RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 10 + + mod eom,name,tylg,atrv,start,size + +inpath rmb 1 input path number +outpath rmb 1 output path number +indevtyp rmb 1 input device type (1 = RBF) +verify rmb 1 verify on/off (1=on) +bufsize rmb 2 read/write buffer size +fsizemsb rmb 2 msb's of file size +fsizelsb rmb 2 lsb's of file size +writemsb rmb 2 msb's of bytes written to output +writelsb rmb 2 lsb's of bytes written to output +single rmb 1 single drive copy flag (1=yes) +attribs rmb 1 file attributes +fdbuff rmb 16 File Descriptor buffer +optbuff rmb 32 Path Descriptor Options Buffer +stack rmb 448 stack storage +vfybuff rmb 256 verify buffer +buffer rmb $2000-. read/write buffer (minimum..will expand with mem mod) +size equ . + +name fcs /Copy/ + fcb edition + +start leas vfybuff,u set stack pointer to 512 + pshs u save u reg + leau ?? + bne getopt no..check next char + bra openin else done..go finish processing + +chkopt ldd ,x+ get next 2 chars + eora #'S check if its an S + anda #$DF make upper case + lbne sndinstr not an s.. send instructions + cmpb #$30 else check if next char is number or letter + lbhs sndinstr yup...send instructions + inc + bsr sndline write it + puls y,x,a restore registers + eora #'C check if its a C + anda #$DF make it upper case + puls a restore drive status + bne sndsrc loop back & send message + puls y,x restore registers +msgrts rts + +Help fcc /Use: Copy [-s]/ + fcb C$LF + fcc / -s = single drive copy/ + fcc / (Path2 must be complete pathlist)/ + fcb C$CR + +crmsg + fcb C$CR + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/date.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/date.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,166 @@ +******************************************************************** +* Date - Print Date/Time +* +* $Id: date.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Greetings; September 25, 1996 +* +* This 'Date' module, date5, has been expanded a wee bit to +* make it smart enough to handle dates to the year 2099. +* +* In order to have it do it in a math conversion, I would have had to +* make the 8 bit math it does into 16 bit, and there aren't enough +* registers in the 6809 to pull that off in a reasonable code size. +* So it still does 8 bit math, but only has a 1900-2099 year total +* range. This is more than the recently converted clock for the Disto +* 4n1 I just uploaded, as that clock now has a range from 1980 to 2079. +* A simple subtraction determines if it prints a leading 20, and the +* contents of the register after the subtraction, or it reloads the +* string pointer to point at 19 and reloads the year register to get +* the year 00-99 to print. +* +* This contains no 6309 specific code, so Nitros9 and a 6309 cpu +* are not required to use it, box stock is fine. +* +* Gene Heskett, +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 5 Made Y2K compliant GH 96/09/25 +* 6 Made compliant with 1900-2155 BGP 99/05/07 + + nam Date + ttl Print Date/Time + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 6 + + mod eom,name,tylg,atrv,start,size + +SysYear rmb 1 +SysMonth rmb 1 +SysDay rmb 1 +SysHour rmb 1 +SysMin rmb 1 +SysSec rmb 1 +u0006 rmb 2 +u0008 rmb 440 +size equ . + +name fcs /Date/ + fcb edition + +DtComa fcs ', ' +MonTable fcs '??? ' + fcs 'January ' + fcs 'February ' + fcs 'March ' + fcs 'April ' + fcs 'May ' + fcs 'June ' + fcs 'July ' + fcs 'August ' + fcs 'September ' + fcs 'October ' + fcs 'November ' + fcs 'December ' + +start pshs x + leax ,u + leau u0008,u + stu MonTable,pcr + ldb DtComa,pcr + bsr PrtStrng + ldb MyCR,pcr + ldy #$0001 + os9 I$WritLn output a CR + lbcs Exit + leax >L0012,pcr dump out header + ldy #x12Len + os9 I$Write + lbcs Exit + lda #$01 + leax >u0464,u + os9 F$GPrDsc get system process descriptor + bcs Exit + leax u0064,u + ldd MyCR,pcr dump out another CR + ldy #$0001 + os9 I$WritLn + lbcs Exit + + leax >Header,pcr + ldy #$0028 + os9 I$WritLn + lbcs Exit + + leax >L004B,pcr + ldy #$0028 + os9 I$WritLn + lbcs Exit + leax >L0073,pcr + ldy #$0028 + os9 I$WritLn + lbcs Exit + + ldu u0064,u + ldx u0264,u to another buffer + ldd u0264,u point to the start of the buffer + ldd M$Name,x pointer to the name + leax d,x + lda #$05 + bsr L01FF dump out the first 5 bytes of the name? + + leax >u0264,u + lda M$Port,x port address of the device + lbsr L0228 + ldy u0264,u + ldd M$PDev,x device driver name offset + leax d,x + lda #$09 + bsr L01FF dump out 9 bytes of the driver name + ldx u0264,u + ldd M$FMGr,x file manager name offset + leax d,x point to it + lda #$09 + bsr L01FF dump out 9 bytes of the file manager's name + ldx 10? + bcs L0240 no, make it a number + adda #$07 if so, make it A-F +L0240 adda #$30 +L0242 pshs x + ldx {} [-x]" + fcb C$CR + +start lda ,x + cmpa #C$CR + beq L0093 + lda #1 + sta HelpMsg,pcr + ldy #80 + clra + os9 I$WritLn + clrb + bra L0051 + + emod +eom equ * + end + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/deldir.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/deldir.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,300 @@ +******************************************************************** +* Deldir - Delete a directory +* +* $Id: deldir.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 3 Original Tandy distribution version BGP + + nam Deldir + ttl Delete a directory + +* Disassembled 98/09/10 23:18:11 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 3 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 2 +u0002 rmb 1 +u0003 rmb 1 +u0004 rmb 24 +u001C rmb 4 +u0020 rmb 4 +u0024 rmb 10 +u002E rmb 6 +u0034 rmb 15 +u0043 rmb 1 +u0044 rmb 1 +u0045 rmb 1 +u0046 rmb 2 +u0048 rmb 2 +u004A rmb 2 +u004C rmb 334 +size equ . + +name fcs /Deldir/ + fcb edition + +start bsr L0050 + bcs L0042 + bsr L0091 + bcc L002B + lbsr L010C + bcs L0042 + lbsr L01C3 + bcs L0042 + lbsr L0242 + bcs L0042 +L002B lda L0020,pcr +L013C stx L0011,pcr + lbsr L02E6 + ldx L0022,pcr + os9 I$Open + lbcs L0268 + sta L0024,pcr + ldy #$007C + bra L01AE +L01A6 leax >L00A0,pcr + ldy #$005A +L01AE lda #$01 + os9 I$Write +L01B3 lda H2,pcr header of names + bsr Dump + leax 'F' + + subb #$07 map 'A' down to $0A +OK subb #$30 take out ascii zero, now B=nibble 0-F + +OK.0 leay 1,y +OK.1 clra set to no error +OK.2 rts + +Error comb set carry + rts + +Do.Text leau u0008,u + os9 F$GPrDsc + lbcs L00BC + puls x + bra L0073 +L006D bsr L0012 + clr u0048,u + tfr x,d + ldy u0208,u + os9 F$CpyMem + puls u + bcs L00BC + ldy u0208,u + lda #$01 + os9 I$Write +L00BB clrb +L00BC os9 F$Exit + +HelpTxt fcc "Use: DMem [] ! dump" + fcb C$LF + fcc " or: DMem - [] ! dump" + fcb C$CR +HelpTxtL equ *-HelpTxt + +L0119 leax >HelpTxt,pcr +L011D ldy #HelpTxtL + lda #$02 + os9 I$WritLn + bra L00BB +L0128 lda ,x+ + cmpa #C$SPAC + beq L0128 + leax -1,x + cmpa #C$CR + rts + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/dump.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/dump.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,218 @@ +******************************************************************** +* Dump - Show file contents in hex +* +* $Id: dump.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 6 Original Tandy distribution version + + nam Dump + ttl Show file contents in hex + +* Disassembled 98/09/14 23:34:34 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 6 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 1 +u0002 rmb 1 +u0003 rmb 1 +u0004 rmb 1 +u0005 rmb 1 +u0006 rmb 2 +u0008 rmb 2 +u000A rmb 2 +u000C rmb 16 +u001C rmb 5 +u0021 rmb 1 +u0022 rmb 16 +u0032 rmb 8 +u003A rmb 17 +u004B rmb 16 +u005B rmb 201 +size equ . + +name fcs /Dump/ + fcb edition +L0012 fcc "Addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 2 4 6 8 A C E" + fcb C$CR +L0051 fcc "---- ---- ---- ---- ---- ---- ---- ---- ---- ----------------" +L0090 fcb C$CR +L0091 fcb C$LF + fcb C$LF + fcb C$LF + fcb C$LF + fcc " 0 1 2 3 4 5 6 7 0 2 4 6" + fcb C$LF + fcc "ADDR 8 9 A B C D E F 8 A C E"" + fcb C$CR +L00D1 fcc "==== +-+-+-+-+-+-+-+- + + + + " + fcb C$CR + +L00F0 lda ,x+ + cmpa #$20 + beq L00F0 + leax -$01,x + cmpa #$0D + rts + +start lda #63 + sta L0090,pcr + lbsr L01EF + leax >L0012,pcr + tst L0091,pcr +L016C lbsr L01EF + leax >L0051,pcr + tst L00D1,pcr +L017B bsr L01EF +L017D leax L018D,pcr + bra L00DE +L00C0 ldx L0171,pcr +L00DE lda #$02 + ldy #$00FF + os9 I$WritLn +L00E7 clrb + lbra L0039 +L00EB lda L014F,pcr + bra L00DE +L014F fcc "** NON-HEX CHARACTER ENCOUNTERED" + fcb $07,C$CR +L0171 fcc "** CHECKSUM ERROR DETECTED" + fcb $07,C$CR +L018D fcc "** NON-CONTIGUOUS ADDRESS SPACE DETECTED" + fcb $07,C$CR + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/free.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/free.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,316 @@ +******************************************************************** +* Free - Print disk free space +* +* $Id: free.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 6 Original Tandy/Microware version +* 7 Incorporated Glenside Y2K fixes BGP 99/05/11 + + nam Free + ttl Print disk free space + +* Disassembled 98/09/11 16:58:25 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $00 +edition set 7 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 1 +u0002 rmb 1 +u0003 rmb 1 +u0004 rmb 1 +u0005 rmb 2 +u0007 rmb 1 +u0008 rmb 1 +u0009 rmb 1 +u000A rmb 1 +u000B rmb 1 +u000C rmb 1 +u000D rmb 26 +u0027 rmb 54 +u005D rmb 4 +u0061 rmb 2 +u0063 rmb 1 +u0064 rmb 19 +u0077 rmb 5 +u007C rmb 26 +u0096 rmb 6 +u009C rmb 2 +u009E rmb 2 +u00A0 rmb 4544 +size equ . + +name fcs /Free/ + fcb edition +L0012 fcb C$LF + fcc "Use: free [/diskname]" + fcb C$LF + fcc " tells how many disk sectors are unused" + fcb C$CR +L0052 fcs /" created on:/ +L005F fcs "Capacity:" +L0068 fcs " sectors (" +L0072 fcs "-sector clusters)" +L0083 fcs " free sectors, largest block" +L009F fcs " sectors" + +start leay u000D,u + sty L0012,pcr + ldy #$0040 + lda #$02 + os9 I$WritLn + lbra L01CC +L00CC leax -$01,x + pshs x + os9 F$PrsNam + puls x + bcs L00BC +L00D7 lda ,x+ + lbsr L0218 + subb #$01 + bcc L00D7 +L00E0 lda #$40 + lbsr L0218 + lbsr L0216 + leax u000D,u + stx L0052,pcr + lbsr L020C + lbsr L0293 + lbsr L0222 + leay >L005F,pcr + lbsr L020C + leax L0068,pcr + lbsr L020C + dec L0072,pcr + lbsr L020C + lbsr L0222 + clra + clrb + sta u009E,u + ldd #$1000 + cmpd L0083,pcr + bsr L020C + leax u0007,u + lbsr L024F + leay >L009F,pcr + bsr L020C + bsr L0222 + lda FuncTbl,pcr point to function pointer table +L007D ldy ,u++ get pointer to function + beq NoFunc + +* Compare passed function name to our list + ldx 4+stkdepth,s +L0084 lda ,x+ get passed param char + eora ,u+ XOR it with compared param char + anda #$DF make case same + beq L0094 branch if equal + leau -1,u back up one +L008E tst ,u+ + bpl L008E + bra L007D +L0094 tst -1,u + bpl L0084 + tfr y,d put funcion pointer in D + leay >FuncTbl,pcr point Y to table + leay d,y get function address + leax ,s + leau <$11,s + ldd stkdepth+2,s put parameter count in D + jmp ,y + +NoFunc ldb #E$NoRout + bra L00AF +BadFunc ldb #E$ParmEr $38 +L00AF coma + leas stkdepth,s + rts + +* Each subroutine enters with the following parameters +* B = parameter count +* X = temporary stack +* U = pointer to size of first parameter + +Mode lda #$0F + bra L00B9 + +Move lda #$15 +L00B9 cmpb #$03 correct number of params? + bne BadFunc + bra L010B + +CColor lda #$11 + bra L00DE + +Point cmpb #$03 correct number of params? + beq L00D4 + cmpb #$04 + bne BadFunc + leau <$19,s + lbsr L015E + leau <$11,s +L00D4 lda #$18 + bra L010B + +Clear cmpb #$01 correct number of params? + beq L00E4 + lda #$10 +L00DE cmpb #$02 + bne BadFunc + bra L0136 + +L00E4 lda #$13 + bra L0142 + +Line cmpb #$06 correct number of params? + bhi BadFunc + cmpb #$03 + bcs L015B + bitb #$01 + bne L0103 + leau <$19,s + cmpb #$04 + beq L00FE + leau <$21,s +L00FE bsr L015E + leau <$11,s +L0103 cmpb #$04 + bls L0109 + bsr L0164 +L0109 lda #$16 +L010B sta ,x+ + bsr L016E + bsr L016E + bra L0144 + +Circle cmpb #$05 correct number of params? + bhi L015B + cmpb #$02 + bcs L015B + bitb #$01 + beq L012E + leau <$15,s + cmpb #$03 + beq L0129 + leau <$1D,s +L0129 bsr L015E + leau <$11,s +L012E cmpb #$03 + bls L0134 + bsr L0164 +L0134 lda #$1A +L0136 sta ,x+ + bsr L016E + bra L0144 + +Alpha lda #$0E + bra L0142 + +Quit lda #$12 +L0142 sta ,x+ +L0144 bsr L0149 + leas stkdepth,s + rts + +L0149 tfr x,d + leax 2,s + pshs x + subd ,s++ + tfr d,y + lda #1 + os9 I$Write + rts + +L0159 leas $06,s +L015B lbra BadFunc +L015E lda #$11 + sta ,x+ + bra L016E +L0164 puls y + lda #$15 + sta ,x+ + bsr L016E + pshs y +L016E pshs y,b,a + ldd [,u++] + sta ,x+ + pulu y + leay -$01,y + beq L0183 + leay -$01,y + bne L0159 + tsta + bne L0159 + stb -$01,x +L0183 puls pc,y,b,a + +GLoc cmpb #$02 correct number of params? + bne L015B + ldx <$13,s + leax -$02,x + bne L015B + lda #1 standard out + ldb #SS.DStat + os9 I$GetStt + bcs L019C + stx [<$11,s] +L019C leas stkdepth,s + rts + +GColr cmpb #2 correct number of params? + beq L01AD + cmpb #$04 + bne L015B + bsr L0164 + bsr L0149 + bcs L019C +L01AD lda #$01 + ldb #$12 + os9 I$GetStt + bcs L019C + tfr a,b + bra L01ED +L01BA leau $04,u + pshs u,x + ldx -$02,u + ldu -$04,u + leax -$01,x + beq L01CC + leax -$01,x + bne L0159 + clr ,u+ +L01CC stb ,u+ + puls pc,u,x + +JoyStk cmpb #5 correct number of params? + bne L015B + clr ,x+ + bsr L016E + ldx -2,x + lda #1 + ldb #SS.Joy + os9 I$GetStt + bcs L019C + tfr a,b + bsr L01BA + tfr x,d + bsr L01BA + tfr y,d +L01ED bsr L01BA + leas stkdepth,s + rts + + emod +eom equ * + end + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/grfdrv.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/grfdrv.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,3977 @@ + nam GrfDrv + ttl os9 system module + +* Disassembled 98/09/22 22:15:01 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Systm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 18 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 0 +size equ . + fcb $07 + +name fcs /GrfDrv/ + fcb edition + +start ldx #FlipSys+MemPos get return vector address + pshs x,b,a save it and call # + tfr u,d set up my DP + tfr a,dp + leax g0038 am I initalized already? + bmi L00E2 yes, return + lda #$FF get init code + sta <$0038 save it + +* Initialize window tables + + leax >$0180,u point to window table start position + ldb #$FF get init code + ldy #32 get max # windows +L009D std ,x initalize window +L009F leax $1007 get my stack pointer + clr >$1002 clear map side + clra reset DP + tfr a,dp + puls a purge stack + jmp [>D.Flip0] return to system + +****************************** +* +* Setup MMU for a window change +* + +L0107 pshs y,x,b,a preserve regs + ldx -$10,y get screen table pointer + stx 2,s save it in X on stack +L010D leay Wt.POff,y move to PSet offset + ldd $07,y get LSet vector + std <$0064 save LSet vector for this window + ldd $05,y get LSet table pointer + std <$0068 save it for this window + ldd -$09,y get fore/back colors + std <$0061 save 'em for this window + ldd $0C,y get max X coordinate + std <$006A save it for this window + ldd $0E,y get max Y coordinate + std <$006C save it for this window + ldb St.Sty,x get screen type + andb #$8F keep only what we need + stb <$0060 save it for this window + ldb St.BRow,x get # bytes per row + stb <$0063 save it for this window + ldb St.SBlk,x get 1st block # +L012F leax >$008F,u point to my DAT images' 4th entry + ldy #$FFAC get MMU start + clra get block type +L0138 std ,x++ save it to my image + stb ,y+ save it to MMU + incb get next block # + cmpy #$FFAF done? + bls L0138 no, keep going + puls pc,y,x,b,a restore & return + +****************************** +* +* Setup MMU +* + +L0145 pshs y,x,b,a + bra L012F + +L0149 pshs y,x,b,a + ldx -$10,y + bra L010D + bsr L0107 + lbra L13FB + clr <$0089 + stb <$008A + stb >$FFA9 + rts +L015C pshs a + os9 F$AllRAM + puls pc,a +L0163 pshs a + os9 F$AlHRAM + puls pc,a +L016A os9 F$DelRAM + rts + bsr L0198 + bcs L0197 + lda <$0060 + cmpa #$FF + bne L0182 + lda [<-$10,y] + sta <$0060 + lbsr L13FB + bra L0187 +L0182 lbsr L01D5 + bcs L0197 +L0187 lbsr L0107 + lbsr L02EE + lda #$FF + sta -$0E,y + ldb $08,y + lbsr L129C + clrb +L0197 rts +L0198 lda <$0060 + cmpa #$FF + bne L01A1 + lda [<-$10,y] +L01A1 leax $0980,u + ldb #$10 +L01FA tst $01,x + beq L01F2 + leax <$20,x + decb + bne L01FA + comb + ldb #$C1 + rts +L0208 pshs y + ldb <$0060 + bpl L0228 + leay >$0980,u + lda #$10 +L0214 tst ,y + bpl L0220 + ldb $01,y + beq L0220 + bsr L026F + bcc L0247 +L0220 leay <$20,y + deca + bne L0214 + ldb <$0060 +L0228 leay $0800,y + cmpy #$A000 +L0262 rts + aim #$02,<$0004 + lsr <$0001 +L0268 oim #$50,<$0050 + suba ,y+ + suba -$10,u +L026F pshs y,x,b,a + lbsr L0145 + ldy #$8000 + ldb #$FF +L027A cmpb ,y + beq L0285 +L027E bsr L025A + bcs L027A +L0282 comb + puls pc,y,x,b,a +L0285 lda <$0060 + anda #$8F + cmpa #$86 + beq L029A + leax >$0800,y + cmpx #$A000 + bcc L0282 + cmpb ,x + bne L027E +L029A clrb + puls x,b,a + leas $02,s + rts +L02A0 pshs y,x + stb <$0097 + stb <$0098 + lda ,x + bpl L02AE + ldb #$20 + stb <$0097 +L02AE pshs x + ldd -$0B,y + bne L02C9 + ldb ,x + leax >L01CF,pcr + andb #$01 + abx + ldd -$09,y + cmpa ,x + bne L02C9 + cmpb #$18 + bne L02C9 + puls pc,y,x,b,a +L02C9 puls x + ldy $02,x + lda ,x + anda #$0F + lsla + leax + suba #$3E + suba #$07 + subb <$0003 + eorb -$0C,y + clrd + sta <$18,y + sta $0A,y + sta $0E,y + ldx #$5F9A + stx <$14,y + ldx #$5F83 + stx <$16,y + lda #$89 + sta $09,y + bsr L0325 + stb <$0061 + bsr L032F + stb <$0062 + lbsr L06DC + puls x + ldd $02,x + bsr L0337 + clr $0B,y + ldd #$C801 + std <$0057 + lbsr L05A2 + clrb + rts +L0325 ldb $06,y + lbsr L0698 + stb $06,y + rts +L032D bsr L0325 +L032F ldb $07,y + lbsr L0698 + stb $07,y + rts +L0337 lbsr L04ED + ldd -$0D,y + std <$24,y + ldd -$0B,y + std <$26,y + clr -$0B,y + clr -$0A,y + ldd -$09,y + std <$28,y + rts +L034E tsta + beq L0355 + orb $09,y + bra L0358 +L0355 comb + andb $09,y +L0358 stb $09,y + bra L038E + ldb #$01 + bra L034E + jsr <$00B9 + ldd #$FFFE + std -$10,y + bsr L0390 + bcs L0387 + bsr L03A8 + cmpy <$002E + bne L038E + clra + clrb + std <$002E + std <$0030 + ldx #$FFB0 + ldd #$1008 + stb >$FF9A +L0381 stb ,x+ + deca + bhi L0381 + rts +L0387 ldb $06,x + stb <$0062 + lbsr L129C +L038E clrb + rts +L0390 pshs y + leay >$0190,u + ldb #$20 +L0398 cmpx -$10,y + beq L03A5 + leay <$40,y + decb + bne L0398 + clrb + bra L03A6 +L03A5 comb +L03A6 puls pc,y +L03A8 pshs y + lda ,x + bpl L03D0 + ldy $02,x + ldb #$FF + stb ,y + anda #$CF + cmpa #$85 + bne L03BF + stb >$0800,y +L03BF ldy #$8000 +L03C3 cmpb ,y + bne L03E6 + lbsr L025A + bcs L03C3 + ldb #$01 + bra L03D8 +L03D0 anda #$0F + leay >L0262,pcr + ldb a,y +L03D8 pshs x,b + clra + ldb $01,x + tfr d,x + puls b + lbsr L016A + puls x +L03E6 clr $01,x + puls pc,y +L03EA puls b,a + pshs y,b,a + ldb -$0E,y + lda #$40 + mul + leay >$0190,u + leay d,y + rts + bsr L03EA + jsr <$00B9 + tfr y,d + ldy ,s + std ,s + bsr L042D + bcs L042B + ldd -$10,x + std -$10,y + lbsr L0149 + bsr L045C + tst <$0059 + beq L0421 + bsr L048E + bcs L042B + ldb $07,y + stb <$0062 + lbsr L129C +L0421 ldx ,s + cmpx <$002E + bne L042A + sty <$002E +L042A clrb +L042B puls pc,x +L042D bsr L044A +L042F ldb -$0B,y + bmi L0447 + addb -$09,y + cmpb <$28,x + bhi L0447 + ldb -$0A,y + bmi L0447 + addb -$08,y + cmpb <$29,x + bhi L0447 + clrb + rts +L0447 lbra L01CB +L044A tfr y,x +L044C ldb -$0E,x + bmi L045B + leax >$0190,u + lda #$40 + mul + leax d,x + bra L044C +L045B rts +L045C clr <$11,y + lda $09,x + sta $09,y + lbsr L06DC + lda $08,x + anda #$C0 + ora $08,y + sta $08,y + ldd #$050A + bsr L0481 + ldd #$0714 + bsr L0481 + lbsr L032D + ldd -$0D,x + lbsr L0337 + rts +L0481 pshs a +L0483 lda b,x + sta b,y + incb + dec ,s + bne L0483 + puls pc,a +L048E pshs x + clra + ldb -$09,y + tst <$0060 + bmi L049A + lda #$08 + mul +L049A std <$004F + clra + ldb -$08,y + tst <$0060 + bmi L04A6 + lslb + lslb + lslb +L04A6 std <$0051 + clrb + std <$0047 + lbsr L0AF5 + puls pc,x + jsr <$00B9 + cmpy <$002E + bne L04BF + lbsr L03EA + sty <$002E + puls y +L04BF ldb <$11,y + beq L04D6 + jsr <$00BC + stb <$007D + ldd <$12,y + std <$007E + lbsr L0C01 + lbsr L084C + lbsr L0963 +L04D6 ldd #$FFFF + std -$10,y + bra L04EB + jsr <$00B9 + tfr y,x + lbsr L042F + bcs L04EC + ldd <$24,y + bsr L04ED +L04EB clrb +L04EC rts +L04ED pshs x,b,a + ldb <$0060 + andb #$0F + leax >L0548,pcr + ldb b,x + stb $03,y + lda -$09,y + mul + stb $02,y + clra + ldb <$0063 + tst <$0060 + bmi L050A + lda #$08 + mul +L050A std $04,y + ldb -$0A,y + ldx $04,y + lbsr L1E21 + std <$0097 + lda -$0B,y + ldb $03,y + mul + addd ,s++ + addd <$0097 + std -$0D,y + lbsr L10A7 + ldb <$0060 + bmi L0529 + bsr L054F +L0529 clra + ldb -$09,y + tst <$0060 + bmi L0533 + lda #$08 + mul +L0533 subd <$00B3 + std <$1B,y + clra + ldb -$08,y + tst <$0060 + bmi L0542 + lda #$08 + mul +L0542 subb #$01 + std <$1D,y + puls pc,x + oim #$02,<$0002 + lsr <$0002 + aim #$34,<$0010 + clra + ldb -$09,y + tfr d,x + lda #$03 + mul + pshs b + ldb #$33 + lbsr L1E00 + addb ,s+ + stb -$07,y + clra + ldb -$08,y + tfr d,x + lda #$0A + mul + pshs b + ldb #$AB + lbsr L1E00 + addb ,s+ + stb -$06,y + puls pc,x + ldb <$0057 + bne L0584 + stb $0E,y + ldx #$5F83 + bra L059B +L0584 lbsr L0851 + bcs L059F + stb $0E,y + leax <$20,x + stx $0F,y + ldx -$10,y + ldb ,x + ldx #$5F0A + ldb b,x + leax b,x +L059B stx <$16,y +L059E clrb +L059F rts + jsr <$00B9 +L05A2 ldb <$0057 + bne L05A9 + stb $0B,y + rts +L05A9 lbsr L0F31 + lbsr L0851 + bcs L05E2 + pshs x,b + ldd $07,x + tsta + bne L05E3 + cmpb #$06 + beq L05C0 + cmpb #$08 + bne L05E3 +L05C0 ldd $09,x + cmpd #$0008 + bne L05E3 + stb $0B,x + ldd $07,x + cmpd <$006E + beq L05DB + tst $0B,y + beq L05DB + lbsr L112D + lbsr L1119 +L05DB puls x,b + stb $0B,y + stx $0C,y + clrb +L05E2 rts +L05E3 ldb #$C2 + coma + puls pc,x,a + jsr <$00B9 + ldb <$0057 + bne L05F2 + stb <$18,y + rts +L05F2 lbsr L0851 + bcs L059F + stb <$18,y + stx <$19,y + bra L059E + leax $1972 + daa + ror >$E629 + orb #$80 + tsta + beq L062B + andb #$7F +L062B stb $09,y +L062D clrb + rts + ldb <$0086 + ldx -$10,y + leax <$10,x + lda <$005A + anda #$0F + stb a,x + bra L062D + ldx -$10,y +L0640 pshs y,x + leay <$10,x + ldx >$1019 + clra +L0649 ldb ,x+ + stb a,y + inca + cmpa #$0F + ble L0649 + puls pc,y,x + ldb <$005A + ldx -$10,y + stb $05,x + bra L0696 + bsr L0673 + stb $06,y + ldb $09,y + bitb #$04 + bne L0688 +L0666 ldb <$005A + lslb + lslb + lslb + andb #$38 + lda $08,y + anda #$C7 + bra L0690 +L0673 ldx -$10,y + ldb ,x + stb <$0060 + ldb <$005A + bsr L0698 + rts + bsr L0673 + stb $07,y + ldb $09,y + bitb #$04 + bne L0666 +L0688 ldb <$005A + andb #$07 + lda $08,y + anda #$F8 +L0690 stb <$0097 + ora <$0097 + sta $08,y +L0696 clrb + rts +L0698 pshs x,a + lda <$0060 + bmi L06A2 + tfr b,a + bsr L06AC +L06A2 puls pc,x,a +L06A4 leax $0F00] + fcb $11 + bhi L06F9 + lsra + fcb $55 U + ror -$09,s + eora #$99 + ora [d,y] + ldd #$DDEE + stu >$6D84 + bpl L06D9 + andb #$07 + rts +L06D9 bsr L0698 + rts +L06DC ldd $06,y + anda #$07 + lsla + lsla + lsla + andb #$07 + stb <$0097 + ora <$0097 + sta $08,y + rts + ldb #$10 +L06EE lbra L034E + ldb #$08 + bra L06EE + ldb #$20 + bra L06EE +L06F9 ldx <$002E + pshs y,x + ldy -$10,y + lda $01,y + ldx $02,y + lbsr L07E9 + ldx #$FF90 + ldb >$0090 + andb #$7F + stb >$0090 + stb ,x + leax $0098 + anda #$78 + ora ,x+ + ldb ,y + andb #$10 + lslb + orb ,x + ldx #$FF90 + std >$0098 + std $08,x + ldd <$0082 + lsra + rorb + ror <$0084 + lsra + rorb + ror <$0084 + lsra + rorb + ror <$0084 + clra + std >$009C + std $0C,x + lda <$0084 + clrb + std >$009E + std $0E,x + ldb $05,y + leay <$10,y + ldb b,y + stb >$009A + bsr L079B + stb $0A,x + ldx #$FFB0 + lda #$10 +L0762 ldb ,y+ + bsr L079B + stb ,x+ + deca + bhi L0762 + ldy ,s++ + beq L0772 + jsr <$00B9 +L0772 puls y + lbsr L0107 + sty <$002E + stx <$0030 + ldb >$1000 + stb >$1001 + ldd <$003D + std <$005B + ldd <$003F + std <$005D + lbsr L142A +L078D clrb + rts + suba #$14 + suba #$15 + suba #$1D + suba #$1E + com <$0015 + com <$0005 +L079B pshs x + tst >$1009 + bne L07A7 + leax $00A1,u] +L0888 clra + rts +L088A clra + clrb + stb <$007D + std <$007E + rts +L0891 pshs y,b + ldy <$0080 + ldx #$49E2 + stx <$00A1 + lbsr L09D5 + bcs L08BF + stb ,s + ldd $05,x + subd <$0080 + bne L08B5 + pshs x + lbsr L092D + puls x + ldb ,s + jsr <$00BC + bra L08BE +L08B5 subd <$00B5 + std $05,x + leax <$20,x + leax d,x +L08BE clra +L08BF puls pc,y,b +L08C1 ldd <$0080 + addd <$00B5 + std <$0097 + addd #$1FFF + lsra + lsra + lsra + lsra + lsra + tfr a,b + stb <$0099 + lbsr L015C + bcs L090C + pshs b + ldb <$0099 + cmpb #$01 + bhi L0901 + ldd <$00B7 + subd <$0097 + anda #$1F + std <$009B + beq L0901 + ldd <$00B7 + subd <$009B + addd <$00B7 + tfr d,x + ldb ,s + addb <$0099 + decb + jsr <$00BC + bsr L091D + ldd <$009B + subd <$00B5 + std $05,x +L0901 ldx <$00B7 + puls b + jsr <$00BC + lda <$0099 + sta $0F,x + clra +L090C rts +L090D pshs b,a + lda <$0032 + sta ,x + stb <$0032 + ldd <$0033 + std $01,x + stx <$0033 + puls pc,b,a +L091D pshs b,a + lda <$0035 + sta ,x + stb <$0035 + ldd <$0036 + std $01,x + stx <$0036 + puls pc,b,a +L092D pshs y,a + lda ,x + ldy $01,x + ldx <$007E + ldb <$007D + bne L0941 + sta <$0035 + sty <$0036 + bra L0948 +L0941 jsr <$00BC + sta ,x + sty $01,x +L0948 puls pc,y,a + ldb #$01 + stb <$0097 +L094E lbsr L0851 + bcs L095D + clr <$0097 + bsr L0963 + bcs L0962 + ldb <$0058 + beq L094E +L095D lda <$0097 + bne L0962 + clrb +L0962 rts +L0963 pshs y,x,b + lda $0F,x + sta <$009F + lda ,x + ldy $01,x + ldb <$007D + bne L0979 + sta <$0032 + sty <$0033 + bra L0982 +L0979 jsr <$00BC + ldx <$007E + sta ,x + sty $01,x +L0982 ldb ,s + lda <$009F + cmpa #$01 + bgt L09A9 + tfr b,a + bsr L09B3 + bcc L09A0 + leax $00A1,u] +L0A3D comb + puls pc,u,x,b,a + lbsr L0851 + bcs L0A54 + pshs b + ldd <$1F,y + cmpd $05,x + puls b + bls L0A61 + lbra L0AF1 +L0A54 ldd <$1F,y + std <$0080 + lbsr L0801 + bcc L0A5F + rts +L0A5F ldb <$007D +L0A61 stb <$21,y + clra + clrb + std <$0047 + ldb <$0060 + lbsr L0B36 + lbsr L0B74 + leax <$20,x + stx <$22,y + bra L0AEF + pshs y + ldb <$21,y + stb <$0097 + jsr <$00BC + ldx <$22,y + leay >$0100,u +L0A88 ldb ,y+ + stb ,x+ + deca + beq L0A9E + cmpx #$4000 + bcs L0A88 + inc <$0097 + ldb <$0097 + jsr <$00BC + ldx <$00B7 + bra L0A88 +L0A9E puls y + ldb <$0097 + stb <$21,y + stx <$22,y + bra L0AEF + lbsr L1DA2 + bcs L0AF4 + lbsr L1DAD + ldd ,x + subd <$00B3 + cmpd <$1B,y +L0ABA lbhi L1E44 + ldd $02,x + subd <$00B3 + cmpd <$1D,y + bhi L0ABA + jsr <$00B9 + bsr L0B16 + lbsr L0851 + bcc L0AD7 + lbsr L0801 + bcc L0AE2 + rts +L0AD7 stb <$007D + stx <$007E + ldd <$0080 + cmpd $05,x + bhi L0AF1 +L0AE2 lbsr L0B74 + lbsr L1E48 + stx <$0072 + ldx <$007E + lbsr L0B98 +L0AEF clrb + rts +L0AF1 comb + ldb #$BF +L0AF4 rts +L0AF5 ldd -$0D,y + std <$0072 + bsr L0B16 + ldd #$FFFF + std <$0057 + lbsr L0801 + bcs L0B15 + ldb <$007D + stb <$11,y + ldd <$007E + std <$12,y + bsr L0B74 + lbsr L0B98 + clrb +L0B15 rts +L0B16 pshs x + ldb <$0060 + bpl L0B23 + ldd <$004F + lslb + stb <$0009 + bra L0B25 +L0B23 bsr L0B36 +L0B25 ldb <$0009 + ldx <$0051 + lbsr L1E21 + std <$0080 + ldb <$0063 + subb <$0009 + stb <$000A + puls pc,x +L0B36 lda #$07 + decb + beq L0B43 + lda #$01 + cmpb #$03 + beq L0B43 + lda #$03 +L0B43 sta <$0097 + ldb <$0048 + comb + andb <$0097 + incb + stb <$0006 + clra + cmpd <$004F + bge L0B5E + ldb <$0050 + subb <$0006 + andb <$0097 + bne L0B5E + ldb <$0097 + incb +L0B5E stb <$0007 + clra + ldb <$0048 + andb <$0097 + addd <$004F + addb <$0097 + adca #$00 +L0B6B lsra + rorb + lsr <$0097 + bne L0B6B + stb <$0009 + rts +L0B74 ldd <$004F + std $07,x + ldd <$0051 + std $09,x + ldb <$0060 + stb $0E,x + ldd <$0006 + std $0C,x + ldb <$0009 + stb $0B,x + clra + std <$004F + rts +L0B8C tfr y,x + lda <$0097 + sta <$000A + lda #$01 + sta <$0099 + bra L0B9A +L0B98 clr <$0099 +L0B9A pshs y + leay <$20,x + ldx <$0072 +L0BA1 lda <$0050 +L0BA3 tst <$0099 + bne L0BAD + ldb ,x+ + stb ,y+ + bra L0BB1 +L0BAD ldb ,y+ + stb ,x+ +L0BB1 cmpy #$4000 + bcs L0BBA + lbsr L0D63 +L0BBA deca + bne L0BA3 + ldb <$000A + abx + dec <$0052 + bne L0BA1 + puls pc,y + jsr <$00B9 + lbsr L1F65 + lbsr L0851 + bcs L0C00 + stb <$007D + stx <$007E + ldd $07,x + std <$004F + ldd $09,x + std <$0051 + lbsr L1DA2 + bcs L0C00 + lbsr L1DAD + lbsr L1E48 + stx <$0072 + stb <$0074 + ldy <$007E + lda #$01 + bsr L0C1D + bcs L0BF9 + lbsr L0CAE + bra L0BFF +L0BF9 lbsr L0D00 + lbsr L0D88 +L0BFF clrb +L0C00 rts +L0C01 pshs y + ldd -$0D,y + std <$0072 + clra + clrb + std <$0047 + ldy <$007E + bsr L0C1D + bcs L0C18 + lbsr L0B8C + clrb + puls pc,y +L0C18 comb + ldb #$BE + puls pc,y +L0C1D pshs x + ldb <$0060 + cmpb $0E,y + bne L0C6C + tstb + bpl L0C30 + ldb #$FF + stb <$0000 + stb <$0001 + bra L0C61 +L0C30 tsta + beq L0C4A + ldd <$0047 + addd $07,y + subd #$0001 + cmpd <$006A + bhi L0C6C + ldb $0A,y + addb <$004A + decb + cmpb <$006D + bhi L0C6C + ldb <$0060 +L0C4A leax $1FF8 + swi + fcb $FC + clr >$FEFF + stu >$03C0 + clr <$00F0 + swi + fcb $FC + stu >$FF0F + subb >$FFFF +L0C9D ldd $0A,y + stb <$0050 + sta <$0052 + rts +L0CA4 ldd <$0047 + std <$00AB + ldx <$0072 + leay <$20,y + rts +L0CAE lbsr L0E3F + pshs y + bsr L0CA4 + inc <$0097 + dec <$0050 +L0CB9 ldd <$00AB + std <$0047 + ldb <$0000 + lda <$0050 + beq L0CE8 + sta <$0099 + bra L0CC9 +L0CC7 ldb #$FF +L0CC9 lda ,y+ + lbsr L1F06 + ldd <$0047 + addb <$0005 + bcc L0CD5 + inca +L0CD5 std <$0047 + leax $01,x + cmpy #$4000 + bcs L0CE2 + lbsr L0D63 +L0CE2 dec <$0099 + bne L0CC7 + ldb <$0001 +L0CE8 lda ,y+ + lbsr L1F06 + cmpy #$4000 + bcs L0CF5 + bsr L0D63 +L0CF5 ldb <$0097 + abx + inc <$004A + dec <$0052 + bne L0CB9 + puls pc,y +L0D00 pshs y + ldd <$006A + subd <$0047 + addd <$00B3 + std <$009B + ldb <$006D + subb <$004A + bra L0D27 +L0D10 pshs y + lda <$0060 + lsra + ldd #$027F + bcs L0D1D + ldd #$013F +L0D1D subd <$003D + addd <$00B3 + std <$009B + ldb #$BF + subb <$0040 +L0D27 incb + stb <$00A0 + lbsr L1E9C + lbsr L0C9D + ldd $0C,y + std <$0006 + lbsr L06A4 + abx + lda ,x+ + stx <$0002 + leax $00A1,u] + rola + rola + rola + rola + rola + rola + rola +L0DD4 pshs b,a,cc + ldd <$009D + beq L0DEC + subd <$00B3 + std <$009D + ldd $01,s + anda <$0008 + lda a,y + lbsr L1F06 + lbsr L1EB3 + stb $02,s +L0DEC dec <$0097 + beq L0DF6 + puls b,a,cc + jmp [>$00A3,u] +L0DF6 leas $03,s + dec <$0004 + beq L0E12 + lda <$0004 + cmpa #$01 + beq L0E06 + lda <$0005 + bra L0E08 +L0E06 lda <$0007 +L0E08 sta <$0097 + ldy <$00A3 + sty <$00A1 + bra L0DA5 +L0E12 ldx <$0072 + ldb <$0063 + abx + dec <$00A0 + beq L0E23 + inc <$004A + dec <$0052 + lbne L0D8D +L0E23 puls pc,y + lbsr L0851 + bcs L0E9F + stb <$0097 + ldb $0F,x + stb <$0099 + ldd $05,x + std <$009B + leax <$20,x + tfr x,d + anda #$1F + std <$009D + bra L0E9E +L0E3F ldb <$0060 + leax >L15C3,pcr + lda b,x + tfr a,b + cmpd $0C,y + bne L0E63 + leax >L1F83,pcr + cmpx <$0064 + bne L0E63 + leax >L1F9A,pcr + cmpx <$0068 + bne L0E63 + leas $02,s + lbra L0B8C +L0E63 sta <$0005 + rts + ldb <$2A,y + rorb + bcc L0E6E + clrb + rts +L0E6E lbsr L0107 + tsta + bpl L0E8E + cmpa #$BF + bhi L0E84 + anda #$EF + suba #$90 + cmpa #$1A + bcc L0E8E +L0E80 lda #$2E + bra L0E8E +L0E84 anda #$DF + suba #$C1 + bmi L0E80 + cmpa #$19 + bhi L0E80 +L0E8E ldb <$0060 + bpl L0E96 + bsr L0EA0 + bra L0E9B +L0E96 lbsr L13FB + bsr L0EDE +L0E9B lbsr L10D0 +L0E9E clrb +L0E9F rts +L0EA0 cmpa #$60 + bne L0EA6 + lda #$27 +L0EA6 cmpa #$5F + bne L0EAC + lda #$7F +L0EAC cmpa #$5E + bne L0EB2 + lda #$60 +L0EB2 ldx -$05,y + tst $09,y + bmi L0EC6 + ldb $01,x + andb #$07 + stb $01,x + ldb $08,y + andb #$F8 + orb $01,x + bra L0EC8 +L0EC6 ldb $08,y +L0EC8 std ,x + ldd <$00B3 + std <$006E + std <$0070 + cmpy <$002E + bne L0EDD + sta <$0039 + ldb >$1000 + stb >$1001 +L0EDD rts +L0EDE pshs y,a + ldb $09,y + stb <$000E + bitb #$04 + beq L0EEE + ldd <$0061 + exg a,b + std <$0061 +L0EEE bsr L0F31 + bcs L0EFC + lda ,s + ldb $0B,x + mul + cmpd $05,x + bcs L0F01 +L0EFC leax L100B,pcr + sty <$00A9 + ldy $01,s + bsr L0F9A +L0F27 puls pc,y,a +L0F29 neg <$0000 + neg <$0000 + neg <$0000 + fcb $10 + neg <$0034 + aim #$D6,<$0060 + bpl L0F3F + ldd <$00B3 + std <$006E + std <$0070 + bra L0F5A +L0F3F ldb $0B,y + bne L0F4D + ldd #$0008 + std <$006E + std <$0070 + comb + bra L0F5A +L0F4D jsr <$00BC + ldx $0C,y + ldd $07,x + std <$006E + ldd $09,x + std <$0070 + clrb +L0F5A puls pc,a +L0F5C ldy -$05,y + exg x,y + lda <$0071 + deca + sta <$0097 +L0F66 lda ,y+ + ldb <$000E + bitb #$20 + beq L0F71 + lsra + ora -$01,y +L0F71 tfr a,b + coma + tst <$000E + bmi L0F7C + anda ,x + bra L0F7E +L0F7C anda <$0062 +L0F7E sta ,x + andb <$0061 + orb ,x + stb ,x + ldb <$0063 + abx + dec <$0097 + bmi L0F99 + bne L0F66 + ldb <$000E + bitb #$40 + beq L0F66 + lda #$FF + bra L0F71 +L0F99 rts +L0F9A pshs x + leax $00A9,u] +L100B lsl <$000B + bcs L1017 + lda <$000E + bpl L102A + lda <$0062 + bra L1019 +L1017 lda <$0061 +L1019 comb + andb ,x + stb ,x + anda ,s + ora ,x + sta ,x + bra L102A + eorb ,x + stb ,x +L102A dec <$0097 + beq L1035 + puls b + lbsr L1EB9 + bra L1005 +L1035 puls b + ldx <$000C + ldb <$0063 + abx + dec <$0099 + bmi L104C + bne L0FE7 + lda <$000E + bita #$40 + beq L0FE7 + lda #$FF + bra L0FFB +L104C rts + stx w,y + jsr -$5473,y + inc <$0017 + neg <$00A5 + bra L10A5 + bsr L1063 + lbsr L1485 + bra L10A5 +L1063 jsr <$00B9 + lbra L0F31 + bsr L1063 + clra + ldb <$0047 + subd <$00B5 + tfr d,x + ldb <$006F + lbsr L1E21 + std <$0047 + addd <$006E + subd <$00B3 + cmpd <$1B,y + bhi L10A5 + clra + ldb <$0049 + subd <$00B5 + tfr d,x + ldb <$0071 + lbsr L1E21 + std <$0049 + addd <$0070 + subd <$00B3 + cmpd <$1D,y + bhi L10A5 + ldd <$0047 +L109C std -$02,y + ldd <$0049 + std ,y + lbsr L1131 +L10A5 clrb + rts +L10A7 clra + clrb + std ,y + lbra L112D +L10AE ldd -$02,y + subd <$006E + std -$02,y + lbpl L1139 + ldd <$1B,y + subd <$006E + addd <$00B3 + std -$02,y + ldd ,y + subd <$0070 + std ,y + bpl L1139 + clra + clrb + std -$02,y + std ,y + rts +L10D0 ldd -$02,y + tfr d,x + addd <$006E + std -$02,y + addd <$006E + subd <$00B3 + cmpd <$1B,y + bls L1139 + lda <$2A,y + bpl L10F0 + stx -$02,y + ora #$01 + sta <$2A,y + bra L1139 +L10F0 bsr L112D + bra L1119 +L10F4 ldd ,y + subd <$0070 + bmi L10FE + std ,y + bsr L1139 +L10FE rts + cmpa #$0D + beq L112D + cmpa #$01 + beq L10A7 + cmpa #$08 + beq L10AE + cmpa #$06 + beq L10D0 + cmpa #$09 + beq L10F4 + cmpa #$0A + lbne L1267 +L1119 ldd ,y + addd <$0070 + tfr d,x + addd <$0070 + subd <$00B3 + cmpd <$1D,y + bhi L1149 + stx ,y + bra L1139 +L112D clra + clrb + std -$02,y +L1131 lda <$2A,y + anda #$FE + sta <$2A,y +L1139 ldd -$02,y + std <$0047 + ldd ,y + std <$0049 + lbsr L1E48 + stx -$05,y + stb -$03,y + rts +L1149 pshs y + ldb $02,y + lbsr L1252 + std <$0097 + clra + ldb <$0063 + std <$0099 + ldd ,y + std <$009D + lda -$08,y + deca + sta <$009B + beq L1184 + ldx -$0D,y + ldd $04,y + tfr x,y + leax d,x + tst <$0060 + bmi L1175 + lda <$009B + lsla + lsla + lsla + sta <$009B +L1175 ldd <$0097 + lbsr L121F + ldd <$0099 + leax d,x + leay d,y + dec <$009B + bne L1175 +L1184 puls y + ldd <$009D +L1188 lbra L127A +L118B lda #$80 + ora <$2A,y + bra L1197 +L1192 lda #$7E + anda <$2A,y +L1197 sta <$2A,y + clrb + rts +L119C cmpa #$26 + beq L118B + cmpa #$27 + beq L1192 + cmpa #$30 + beq L11AD + cmpa #$31 + beq L11E1 + rts +L11AD pshs y + ldd ,y + std <$009D + ldb $02,y + lbsr L1252 + std <$0097 + clra + ldb <$0063 + nega + negb + sbca #$00 + std <$0099 + ldb -$08,y + decb + lda <$0071 + mul + tfr b,a + deca + subb $01,y + cmpb <$0071 + bcs L1184 + stb <$009B + ldb <$0063 + mul + addd -$0D,y + tfr d,x + addd $04,y + tfr d,y + bra L1175 +L11E1 pshs y + ldb $02,y + bsr L1252 + std <$0097 + clra + ldb <$0063 + std <$0099 + lda -$08,y + deca + tst <$0060 + bmi L11F8 + lsla + lsla + lsla +L11F8 suba $01,y + bhi L1202 + puls y + ldd ,y + bra L1188 +L1202 sta <$009B + ldd <$1D,y + subd <$0070 + addd <$00B3 + std <$009D + lda <$0063 + ldb $01,y + mul + addd -$0D,y + tfr d,x + ldd $04,y + tfr x,y + leax d,x + lbra L1175 +L121F pshs u,y,x,dp,cc + pshs a + tstb + beq L122D +L1226 lda ,x+ + sta ,y+ + decb + bne L1226 +L122D puls b + tstb + beq L1250 + orcc #$50 + stb >$1006 + sts >$1003 + tfr x,u + tfr y,s + leas $07,s +L1241 pulu y,x,dp,b,a + pshs y,x,dp,b,a + leas $0E,s + dec >$1006 + bne L1241 + lds >$1003 +L1250 puls pc,u,y,x,dp,cc +L1252 tfr b,a + lsra + lsra + lsra + andb #$07 + pshs a + addb ,s+ +L125D cmpb #$07 + blt L1266 + subb #$07 + inca + bra L125D +L1266 rts +L1267 cmpa #$03 + beq L1278 + cmpa #$04 + beq L1285 + cmpa #$0B + beq L12B4 + cmpa #$0C + beq L129C + rts +L1278 ldd ,y +L127A std <$0049 + clra + clrb + std <$0047 + ldd <$1B,y + bra L1292 +L1285 ldd -$02,y + std <$0047 + ldd ,y + std <$0049 + ldd <$1B,y + subd -$02,y +L1292 addd <$00B3 + std <$004F + ldd <$0070 + std <$0051 + bra L12C8 +L129C lbsr L10A7 + clra + clrb + std <$0047 + bsr L12A7 + bra L12C4 +L12A7 std <$0049 + ldd <$1B,y + addd <$00B3 + std <$004F + ldd <$1D,y + rts +L12B4 bsr L1285 + clra + clrb + std <$0047 + ldd ,y + addd <$0070 + bsr L12A7 + subd <$0049 + bmi L12CE +L12C4 addd <$00B3 + std <$0051 +L12C8 ldb <$0060 + bmi L12CF + bsr L12FA +L12CE rts +L12CF pshs y + lbsr L1E48 + lda #$20 + ldb $08,y + andb #$38 + orb <$0062 + std <$0097 + ldb <$0063 + subb <$0050 + subb <$0050 + stb <$0099 +L12E6 ldy <$004F + ldd <$0097 +L12EB std ,x++ + leay -$01,y + bne L12EB + ldb <$0099 + abx + dec <$0052 + bne L12E6 + puls pc,y +L12FA ldb <$0060 + ldx #$4C78 + lda <$0048 + coma + anda b,x + inca + sta <$0097 + ldx #$4C7C + ldb b,x + abx + lsla + lda a,x + sta <$0012 + clra + ldb <$0060 + tfr d,x + ldd <$004F + subb <$0097 + sbca #$00 + lsra + rorb + cmpx #$0004 + beq L132C + lsra + rorb + cmpx <$00B3 + bne L132C + lsra + rorb +L132C stb <$0097 + ldb <$0063 + subb <$0097 + subb #$01 + stb <$0099 + lbsr L1E48 + lda <$0012 + inca + beq L1360 +L133E lda <$0012 + tfr a,b + coma + anda ,x + sta ,x + andb <$0062 + orb ,x + stb ,x+ + lda <$0097 + beq L1358 + ldb <$0062 +L1353 stb ,x+ + deca + bne L1353 +L1358 ldb <$0099 + abx + dec <$0052 + bne L133E + rts +L1360 pshs u + lda <$0062 + tfr a,b + tfr d,u + ldb <$0097 + incb + clr <$0097 + lsrb + stb <$0012 + bcc L1374 + inc <$0097 +L1374 ldb <$0097 + beq L137A + sta ,x+ +L137A ldb <$0012 + beq L1383 +L137E stu ,x++ + decb + bne L137E +L1383 ldb <$0099 + abx + dec <$0052 + bne L1374 + puls pc,u + lbsr L1063 + bsr L1393 + clrb + rts +L1393 cmpa #$21 + beq L13C9 + cmpa #$22 + beq L13D3 + cmpa #$23 + beq L13DB + cmpa #$24 + beq L13E4 + cmpa #$25 + beq L13EA + cmpa #$20 + lbne L119C + ldb $09,y + bitb #$04 + bne L13C8 + orb #$04 +L13B5 stb $09,y + lda $08,y + lbsr L14B4 + pshs b,a + ldb $08,y + andb #$C0 + orb ,s+ + orb ,s+ + stb $08,y +L13C8 rts +L13C9 ldb $09,y + bitb #$04 + beq L13C8 + andb #$FB + bra L13B5 +L13D3 ldd $08,y + ora #$40 + orb #$40 + bra L13E1 +L13DB ldd $08,y + anda #$BF + andb #$BF +L13E1 std $08,y + rts +L13E4 ldb $08,y + orb #$80 + bra L13EE +L13EA ldb $08,y + andb #$7F +L13EE stb $08,y + rts + lbsr L0107 + bsr L1454 + lbsr L14C1 +L13F9 clrb + rts +L13FB pshs y,x,b,a + bsr L146D + lbsr L14E3 + ldb >$1000 + stb >$1001 + puls pc,y,x,b,a + lbsr L0107 + cmpy <$002E + bne L1428 + ldd <$005B + cmpd <$003D + bne L1420 + ldd <$005D + cmpd <$003F + beq L1428 +L1420 lbsr L14E3 + bsr L142A + lbsr L14C1 +L1428 bra L13F9 +L142A ldd <$0047 + pshs b,a + ldd <$0049 + pshs b,a + ldd <$005B + std <$0047 + std <$003D + ldd <$005D + std <$0049 + std <$003F + ldx -$10,y + ldd $02,x + lbsr L1E4A + stx <$0041 + stb <$0043 + puls b,a + std <$0049 + puls b,a + std <$0047 + rts +L1452 bsr L147E +L1454 lbsr L0F31 + cmpy <$002E + bne L146A + ldb $09,y + bitb #$02 + bne L146A + ldb <$0039 + bne L146A + bsr L148E + inc <$0039 +L146A rts +L146B bsr L147E +L146D lbsr L0F31 + cmpy <$002E + bne L147D + ldb <$0039 + beq L147D + bsr L148E + clr <$0039 +L147D rts +L147E eora #$21 + ldb #$02 + lbra L034E +L1485 cmpa #$20 + beq L146B + cmpa #$21 + beq L1452 + rts +L148E pshs y + ldx -$05,y + ldb <$0060 + bpl L14A8 + lda $01,x + bsr L14B4 + pshs b,a + ldb $01,x + andb #$C0 + orb ,s+ + orb ,s+ + stb $01,x + bra L14B2 +L14A8 ldx #$5026 + stx <$00A9 + clr <$000E + lbsr L0F9A +L14B2 puls pc,y +L14B4 tfr a,b + anda #$38 + lsra + lsra + lsra + andb #$07 + lslb + lslb + lslb + rts +L14C1 pshs y,x + ldx -$10,y + cmpx <$0030 + bne L14E1 + ldb <$003A + bne L14E1 + ldb <$18,y + stb <$0044 + beq L14E1 + jsr <$00BC + ldy <$19,y + sty <$0045 + bsr L14FE + inc <$003A +L14E1 puls pc,y,x +L14E3 pshs y,x + ldx -$10,y + cmpx <$0030 + bne L14FC + ldb <$003A + beq L14FC + ldb <$0044 + beq L14E1 + jsr <$00BC + ldy <$0045 + bsr L14FE + clr <$003A +L14FC puls pc,y,x +L14FE ldb <$0060 + bmi L1535 + lda <$004A + ldx <$0047 + pshs x,a + ldd <$004F + ldx <$0051 + pshs x,b,a + ldd <$0064 + pshs b,a + ldd <$0041 + std <$0072 + ldb <$0043 + stb <$0074 + ldx #$5FA5 + stx <$0064 + lbsr L0D10 + lbsr L0D88 + puls b,a + std <$0064 + puls x,b,a + std <$004F + stx <$0051 + puls x,a + sta <$004A + stx <$0047 +L1535 rts + clr <$0047 + clr <$0049 + ldd -$05,y + subd -$0D,y +L153E cmpd $04,y + bcs L1549 + subd $04,y + inc <$0049 + bra L153E +L1549 lda [<-$10,y] + cmpa #$01 + beq L1556 + lsrb + cmpa #$04 + bne L1556 + lsrb +L1556 stb <$0048 + rts +L1559 tst ,y + bpl L1562 +L155D comb + ldb #$C0 + puls pc,x +L1562 lbsr L1DA2 + bcc L1569 + puls pc,x +L1569 jsr <$00B9 + lbra L1F65 + rts + bsr L1559 + lbsr L1E48 + lda <$0061 + lbsr L1F06 + bra L159B + bsr L1559 + lbsr L1DA9 + bcs L159C + ldd <$0049 + cmpd <$004D + bne L158D + bsr L159D + bra L159B +L158D ldd <$0047 + cmpd <$004B + bne L1598 + bsr L1607 + bra L159B +L1598 lbsr L1637 +L159B clrb +L159C rts +L159D bsr L15B6 +L159F ldd <$004B + subd <$0047 + addd <$00B3 + std <$0099 + bsr L15B0 + lda <$0061 + ldy <$0099 + bra L15C8 +L15B0 lbsr L1E9C + lbra L1E48 +L15B6 ldd <$004B + cmpd <$0047 + bge L15C3 +L15BD ldx <$0047 + std <$0047 + stx <$004B +L15C3 rts + lsl <$0004 + lsr <$0002 +L15C8 pshs u,y,x,b,a + sta $06,s + leax $00A1,u] + cmpd <$0020 + bra L1A46 + cmpd <$0020 + bra L1A40 + cmpx <$0022 +L1A40 ble L1A4E + bra L1A70 + cmpx <$0022 +L1A46 bge L1A4E + bra L1A70 + bsr L1A72 + bgt L1A70 +L1A4E addd <$0018 + bmi L1A70 + cmpd <$1B,y + bhi L1A70 + std <$0047 + tfr x,d + addd <$001A + bmi L1A70 + cmpd <$1D,y + bhi L1A70 + std <$0049 + lbsr L1E48 + lda <$0061 + lbsr L1F06 +L1A70 puls pc,x,b,a +L1A72 pshs x,b,a + tfr x,d + subd <$0026 + ldx <$0097 + bsr L1A90 + pshs x,b + ldd $03,s + subd <$0024 + ldx <$0099 + bsr L1A90 + cmpb ,s + bne L1A8C + cmpx $01,s +L1A8C leas $03,s + puls pc,x,b,a +L1A90 pshs x,b,a + lda $03,s + mul + pshs b,a + lda $05,s + ldb $02,s + mul + addb ,s+ + adca #$00 + pshs b,a + ldd $04,s + mul + addd ,s + std ,s + lda $05,s + ldb $03,s + mul + addb ,s + ldx $01,s + tst $03,s + bpl L1ABA + neg $06,s + addb $06,s +L1ABA tst $05,s + bpl L1AC2 + neg $04,s + addb $04,s +L1AC2 leas $07,s + rts +L1AC5 clr ,x + clr $01,x + clr $02,x + std $03,x + rts +L1ACE pshs b,a + ldd ,y + std ,x + ldd $02,y + std $02,x + ldb $04,y + stb $04,x + puls pc,b,a +L1ADE exg y,u + exg x,y + bsr L1ACE + exg x,y + exg y,u + rts +L1AE9 exg x,u + bsr L1ACE + exg x,u + rts +L1AF0 pshs b,a + addd $03,x + std $03,x + ldd #$0000 + adcb $02,x + adca $01,x + std $01,x + ldb #$00 + adcb ,x + stb ,x + puls pc,b,a +L1B07 pshs b,a + ldd $03,x + addd $03,y + std $03,x + ldd $01,x + adcb $02,y + adca $01,y + std $01,x + ldb ,x + adcb ,y + stb ,x + puls pc,b,a +L1B1F exg x,y + bsr L1B9D + exg x,y + bsr L1B07 + exg x,y + bsr L1B9D + exg x,y + rts +L1B2E pshs y,b,a + clra + clrb + pshs b,a + pshs b + tfr s,y + bsr L1B40 + leas $03,s + puls pc,y,b,a +L1B3E bsr L1AC5 +L1B40 pshs u,y,b,a + leas -$0A,s + tfr s,u + bsr L1AE9 + tfr u,y + leau $05,u + bsr L1ADE + clra + clrb + lbsr L1AC5 + bra L1B57 +L1B55 bsr L1B74 +L1B57 bsr L1B7F + beq L1B61 + bcc L1B55 + bsr L1B07 + bra L1B55 +L1B61 bcc L1B65 + bsr L1B07 +L1B65 leas $0A,s + puls pc,u,y,b,a +L1B69 lsl $04,x + rol $03,x + rol $02,x + rol $01,x + rol ,x + rts +L1B74 lsl $04,y + rol $03,y + rol $02,y + rol $01,y + rol ,y + rts +L1B7F lsr ,u + bne L1B92 + ror $01,u + bne L1B94 + ror $02,u + bne L1B96 + ror $03,u + bne L1B98 + ror $04,u + rts +L1B92 ror $01,u +L1B94 ror $02,u +L1B96 ror $03,u +L1B98 ror $04,u + andcc #$FB + rts +L1B9D com ,x + com $01,x + com $02,x + com $03,x + com $04,x + inc $04,x + bne L1BB9 + inc $03,x + bne L1BB9 + inc $02,x + bne L1BB9 + inc $01,x + bne L1BB9 + inc ,x +L1BB9 rts +L1BBA pshs b,a + ldd ,x + cmpd ,y + bne L1BD9 + ldd $02,x + cmpd $02,y + bne L1BD0 + ldb $04,x + cmpb $04,y + beq L1BD9 +L1BD0 bhi L1BD6 + lda #$08 + bra L1BD7 +L1BD6 clra +L1BD7 tfr a,cc +L1BD9 puls pc,b,a + ldd <$0018 + addd <$001C + cmpd <$1B,y + bls L1BE8 + ldd <$1B,y +L1BE8 pshs y,b,a + std <$004B + ldd <$0018 + subd <$001C + bpl L1BF4 + clra + clrb +L1BF4 pshs b,a + std <$0047 + ldd <$001A + subd <$001E + bpl L1C00 + clra + clrb +L1C00 bsr L1C15 + puls y,x,b,a + std <$0047 + stx <$004B + ldd <$001A + addd <$001E + cmpd <$1D,y + bls L1C15 + ldd <$1D,y +L1C15 std <$0049 + std <$004D + lbra L159F + lbsr L1559 + ldb #$01 + stb <$002A + lbsr L1E48 + stx <$0072 + stb <$0074 + lbsr L1EF6 + sta <$0028 + lbsr L06AC + cmpb $06,y + beq L1C67 + clrb + pshs b + lbsr L1E9C + lbsr L1EC8 + ldx <$0072 + bra L1C76 +L1C43 tst >$101B + beq L1C6C + ldb ,s+ + beq L1C67 + stb <$002B + addb ,s+ + cmpb <$1E,y + bhi L1C72 + stb <$004A + puls b,a + std <$0047 + puls b,a + std <$004B + lbsr L1E48 + stb <$0074 + lbra L1CEE +L1C67 clrb + ldb <$002A + bne L1C6F +L1C6C ldb #$BA + coma +L1C6F lbra L00F4 +L1C72 leas $04,s + bra L1C43 +L1C76 ldb <$0074 +L1C78 lbsr L1EDF + bsr L1CC4 + beq L1C84 + lbsr L1EF6 + beq L1C78 +L1C84 lbsr L1EB3 + pshs b + ldd <$0047 + std <$009B + puls b +L1C8F bsr L1CD6 + bsr L1CCC + bhi L1C9A + lbsr L1EF6 + beq L1C8F +L1C9A lbsr L1EDF + lbsr L1D9A + beq L1CA8 + bsr L1CB5 + lda #$FF + pshs b,a +L1CA8 lbsr L1D9A + beq L1C43 + bsr L1CB5 + lda #$01 + pshs b,a +L1CB3 bra L1C43 +L1CB5 puls b,a + pshs y,x,b,a + ldd <$0047 + std $04,s + ldd <$009B + std $02,s + ldb <$004A + rts +L1CC4 pshs b,a + ldd <$0047 + addd <$00B3 + puls pc,b,a +L1CCC pshs b,a + ldd <$0047 + cmpd <$1B,y + puls pc,b,a +L1CD6 lda ,x + sta ,-s + lda <$0061 + lbsr L1F06 + lda ,x + cmpa ,s+ + beq L1CEA + lda #$FF + sta >$101B +L1CEA lbsr L1EB3 + rts +L1CEE ldd <$0047 + subd #$0002 + std <$009B + ldb <$0074 +L1CF7 lbsr L1EF6 + bne L1D03 + lbsr L1EDF + bsr L1CC4 + bne L1CF7 +L1D03 lbsr L1EB3 + stb <$0074 + ldd <$0047 + cmpd <$004B + bhi L1CB3 + ldb <$0074 + lbsr L1EF6 + bne L1D03 + ldd <$0047 + cmpd <$009B + bgt L1D34 + bsr L1D9A + beq L1D34 + ldd <$009B + pshs b,a + ldd <$0047 + bpl L1D2B + clra + clrb +L1D2B pshs b,a + ldb <$004A + lda <$002B + nega + pshs b,a +L1D34 ldd <$0047 + std <$009B + ldb <$0074 +L1D3A lbsr L1EF6 + bne L1D45 + bsr L1CD6 + bsr L1CCC + bls L1D3A +L1D45 lbsr L1EDF + stb <$0074 + bsr L1D9A + beq L1D57 + lbsr L1CB5 + lda <$002B + pshs b,a + ldb <$0074 +L1D57 lbsr L1EB3 + stb <$0074 + lbsr L1CCC + bgt L1D71 + ldd <$0047 + cmpd <$004B + bgt L1D71 + ldb <$0074 + lbsr L1EF6 + bne L1D57 + bra L1D34 +L1D71 cmps <$003B + bhi L1D78 + clr <$002A +L1D78 ldd <$0047 + subd <$00B3 + std <$0047 + ldd <$004B + addd #$0002 + cmpd <$0047 + bhi L1D97 + leas -$02,s + pshs b,a + ldd <$0047 + std $02,s + ldb <$004A + lda <$002B + nega + pshs b,a +L1D97 lbra L1C43 +L1D9A cmps <$003B + bhi L1DA1 + clr <$002A +L1DA1 rts +L1DA2 ldb #$47 +L1DA4 bsr L1DD8 + lbra L1E31 +L1DA9 ldb #$4B + bra L1DA4 +L1DAD ldb #$4F + bra L1DA4 +L1DB1 ldb #$20 +L1DB3 bsr L1DD8 + ldd #$027F + bsr L1DBF + bcs L1DCF + ldd #$00BF +L1DBF pshs b,a + ldd ,x++ + bpl L1DC9 + nega + negb + sbca #$00 +L1DC9 cmpd ,s++ + bgt L1E44 + clrb +L1DCF rts +L1DD0 ldb #$24 + bra L1DB3 +L1DD4 ldb #$53 + bra L1DB3 +L1DD8 tfr u,x + abx + lda $09,y + bita #$08 + beq L1DE5 + ldd -$07,y + bne L1DE6 +L1DE5 rts +L1DE6 pshs y,x,b,a + tfr x,y + ldx ,y + ldb ,s + beq L1DF4 + bsr L1E00 + std ,y +L1DF4 ldx $02,y + ldb $01,s + beq L1DFE + bsr L1E00 + std $02,y +L1DFE puls pc,y,x,b,a +L1E00 pshs x,b + leas -$02,s + lda $04,s + mul + cmpb #$CD + pshs cc + exg a,b + clra + puls cc + bcs L1E14 + addd <$00B3 +L1E14 std ,s + lda $03,s + ldb $02,s + mul + addd ,s + leas $03,s + puls pc,x +L1E21 pshs x + lda ,s + stb ,s + mul + stb ,-s + ldd $01,s + mul + adda ,s+ + puls pc,x +L1E31 ldd ,x + cmpd <$1B,y + bhi L1E44 + ldd $02,x + cmpd <$1D,y + bhi L1E44 + andcc #$FE + rts +L1E44 comb + ldb #$BD + rts +L1E48 ldd -$0D,y +L1E4A pshs y,b,a + lda <$004A + ldb <$0063 + mul + addd ,s++ + tfr d,x + ldb <$0060 + bpl L1E60 + ldd <$0047 + lslb + leax d,x + puls pc,y +L1E60 cmpb #$04 + bne L1E6B + ldd <$0047 + leay $160C + lsla + bne L1EB9 + inc <$0047 +L1EB9 lsrb + bcs L1EC3 + jmp [<$77,u] + lsrb + lsrb + lsrb + rts +L1EC3 ldb <$0079 + leax $01,x + rts +L1EC8 lda <$0060 + leax -$2000,x + bra L1F2E +L1F3A sta <$008A + sta >$FFA9 + ldb ,x + puls a + sta <$008A + sta >$FFA9 + andb ,s+ + ldx ,s++ + lda ,s + pshs b + anda ,s+ + jmp [<$68,u] +L1F55 ldx <$0066 + lda <$00AF + ldb <$00B2 + anda <$004A + mul + leax d,x + ldd <$0047 + lsra + rorb + rts +L1F65 ldb $0E,y + beq L1F82 + stb <$00B1 + jsr <$00BC + ldx $0F,y + stx <$0066 + ldd <-$16,x + deca + bpl L1F79 + lda #$FF +L1F79 stb <$00B2 + decb + bpl L1F80 + ldb #$FF +L1F80 std <$00AF +L1F82 rts +L1F83 anda $01,s + jmp [<$68,u] + ldb $01,s + bra L1F9A + anda <$0061 + ldb ,s + andb $01,s + bra L1F9A + eora ,x + bra L1FA1 + anda ,x +L1F9A comb + andb ,x + stb ,x + ora ,x +L1FA1 sta ,x + puls pc,b,a + anda $01,s + eora ,x + sta ,x + puls pc,b,a + + emod +eom equ * + endc diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/ident.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/ident.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,1140 @@ +******************************************************************** +* Ident - Show module information +* +* $Id: ident.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 7 Original Tandy/Microware version + + nam Ident + ttl Show module information + +* Disassembled 98/09/20 15:54:44 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 7 + + mod eom,name,tylg,atrv,start,size +u0000 rmb 1 +u0001 rmb 1 +u0002 rmb 1 +u0003 rmb 1 +u0004 rmb 2 +u0006 rmb 2 +u0008 rmb 2 +u000A rmb 1 +u000B rmb 1 +u000C rmb 1 +u000D rmb 1 +u000E rmb 2 +u0010 rmb 2 +u0012 rmb 1 +u0013 rmb 1 +u0014 rmb 1 +u0015 rmb 1 +u0016 rmb 1 +u0017 rmb 1 +u0018 rmb 1 +u0019 rmb 1 +u001A rmb 1 +u001B rmb 1 +u001C rmb 2 +u001E rmb 2 +u0020 rmb 2 +u0022 rmb 66 +u0064 rmb 14 +u0072 rmb 14 +u0080 rmb 33 +u00A1 rmb 71 +u00E8 rmb 180 +u019C rmb 2048 +size equ . + +name fcs /Ident/ + fcb edition + +L0013 fcb $0A + fcb $55 U + fcb $73 s + fcb $65 e + fcb $3A : + fcb $20 + fcb $49 I + fcb $64 d + fcb $65 e + fcb $6E n + fcb $74 t + fcb $20 + fcb $5B [ + fcb $2D - + fcb $6F o + fcb $70 p + fcb $74 t + fcb $73 s + fcb $5D ] + fcb $20 + fcb $3C < + fcb $6D m + fcb $6F o + fcb $64 d + fcb $75 u + fcb $6C l + fcb $65 e + fcb $3E > + fcb $20 + fcb $5B [ + fcb $2D - + fcb $6F o + fcb $70 p + fcb $74 t + fcb $73 s + fcb $5D ] + fcb $0A + fcb $20 + fcb $20 + fcb $74 t + fcb $6F o + fcb $20 + fcb $64 d + fcb $69 i + fcb $73 s + fcb $70 p + fcb $6C l + fcb $61 a + fcb $79 y + fcb $20 + fcb $6D m + fcb $6F o + fcb $64 d + fcb $75 u + fcb $6C l + fcb $65 e + fcb $20 + fcb $68 h + fcb $65 e + fcb $61 a + fcb $64 d + fcb $65 e + fcb $72 r + fcb $2E . + fcb $0A + fcb $20 + fcb $20 + fcb $2D - + fcb $6D m + fcb $20 + fcb $74 t + fcb $6F o + fcb $20 + fcb $64 d + fcb $69 i + fcb $73 s + fcb $70 p + fcb $6C l + fcb $61 a + fcb $79 y + fcb $20 + fcb $6D m + fcb $6F o + fcb $64 d + fcb $75 u + fcb $6C l + fcb $65 e + fcb $20 + fcb $69 i + fcb $6E n + fcb $20 + fcb $6D m + fcb $65 e + fcb $6D m + fcb $6F o + fcb $72 r + fcb $79 y + fcb $2E . + fcb $0A + fcb $20 + fcb $20 + fcb $2D - + fcb $73 s + fcb $20 + fcb $66 f + fcb $6F o + fcb $72 r + fcb $20 + fcb $73 s + fcb $68 h + fcb $6F o + fcb $72 r + fcb $74 t + fcb $20 + fcb $66 f + fcb $6F o + fcb $72 r + fcb $6D m + fcb $2E . + fcb $0A + fcb $20 + fcb $20 + fcb $2D - + fcb $76 v + fcb $20 + fcb $66 f + fcb $6F o + fcb $72 r + fcb $20 + fcb $6E n + fcb $6F o + fcb $20 + fcb $43 C + fcb $52 R + fcb $43 C + fcb $20 + fcb $76 v + fcb $65 e + fcb $72 r + fcb $69 i + fcb $66 f + fcb $69 i + fcb $63 c + fcb $61 a + fcb $74 t + fcb $69 i + fcb $6F o + fcb $6E n + fcb $0A + fcb $20 + fcb $20 + fcb $2D - + fcb $78 x + fcb $20 + fcb $66 f + fcb $6F o + fcb $72 r + fcb $20 + fcb $66 f + fcb $69 i + fcb $6C l + fcb $65 e + fcb $20 + fcb $69 i + fcb $6E n + fcb $20 + fcb $65 e + fcb $78 x + fcb $65 e + fcb $63 c + fcb $75 u + fcb $74 t + fcb $69 i + fcb $6F o + fcb $6E n + fcb $20 + fcb $64 d + fcb $69 i + fcb $72 r + fcb $65 e + fcb $63 c + fcb $74 t + fcb $6F o + fcb $72 r + fcb $79 y + fcb $0D +L00CD fcb $4D M + fcb $6F o + fcb $64 d + fcb $75 u + fcb $6C l + fcb $65 e + fcb $20 + fcb $68 h + fcb $65 e + fcb $61 a + fcb $64 d + fcb $65 e + fcb $72 r + fcb $20 + fcb $69 i + fcb $73 s + fcb $20 + fcb $69 i + fcb $6E n + fcb $63 c + fcb $6F o + fcb $72 r + fcb $72 r + fcb $65 e + fcb $63 c + fcb $74 t + fcb $A1 ! +L00E8 fcb $48 H + fcb $65 e + fcb $61 a + fcb $64 d + fcb $65 e + fcb $72 r + fcb $20 + fcb $66 f + fcb $6F o + fcb $72 r + fcb $3A : + fcb $A0 +L00F4 fcb $4D M + fcb $6F o + fcb $64 d + fcb $75 u + fcb $6C l + fcb $65 e + fcb $20 + fcb $73 s + fcb $69 i + fcb $7A z + fcb $65 e + fcb $BA : +L0100 fcb $4D M + fcb $6F o + fcb $64 d + fcb $75 u + fcb $6C l + fcb $65 e + fcb $20 + fcb $43 C + fcb $52 R + fcb $43 C + fcb $3A : + fcb $A0 +L010C fcb $48 H + fcb $64 d + fcb $72 r + fcb $20 + fcb $70 p + fcb $61 a + fcb $72 r + fcb $69 i + fcb $74 t + fcb $79 y + fcb $3A : + fcb $A0 +L0118 fcb $45 E + fcb $78 x + fcb $65 e + fcb $63 c + fcb $2E . + fcb $20 + fcb $6F o + fcb $66 f + fcb $66 f + fcb $3A : + fcb $20 + fcb $A0 +L0124 fcb $44 D + fcb $61 a + fcb $74 t + fcb $61 a + fcb $20 + fcb $53 S + fcb $69 i + fcb $7A z + fcb $65 e + fcb $3A : + fcb $20 + fcb $A0 +L0130 fcb $54 T + fcb $79 y + fcb $2F / + fcb $4C L + fcb $61 a + fcb $20 + fcb $41 A + fcb $74 t + fcb $2F / + fcb $52 R + fcb $76 v + fcb $BA : +L013C fcb $45 E + fcb $64 d + fcb $69 i + fcb $74 t + fcb $69 i + fcb $6F o + fcb $6E n + fcb $3A : + fcb $20 + fcb $20 + fcb $20 + fcb $A0 +L0148 fcb $6D m + fcb $6F o + fcb $64 d + fcb $AC , +L014C fcb $72 r + fcb $65 e + fcb $2D - + fcb $65 e + fcb $6E n + fcb $AC , +L0152 fcb $6E n + fcb $6F o + fcb $6E n + fcb $2D - + fcb $73 s + fcb $68 h + fcb $72 r + fcb $AC , +L015A fcb $52 R + fcb $2F / + fcb $CF O +L015D fcb $52 R + fcb $2F / + fcb $D7 W +L0160 fcb $28 ( + fcb $47 G + fcb $6F o + fcb $6F o + fcb $64 d + fcb $A9 ) +L0166 fcb $28 ( + fcb $42 B + fcb $61 a + fcb $64 d + fcb $29 ) + fcb $87 +L016C fcb $10 + fcb $1C + fcb $20 + fcb $24 $ + fcb $29 ) + fcb $2D - + fcb $32 2 + fcb $37 7 + fcb $3C < + fcb $41 A + fcb $46 F + fcb $4B K + fcb $50 P + fcb $56 V + fcb $5E ^ + fcb $65 e + fcb $62 b + fcb $61 a + fcb $64 d + fcb $20 + fcb $74 t + fcb $79 y + fcb $70 p + fcb $65 e + fcb $20 + fcb $66 f + fcb $6F o + fcb $F2 r + fcb $50 P + fcb $72 r + fcb $6F o + fcb $E7 g + fcb $53 S + fcb $75 u + fcb $62 b + fcb $F2 r + fcb $4D M + fcb $75 u + fcb $6C l + fcb $74 t + fcb $E9 i + fcb $44 D + fcb $61 a + fcb $74 t + fcb $E1 a + fcb $55 U + fcb $73 s + fcb $72 r + fcb $20 + fcb $B5 5 + fcb $55 U + fcb $73 s + fcb $72 r + fcb $20 + fcb $B6 6 + fcb $55 U + fcb $73 s + fcb $72 r + fcb $20 + fcb $B7 7 + fcb $55 U + fcb $73 s + fcb $72 r + fcb $20 + fcb $B8 8 + fcb $55 U + fcb $73 s + fcb $72 r + fcb $20 + fcb $B9 9 + fcb $55 U + fcb $73 s + fcb $72 r + fcb $20 + fcb $C1 A + fcb $55 U + fcb $73 s + fcb $72 r + fcb $20 + fcb $C2 B + fcb $53 S + fcb $79 y + fcb $73 s + fcb $74 t + fcb $65 e + fcb $ED m + fcb $46 F + fcb $69 i + fcb $6C l + fcb $65 e + fcb $20 + fcb $4D M + fcb $61 a + fcb $EE n + fcb $44 D + fcb $65 e + fcb $76 v + fcb $20 + fcb $44 D + fcb $76 v + fcb $F2 r + fcb $44 D + fcb $65 e + fcb $76 v + fcb $20 + fcb $44 D + fcb $73 s + fcb $E3 c +L01D8 fcb $10 + fcb $15 + fcb $1E + fcb $2D - + fcb $3B ; + fcb $44 D + fcb $51 Q + fcb $60 ` + fcb $60 ` + fcb $60 ` + fcb $60 ` + fcb $60 ` + fcb $60 ` + fcb $60 ` + fcb $60 ` + fcb $60 ` + fcb $44 D + fcb $61 a + fcb $74 t + fcb $61 a + fcb $AC , + fcb $36 6 + fcb $38 8 + fcb $30 0 + fcb $39 9 + fcb $20 + fcb $6F o + fcb $62 b + fcb $6A j + fcb $AC , + fcb $42 B + fcb $41 A + fcb $53 S + fcb $49 I + fcb $43 C + fcb $30 0 + fcb $39 9 + fcb $20 + fcb $49 I + fcb $2D - + fcb $63 c + fcb $6F o + fcb $64 d + fcb $65 e + fcb $AC , + fcb $50 P + fcb $41 A + fcb $53 S + fcb $43 C + fcb $41 A + fcb $4C L + fcb $20 + fcb $50 P + fcb $2D - + fcb $63 c + fcb $6F o + fcb $64 d + fcb $65 e + fcb $AC , + fcb $43 C + fcb $20 + fcb $49 I + fcb $2D - + fcb $63 c + fcb $6F o + fcb $64 d + fcb $65 e + fcb $AC , + fcb $43 C + fcb $4F O + fcb $42 B + fcb $4F O + fcb $4C L + fcb $20 + fcb $49 I + fcb $2D - + fcb $63 c + fcb $6F o + fcb $64 d + fcb $65 e + fcb $AC , + fcb $46 F + fcb $4F O + fcb $52 R + fcb $54 T + fcb $52 R + fcb $41 A + fcb $4E N + fcb $20 + fcb $49 I + fcb $2D - + fcb $63 c + fcb $6F o + fcb $64 d + fcb $65 e + fcb $AC , + fcb $3F ? + fcb $3F ? + fcb $3F ? + fcb $3F ? + fcb $AC , +start equ * + leas >u019C,u + sts L00CD,pcr + lbsr L05FC + lbsr L0612 + clrb + lbra L03D2 +L02EB ldd u0002,u + subd #$0003 + leax d,u + puls u + leay u0080,u + ldy #$0021 + lda L0013,pcr + ldy #$00BA + os9 I$WritLn + clrb +L03D2 os9 F$Exit +L03D5 tst L00E8,pcr + lbsr L05FC + lbsr L04E9 + lbsr L0612 + leay >L00F4,pcr + lbsr L05FC + ldy L0100,pcr + lbsr L05FC + lbsr L0543 + tst L0166,pcr + lbsr L05FC + bra L041E +L0417 leay >L0160,pcr + lbsr L05FC +L041E lbsr L0612 + leay >L010C,pcr + lbsr L05FC + ldy L0118,pcr + lbsr L05FC + ldy L0124,pcr + lbsr L05FC + ldy L013C,pcr + lbsr L05FC + ldb L0130,pcr + lbsr L05FC + ldb L016C,pcr + lda b,x + leay a,x + lbsr L05FC + leay >L0148,pcr + lbsr L05FC + ldb L01D8,pcr + lda b,x + leay a,x + lbsr L05FC + ldb L014C,pcr + lbsr L05FC + bra L04D4 +L04CD leay >L0152,pcr + lbsr L05FC +L04D4 bitb #$40 + beq L04DE + leay >L015D,pcr + bra L04E2 +L04DE leay >L015A,pcr +L04E2 lbsr L05FC + lbsr L0612 + rts +L04E9 tst u0080,u +L04FA lbsr L05FC + lda ,y + sta crtn,pcr start with \n + ldy #$0001 + os9 I$WritLn + bcs errexit + leax >z0012,pcr "Polling Table at: " etc + ldy #z0012L num chars to write + os9 I$Write + bcs errexit + lda #$01 + leax buffer2,u $0372,u + os9 F$GPrDsc get $200 byte copy of process 1 + bcs errexit +* F$GPrDsc returns $200 bytes, why inc only $40? + leax P$DatImg,x 40,x to next ptr area=$03B2,u + stx Device,pcr + ldy #DeviceL + lda #1 + os9 I$Write + ldu crtn,pcr stick another \n on it + ldy #$0001 + os9 I$WritLn + bcs errexit + leax >Topline,pcr " Device Driver IRQ Flip " + ldy #ToplineL + os9 I$WritLn + bcs errexit + leax >Line2,pcr "Port Mem Name Vector &Mask Pty" + ldy #Line2L + os9 I$WritLn + bcs errexit + leax >Line3,pcr "---- ---- ------------ ----- ---" + ldy #Line3L + os9 I$WritLn + lbcs errexit + ldu ascii + ldd $06,x + lbsr z023B convert 2 bytes memsiz->ascii + lbsr z0243 extra space in line + bsr z01CA now do name + ldu u010D,u + pshs y,x + leax u01DD,u + sty u018D,u + sty L0155,pcr + os9 I$ChgDir + lda #$01 + leax >L0013,pcr + os9 I$Open + lbcs L02F4 + sta L0063,pcr + ldy #$001F + bra L01E9 +L01E1 leax >L002F,pcr + ldy #$0034 +L01E9 lbsr L032F +L01EC dec L010D,pcr + lbmi L031F + leax >u018D,u + stx L0082,pcr + ldy #$000D + lbsr L0347 + bcs L020E +L0209 lbsr L0393 + bcc L0217 +L020E leax >L008F,pcr +L0212 lbsr L0325 + bra L01EC +L0217 lbsr L03B9 + bcc L0253 + ldx L0094,pcr + ldy #$000A + lbsr L0347 + lbsr L037F + bcs L020E + lbsr L03B9 + bcc L0253 +L0242 leax >u018D,u + stx L009E,pcr + bra L0212 +L0253 lda L014C,pcr + os9 I$Open + bcc L0280 + clra +L0280 sta L00B0,pcr + ldy #$000A + lbsr L033D + leax u0004,u + lbsr L0471 + tst L00C5,pcr + ldy #$000C + bra L02B0 +L02A8 leax >L00BA,pcr + ldy #$000B +L02B0 bsr L032F + leax >L00D1,pcr + bsr L0325 + lbsr L03F0 + clrb + ldx L00DA,pcr + bra L031F +L031B leax >L00EF,pcr +L031F bsr L0325 + clrb + os9 F$Exit +L0325 ldy #$0100 + lda #$01 + os9 I$WritLn + rts +L032F bsr L033D + lbsr L0498 + lbsr L0498 + lbsr L0498 + lbra L0454 +L033D lda ,x+ + lbsr L049A + leay -$01,y + bne L033D + rts +L0347 bsr L033D + lbsr L04AC + ldx u022D,u + ldb #$00 + clra + os9 I$GetStt + bcs L0379 + lda ,x + cmpa #$00 + bne L0379 + lda $04,x + pshs a + clr $04,x + bsr L037F + puls a + sta $04,x + puls pc,x,b,a +L0379 lda #$FF + sta ,x + puls pc,x,b,a +L037F pshs x,b,a,cc + leax >u022D,u + lda ,x + cmpa #$00 + bne L0391 + ldb #$00 + clra + os9 I$SetStt +L0391 puls pc,x,b,a,cc +L0393 pshs u + lda u010D,u + ldy #$0080 + os9 I$ReadLn + bcs L03B8 + stx u018D,u + ldy #$0050 + os9 I$ReadLn + bcc L03ED + lda u01DD,u + ldd u1062,u +L00D4 clr ,-u + cmpu ,s + bhi L00D4 + puls u + clr L0012,pcr + lbsr L0298 + leax u0005,u + os9 F$Time + leax u0008,u + lbsr L02B8 + lbsr L02A3 + leax L0088,pcr + bra L014D +L0149 leay >L0029,pcr +L014D lbsr L0298 + lbsr L02A3 + tst L00A7,pcr + bra L0161 +L015D leay >L0058,pcr +L0161 lbsr L0298 + lbsr L02A3 + leax u10A2,u + ldd $02,y + bsr L0244 + tst L00CC,pcr + bra L021F +L021B leay >L00C7,pcr +L021F bsr L0298 + bra L0230 +L0223 tst u1062,u + bsr L0298 + bsr L02A3 +L0238 leax $08,x +L023A cmpx u10A2,u + os9 F$CpyMem + pshs b,a + ldd u0004,u + leax d,x + puls b,a + ldu $02,s + leau >u1062,u + ldy #$0040 + os9 F$CpyMem + tfr u,y + puls pc,u,x +L0308 ldd ,x + beq L0319 + pshs y + leay L004E,pcr + bsr L0183 + bsr L016E + bsr L0183 + tfr u,d + addd $0100,y + subd ,x + bcc L01B6 + addd ,x++ + pshs b,a + tfr y,d + tst ,x + bmi L01DE + ldy #$2F30 + cmpd #$3020 + bne L01D8 + ldy #$2F20 + lda #$20 +L01D8 bsr L0164 + puls b,a + bra L01B6 +L01DE bsr L0164 + lda #$6B + bsr L0164 + leas $02,s + puls pc,y,x,b,a + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/mmap.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/mmap.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,287 @@ +******************************************************************** +* MMap - Show memory block map +* +* $Id: mmap.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* From Kevin Darling, "Inside OS9 Level II" +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* ? Original verison KKD 88/??/?? +* 4 Modified by Ken Drexler fr various block sizes KD 89/07/30 + + nam MMap + ttl Memory Block Utility + + ifp1 + use defsfile + endc + +Revs set ReEnt+1 +Type set Prgrm+Objct +edition set 4 + + mod prglen,name,type,revs,MMap,datsiz + +Name fcs /MMap/ + fcb edition + +*************************************************** +* +* Data +* +buffsiz set 512 + +numflag rmb 1 flag for leading zeros +rowcnt rmb 1 no rows to print +free rmb 1 no free blocks +rowno rmb 1 row number +lcnt rmb 1 line length counter +outptr rmb 2 output pointer +out rmb 80 output buffer +mapsiz rmb 2 size of map block +blksiz rmb 2 block size +buffer rmb buffsiz map itself +stack rmb 200 +datsiz equ . + + pag +*************************************************** +* +* Messages +* +header fcc / 0 1 2 3 4 5 6 7 8 9 A B C D E F/ + fcb C$CR +hdrlen equ *-header + +hdr2 fcc / # = = = = = = = = = = = = = = = =/ + fcb C$CR +hdrlen2 equ *-hdr2 + +BlockMsg fcc / Block Size: / +blklen equ *-Blockmsg + +Freemsg fcc / Free Blocks: / +freelen equ *-Freemsg + +Rammsg fcc / KBytes Free: / +ramlen equ *-Rammsg + +********************************************** +* +MMap lbsr pcrtn print line + leax header,pcr print headers + lda #1 + ldy #hdrlen + os9 I$WritLn + leax hdr2,pcr + ldy #hdrlen2 + os9 I$WritLn + leax buffer,u get block map to read + os9 F$GBlkMp + lbcs error + std blksiz save block size + sty mapsiz save map size + clr free + clr rowno + ldd mapsiz compute number of rows + lsra at 16 per row + rorb + lsra + rorb + lsra + rorb + lsra + rorb + stb rowcnt save count + leax out,u + stx outptr + leax buffer,u point at map + pshs x + bra loop2 + +loop dec lcnt count -= 1 + bne loop3 if more, skip line print + +* print line, start next line +loop1 pshs x save map pointer + lbsr prline print line + dec rowcnt done? + beq exit yes +loop2 lda #16 set line length count + sta lcnt + lbsr Space 1 space + lda rowno print row number + lbsr Hex1 + inc rowno row number += 1 + lbsr space2 2 spaces + puls x + +* Print one block status +loop3 ldb ,x+ get next block + beq freeram + bmi noram + bitb #2 module? + bne module + lda #'U must be ram in use + bra put + +freeram lda #'_ not used + inc free count it + bra put + +module lda #'M module + bra put + +noram lda #'. not ram + +* Print character in A and space +put equ * + lbsr print put character in output buffer + lda #C$SPAC add space + lbsr print + + bra loop + +* Add summary messages +Exit equ * + leax BlockMsg,pcr print "Block Size" + ldy #blklen + lbsr Prstr + ldd blksiz + clr numflag suppress zeros + bsr outdec + lbsr prline print line + leax freemsg,pcr print "Free Blocks" + ldy #freelen + lbsr Prstr + ldb free get number of blocks + clra + clr numflag suppress zeros + bsr outdec print in decimal + bsr prline + leax rammsg,pcr print "Ram Free" + ldy #ramlen + lbsr Prstr + ldb free get number of blocks + lda blksiz get #k/block + lsra by dividing msb by 4 + lsra + mul + clr numflag suppress zeros + bsr outdec print in decimal + bsr prline + +bye clrb no errors + +error os9 F$Exit + + +********************************************** +* +* Subroutines +* +Pcrtn pshs a,x Output carriage return + lda #C$CR + sta out + leax out,u point at buffer + ldy #1 one char. + lda #1 + os9 I$WritLn + puls a,x,pc + + +** Decimal output routine +* IN: D - number to output +* X - destination buffer +* OUT: X,Y,U preserved +* +Outdec pshs b,x,y,u + ldx outptr get pointer + leau CurOn,pcr + lda #1 + ldy #2 + os9 I$Write + bcs L00F0 +L00EF clrb +L00F0 os9 F$Exit +L00F3 lda ,x+ + cmpa #C$SPAC + beq L00F3 + rts +L00FA lda #1 + leax >HelpMsg,pcr + ldy #HelpMsgL + os9 I$Write + bra L00EF + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/pmap.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/pmap.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,310 @@ +******************************************************************** +* PMap - Show process map information +* +* $Id: pmap.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* From "Inside Level II" by Kevin Darling +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* ? Original version KKD 87/02/08 +* 2 Revised to handle 4K or 8K blocks KD 89/09/12 + + nam PMap + ttl Show process map information + + ifp1 + use defsfile + endc + +Type set Prgrm+Objct +Revs set ReEnt+1 +Bufsiz set 512 +edition set 2 + +stdout set 1 +maxnam set 30 + + pag +*************************************************** +* + mod PrgSiz,Name,Type,Revs,Entry,DatSiz + +Name fcs /PMap/ + fcb edition + +* Data Equates +umem rmb 2 +sysImg rmb 2 pointer to sysprc datimg +datimg rmb 2 datimg for copymem +lineptr rmb 2 +number rmb 3 +leadflag rmb 1 +pid rmb 1 +hdr rmb 12 +blkcnt rmb 1 no. blocks/64k +outbuf rmb 80 +buffer rmb bufsiz*2 working proc. desc. +stack rmb 200 +datsiz equ . + +************************************************* +* +* Messages +* +Head1A fcc / ID 01 23 45 67 89 AB CD EF Program / + fcb C$CR + +Head2A fcc /____ __ __ __ __ __ __ __ __ ___________/ +Hdrcr fcb C$CR + +Head1B fcc / ID 0 1 2 3 4 5 6 7 8 9 A B C D E F Program/ + fcb C$CR + +Head2B fcc /____ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ _______/ + fcb C$CR + +SysNam fcs "SYSTEM" +syslen equ *-Sysnam + + spc 3 +*************************************************** +* +Entry stu Umem + lda #1 start with process 1 + clr Pid + +* Print header + leax buffer,u point at storage + os9 F$GBlkMp get block info + bcs Error + cmpd #8192 8k? + beq Set8k + cmpd #4096 4k? + beq Set4k + bra Error we only do 4k/8k + +Set8k lda #64/8 + bra Entry1 + +Set4k lda #64/4 +Entry1 sta blkcnt save size + leax Hdrcr,pcr print line + lbsr PrintL1 print it + lda blkcnt + cmpa #64/4 4k? + beq Headr4 +Headr8 leax Head1A,pcr + lbsr PrintL1 print it + leax Head2A,pcr + bra Head41 + +Headr4 leax Head1B,pcr + lbsr PrintL1 + leax Head2B,pcr +Head41 lbsr PrintL1 + +* Main Program Loop +Main ldu umem + leax OutBuf,U set line pointer + stx Lineptr + inc Pid next process + beq Bye >= 255 --> exit + lda Pid get proc id + leax Buffer,U set destination + os9 F$GPrDsc + bcs Main loop if no descriptor + bsr Output print data for descriptor + bra Main + +Bye clrb +Error os9 F$Exit + +* Subroutines + +Output lda P$ID,X process id + lbsr Outdecl + lbsr Space + lbsr Space + +* Print Process DAT Image +* IN: x = process descriptor +* + pshs X + leax P$DATImg,x point to DAT image + ldb blkcnt set count + pshs b + +PrntImg ldd ,x++ get DAT block + cmpd #$00FC empty? + bne prntimg2 + ldy lineptr + ldd #".. + std ,y++ + sty lineptr + lbsr space + bra prntimg3 + +PrntImg2 tfr b,a print block no. + lbsr Out2HS + +PrntImg3 dec ,s count -= 1 + bne Prntimg + puls b,x + +* Print primary module name +* IN: X - process descriptor +* + lbsr Space + leay P$DATImg,X + tfr Y,D d=dat image + std datimg save pointer + ldx P$PModul,X x=offset in map + bne doname + leax >sysnam,pcr point at name + ldy lineptr + ldb #syslen + +Copy lda ,x+ + sta ,y+ + decb + bne copy + bsr Name2 + bra Printlin + +Doname bsr Printnam + +* Print Line +Printlin ldx lineptr terminate line + lda #C$CR + sta ,X + ldu umem + leax outbuf,U + +* Print line +PrintL1 ldy #80 + lda #stdout + os9 I$Writln + bcs Error + rts + +** Find and print a module name +* IN: X - module offset +* U - data area +* datimg = pointer +* +Printnam equ * + +* Read module header + pshs U save u + leau hdr,U destination + ldd datimg proc datimg pointer + ldy #10 set length + os9 F$CpyMem + lbcs Error + +* Read name from Module to buffer + ldd M$Name,U get name offset from header + ldu lineptr move name to outbuf + leax D,X X - offset to name + ldd datimg + ldy #maxnam set maximum length + os9 F$CpyMem + puls U + lbcs Error + +Name2 pshs X + ldx lineptr + clrb set length = 0 +Name3 incb + lda ,X+ + bpl Name3 + cmpb #40 + bcc Name5 + anda #$7F clear d7 + sta -1,X + cmpb #9 + bcc Name5 + lda #C$SPAC +Name4 sta ,X+ + incb + cmpb #9 + bcs Name4 +Name5 stx lineptr + puls X,PC + +* Print hex digit in A +Out2HS bsr Hexl + +Space lda #C$SPAC + bra Print + + +* Print Hexidecimal Digit in A +Hexl tfr A,B + lsra + lsra + lsra + lsra + bsr Outhex + tfr B,A +Outhex anda #$0F + cmpa #$0A 0 - 9 + bcs Outdig + adda #$07 A - F +Outdig adda #'0 make ASCII + +* Put character in A in buf +Print pshs X + ldx lineptr + sta ,X+ + stx lineptr + puls X,PC + +* Print 1 Decimal Digit in A +* +Outdecl tfr A,B number to B + clra + +* Print 2 Decimal Digits in D +Outdec clr leadflag + pshs X + ldx umem + leax number,X + clr ,X + clr 1,X + clr 2,X +Hundred inc ,X + subd #100 + bcc Hundred + addd #100 +Ten inc 1,X + subd #10 + bcc Ten + addd #10 + incb + stb 2,X + bsr Printled + bsr Printled + bsr Printnum + bsr Space + puls X,PC + +Printnum lda ,X+ get char + adda #'0-1 make ASCII + bra Print + +Printled tst leadflag print leading zero? + bne Printnum yes + ldb ,X is it zero? + inc leadflag + decb + bne Printnum no, print zeros + clr leadflag + lda #C$SPAC + leax 1,X + bra Print + + emod +Prgsiz equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/proc.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/proc.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,507 @@ +******************************************************************** +* Proc - Show process information +* +* $Id: proc.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* NOTE: SHOULD ADD IN TO HANDLE PRINTING NAME OF CURRENT MODULE +* RUNNING IN A RUNB or BASIC09 PROCESS +* +* From "Inside Level II" by Kevin Darling +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Original version KKD 88/10/28 +* ? Modified to show status in English, stderr ??? 89/07/30 +* and the system process +* 11 Modified to add current executing/editing LCB 94/11/08 +* module name for Basic09 and/or RunB programs + + nam Proc + ttl Show process information + + ifp1 + use defsfile + endc + +Type set Prgrm+Objct +Revs set ReEnt+1 +edition set 11 + +bufsiz set 512 +CR set $0D +Spc set $20 +stdout set 1 + + pag +*************************************************** + mod PrgSiz,Name,Type,Revs,Entry,DatSiz + +Name fcs /Proc/ + fcb edition + +* Data Equates +umem rmb 2 Data mem ptr +sysimg rmb 2 pointer to sysprc datimg +datimg rmb 2 datimg for copymem +datimg2 rmb 2 2nd copy for non-descriptor use +basicflg rmb 1 Flag that primary module is BASIC09 or RUNB +outptr rmb 2 pointer in outbuf +number rmb 3 +leadflag rmb 1 +path rmb 3 stdin, stdout and stderr +pid rmb 1 +namlen rmb 1 +hdr rmb 64 +outbuf rmb 80 Buffer for output string +buffer rmb bufsiz working proc. desc. +sysprc rmb bufsiz system proc. desc. +stack rmb 200 +datsiz equ . + +************************************************** +* Messages +* Headers +Header fcc " ID Prnt User Pty Age Tsk Status Signal Module I/O Paths " + fcb CR +Hdrlen equ *-Header + +Header2 fcc /___ ____ ____ ___ ___ ___ _______ __ __ _________ __________________/ +Hdrcr fcb CR +Hdrlen2 equ *-Header2 + +* State Strings (6 characters each) +Quesstr fcc /??????/ +TimSlpSt fcc /TSleep/ +TimOStr fcc /TimOut/ +ImgChStr fcc /ImgChg/ +SuspStr fcc /Suspnd/ +CondmStr fcc /Condem/ +DeadStr fcc /Dead / +Spaces fcc / / +SystmSt fcc /System / + +* Special case module names +basic09 fcc 'BASIC' +b09sz equ *-basic09 +runb fcc 'RUNB' +runbsz equ *-runb +basicms2 fcc ')' + fcb CR +Nomodule fcc 'Not Defined' +Nomodsz equ *-Nomodule + +************************************************ +Entry stu sysprc,U get system proc. desc. + os9 F$GPrDsc + bcs Error + leax P$DatImg,X just for its dat image + stx + lbsr Print + lbsr Device +Stderr lda + lbsr Print print first > + lda #'> + lbsr Print + bsr Device +* Print Line + ldx 39 chars? + bhs Name5 Yes, skip ahead + anda #$7F Take out hi-bit + sta -1,X Save char back without hi-bit + cmpb L00B5,pcr + lbsr L0244 + lbsr L024F + leay >L00D2,pcr + lbsr L0244 + lbsr L024F + leay >L00EF,pcr + lbsr L0244 + lbsr L024F + bra L0199 +L017B leay >L0013,pcr + lbsr L0244 + lbsr L024F + leay >L003E,pcr + lbsr L0244 + lbsr L024F + leay >L0079,pcr + lbsr L0244 + lbsr L024F +L0199 inc $0100,y + subd ,x + bcc L02CC + addd ,x++ + pshs b,a + tfr y,d + tst ,x + bmi L02F4 + ldy #$2F30 + cmpd #$3020 + bne L02EE + ldy #$2F20 + lda #$20 +L02EE bsr L0296 + puls b,a + bra L02CC +L02F4 bsr L0296 + leas $02,s + puls pc,y,x,b,a +L02FA pshs u,x + leay >L010C,pcr + lda $0C,x + bita #$01 + bne L0330 + leay <$40,x + tfr y,d + ldx <$11,x + ldy #$0009 + leau u000A,u + os9 F$CpyMem + pshs b,a + ldd u0004,u + leax d,x + puls b,a + ldy #$0020 + os9 F$CpyMem + leay ,u + lda <$1F,y + ora #$80 + sta <$1F,y +L0330 puls pc,u,x + + emod +eom equ * + end + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/pwd.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/pwd.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,166 @@ +******************************************************************** +* pwd - Print working directory +* +* $Id: pwd.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Original Tandy/Microware version + + nam pwd + ttl Print working directory + +* Disassembled 98/09/10 23:47:33 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 1 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 2 +u0003 rmb 2 +u0005 rmb 1 +u0006 rmb 2 +u0008 rmb 1 +u0009 rmb 2 +u000B rmb 3 +u000E rmb 29 +u002B rmb 2 +u002D rmb 129 +u00AE rmb 1 +u00AF rmb 282 +size equ . + +name fcs /pwd/ + fcb edition +L0011 fcc "pwd: bad name in path" + fcb C$CR +L0027 fcc "." +L0028 fcc "." +L0029 fcb C$CR +L002A fcc "read error" + fcb C$CR + +start leax >u00AE,u + lda #$0D + sta ,x + stx L0028,pcr + bsr L0096 + sta L0027,pcr + bsr L0090 + lda L0028,pcr + bsr L0096 + bsr L00CD + bsr L00A8 + bsr L00E2 + ldd u00AF,u + os9 I$GetStt + bsr L00E4 + rts +L0109 leax >L0011,pcr + bra L0123 +L010F leax >L002A,pcr + bra L0123 +L0115 lda #$02 + os9 I$Write + bcs L0128 + rts + bsr L0115 + leax >L0029,pcr +L0123 lda #$02 + os9 I$WritLn +L0128 ldb #$00 + os9 F$Exit + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/pxd.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/pxd.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,168 @@ +******************************************************************** +* pxd - Print execution directory +* +* $Id: pxd.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Original Tandy/Microware version + + nam pxd + ttl Print working directory + +* Disassembled 98/09/10 23:50:10 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 1 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 2 +u0003 rmb 2 +u0005 rmb 1 +u0006 rmb 2 +u0008 rmb 1 +u0009 rmb 2 +u000B rmb 3 +u000E rmb 29 +u002B rmb 2 +u002D rmb 129 +u00AE rmb 1 +u00AF rmb 282 +size equ . + +name fcs /pxd/ + fcb edition + +L0011 fcc "pxd: bad name in path" + fcb C$CR +L0027 fcc "." +L0028 fcc "." +L0029 fcb C$CR +L002A fcc "read error" + fcb C$CR + +start leax >u00AE,u + lda #$0D + sta ,x + stx L0028,pcr + bsr L0096 + sta L0027,pcr + bsr L0090 + lda L0028,pcr + bsr L0096 + bsr L00CD + bsr L00A8 + bsr L00E2 + ldd u00AF,u + os9 I$GetStt + bsr L00E4 + rts +L0109 leax >L0011,pcr + bra L0123 +L010F leax >L002A,pcr + bra L0123 +L0115 lda #$02 + os9 I$Write + bcs L0128 + rts + bsr L0115 + leax >L0029,pcr +L0123 lda #$02 + os9 I$WritLn +L0128 ldb #$00 + os9 F$Exit + + emod +eom equ * + end + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/rename.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/rename.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,172 @@ +******************************************************************** +* Rename - Rename a file +* +* $Id: rename.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 6 Original Tandy/Microware version + + nam Rename + ttl Rename a file + +* Disassembled 98/09/11 01:35:46 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 6 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 1 +u0002 rmb 2 +u0004 rmb 1 +u0005 rmb 2 +u0007 rmb 1 +u0008 rmb 24 +u0020 rmb 26 +u003A rmb 2 +u003C rmb 405 +size equ . + +name fcs /Rename/ + fcb edition + +start cmpd #$0004 + lbcs L00A8 + stx > No Clock module found <<" + fcb C$LF + fcb C$LF +L0036 fcb C$LF + fcb C$LF + fcb C$BELL + fcc " >> Clock Initialization Errors <<" + fcb C$LF + fcb C$LF +L005E fcb C$LF + fcc " yyyy/mm/dd hh:mm:ss" + fcb C$LF + fcc "Time ? " +L005EL equ *-L005E + +start cmpd #2 + bcc L00A3 + leas <-20,s + leax >L005E,pcr + ldy #L005EL + lda #1 + os9 I$WritLn + leax ,s + lda #C$CR + sta ,x + ldy #21 + clra + os9 I$ReadLn + +* Make room for time packet on stack +L00A3 leas -7,s + bsr L00E3 + stb ,s + bsr L00E3 + stb $01,s + bsr L00E3 + stb $02,s + bsr L00E3 + stb $03,s + bsr L00E3 + stb $04,s + bsr L00E3 + stb $05,s + bsr L00E3 + stb $06,s now we have a 7 byte pkt + ldb ,s get 1st 2 digits (century) + subb #19 subtract 19 from century +BGP+ + lda #100 now we will +BGP+ + mul multiply difference * 100, now B holds 0, 100 or 200 +BGP+ + addb 1,s add os9's year to century byte +BGP+ + stb 1,s save back in year + leax 1,s + os9 F$STime + bcc L00DF + cmpb #$EA + bne L00D2 + leax >L0014,pcr + ldy #$0022 + bra L00DA +L00D2 leax >L0036,pcr + ldy #40 +L00DA lda #1 + os9 I$WritLn +L00DF clrb + os9 F$Exit + +L00E3 clrb + bsr L0101 + bsr L0101 + lda ,x+ + cmpa #C$SPAC + beq L0100 + cmpa #'/ + beq L0100 + cmpa #': + beq L0100 + cmpa #', + beq L0100 + cmpa #'. + beq L0100 + leax -1,x +L0100 rts + +L0101 lda ,x get a digit + suba #$30 make it binary + bcs L0114 not a number, go + cmpa #$09 + bhi L0114 not a number, go + leax $01,x inc to next num + pshs a save a + lda #$0A do a 10x + mul + addb ,s+ save result +L0114 rts all done + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/shell_21.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/shell_21.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,769 @@ +******************************************************************** +* Shell - OS-9 command line interpreter +* +* $Id: shell_21.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 21 Original Tandy/Microware version + + nam Shell + ttl OS-9 command line interpreter + +* Disassembled 99/04/18 22:59:49 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 21 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 2 +u0003 rmb 1 +u0004 rmb 1 +u0005 rmb 1 +u0006 rmb 2 +u0008 rmb 1 +u0009 rmb 1 +u000A rmb 1 +u000B rmb 1 +u000C rmb 1 +u000D rmb 1 +u000E rmb 1 +u000F rmb 1 +u0010 rmb 1 +u0011 rmb 1 +u0012 rmb 1 +u0013 rmb 1 +u0014 rmb 1 +u0015 rmb 1 +u0016 rmb 1 +u0017 rmb 22 +u002D rmb 3 +u0030 rmb 14 +u003E rmb 32 +u005E rmb 2 +u0060 rmb 16 +u0070 rmb 58 +u00AA rmb 85 +u00FF rmb 513 +size equ . +name equ * + +L000D fcs /Shell/ + fcb edition + +L0013 fcb $13 + fcs "PascalS" + fcb $25 % + fcs "RunC" + fcb $22 " + fcs "RunB" + fcb $00 + fcb $00 + fcb $00 + fcb $00 + fcb $00 + fcb $00 + fcb $00 + fcb $00 + fcb $00 +L002E fcb C$LF + fcc "Shell" + fcb C$CR +L0035 fcb C$LF +L0036 fcc "OS9:" +L003A fcs "W" + fcb $0E + fcc ";" + +start leas -$05,s + pshs y,x,b,a + ldb #$6F + lbsr L0175 + leax L0036,pcr + ldy #$0004 + bra L0070 +L00A4 tst >>" + fcb $02,$79 + fcs "<>>" + fcb $02,$67 + fcs "<>" + fcb $02,$7d + fcs ">>>" + fcb $01,$fb + fcs ">>" + fcb $01,$f2 + fcs "<" + fcb $01,$fb + fcs ">" + fcb $02,$ab + fcs "#" + fcb $00,$00 +L0169 fcb $0d + fcc "()" + fcb $ff +L016D fcb $0d + fcc "!#&;<>" + fcb $ff + +L0175 clr b,u + decb + bpl L0175 + rts +L017B ldb #$0E + bsr L0175 +L017F clr L00FB,pcr + lbsr L020F + bcs L01DE + cmpa #$0D + beq L01DE + sta L000D,pcr + sty L013A,pcr + bsr L020F + bcs L01DE + ldy L0146,pcr + bsr L020F + stx L016D,pcr +L0251 cmpa ,x+ + bhi L0251 + puls pc,x +L0257 leas $02,s + lda #$20 +L025B cmpa ,x+ + beq L025B + leax -$01,x + andcc #$FE + rts +L0264 pshs y,x + leay $02,y +L0268 ldx ,s +L026A lda ,x+ + cmpa #$61 + bcs L0272 + suba #$20 +L0272 eora ,y+ + lsla + bne L0286 + bcc L026A + lda -$01,y + cmpa #$C1 + bcs L0283 + bsr L0241 + bcs L0286 +L0283 clra + puls pc,y,b,a +L0286 leay -$01,y +L0288 lda ,y+ + bpl L0288 + sty $02,s + ldd ,y++ + bne L0268 + comb + puls pc,y,x + lbsr L01E1 + clra + bsr L02B8 + bsr L02B7 + bsr L02B7 + bsr L02DE + leax $01,x + tfr x,d + subd u00FF,u + lbsr L0497 + os9 F$Chain + lbra L00C2 +L02B7 inca +L02B8 pshs a + bra L0313 + lda #$84 + bra L02C2 + lda #$83 +L02C2 os9 I$ChgDir + rts + clra + bra L02CB + lda #$01 +L02CB sta L0013,pcr +L04E4 tst ,x + beq L055F + cmpa ,x+ + beq L04F2 +L04EC tst ,x+ + bpl L04EC + bra L04E4 +L04F2 ldd L000D,pcr +L0525 stx byte1 save as flag for found clock + +nxtbyte ldb #8 bits/byte + lda ,y+ + beq gettime +nxtbit lsra do a serial generation + bcs high + cmpa <0 talk to clock at $C000; cmp faster than tst + bra high2 +high cmpa <1 talk to clock at $C001 +high2 decb + bne nxtbit + bra nxtbyte + +gettime lda #8 8 bytes to read from clock + pshs a + ldy #rawdata +* read serial bit stream from clock +timebyte lsr <4 + rora + lsr <4 + rora + lsr <4 + rora + lsr <4 + rora + lsr <4 + rora + lsr <4 + rora + lsr <4 + rora + lsr <4 + rora + sta ,y+ store in raw data + cmpa >byte1 if reg.A never changes then no clock + beq maybe always possible that a clock byte might look like ROM + inc >clkflag indicate a found clock +maybe dec ,s + bne timebyte + leas 1,s yank counter + tst >clkflag did we find the clock? + bne found + ldb >mpiimage try another MPI slot + bitb #$30 did we get to slot 0? + beq found + subb #$10 next slot + stb >mpiimage save image so that we don't hunt the next time. + bra findclk + +found lda >dpsave + tfr a,dp back to program DP + sta ram go back to RAM mode + puls d + stb multipac restore to original setting + tst cartI clear CART flag incase autostart ROM pack was present in MPI + sta $FF90 restore GIME mode + puls cc restore IRQs + tst lock; imer; isable ->/ +mesage2 fcb C$LF + fcc /Enter the day 0-7; Mon=1 Sun=7/ + fcb C$LF + fcc /day = ->? / +mesage3 fcb C$LF + fcc /Select 12 or 24 hour clock/ + fcb C$LF + fcc /<1> = 12; <2> = 24 ->/ +mesage4 fcb C$LF + fcc /Select M or

M ->/ +mesage5 fcb C$LF + fcc /Enter as much of the date & time as desired/ + fcb C$LF + fcc !yy/mm/dd hh:mm:ss! + fcb C$LF + fcc /->/ +endmes equ * + emod +pgrmend equ * diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/tee.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/tee.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,87 @@ +******************************************************************** +* Tee - Split output to multiple devices +* +* $Id: tee.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 2 Original Tandy distribution version + + nam Tee + ttl Split output to multiple devices + +* Disassembled 98/09/14 23:50:52 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 2 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 13 +u000E rmb 1 +u000F rmb 706 +size equ . + +name fcs /Tee/ + fcb edition + +start clrb + clr u000E,u + cmpy #$0000 + lbeq L0076 + leay u0001,u +L001E lda ,x+ + cmpa #$20 + beq L001E + cmpa #$2C + beq L001E + cmpa #$0D + lbeq L0042 + leax -$01,x + lda #$02 + ldb #$0B + os9 I$Create + bcs L0077 + ldb u000E,u + sta b,y + incb + stb u000E,u + bra L001E +L0042 stb u000E,u +L0044 clra + leax u000F,u + ldy #$0100 + os9 I$ReadLn + bcc L0057 + cmpb #$D3 + beq L0076 + coma + bra L0077 +L0057 inca + os9 I$WritLn + tst u000E,u + beq L0044 + clrb +L0060 leay u0001,u + lda b,y + leax u000F,u + ldy #$0100 + os9 I$WritLn + bcs L0077 + incb + cmpb u000E,u + bne L0060 + bra L0044 +L0076 clrb +L0077 os9 F$Exit + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/tmode.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/tmode.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,428 @@ + nam Tmode + ttl program module + +* Disassembled 98/09/11 18:35:13 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 12 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 1 +u0002 rmb 1 +u0003 rmb 2 +u0005 rmb 1 +u0006 rmb 1 +u0007 rmb 32 +u0027 rmb 10 +u0031 rmb 526 +size equ . + +name fcs /Tmode/ + fcb edition + fcb $00 + fcb $17 +L0015 fcb $FF + fcb $01 + fcb $01 + fcb $01 + fcs "upc" + fcb $FF + fcb $01 + fcb $02 + fcb $01 + fcs "bsb" + fcb $FF + fcb $00 + fcb $03 + fcb $00 + fcs "bsl" + fcb $FF + fcb $01 + fcb $04 + fcb $01 + fcs "echo" + fcb $FF + fcb $01 + fcb $05 + fcb $01 + fcs "lf" + fcb $00 + fcb $00 + fcb $06 + fcb $00 + fcs "null" + fcb $FF + fcb $01 + fcb $07 + fcb $01 + fcs "pause" + fcb $00 + fcb $18 + fcb $08 + fcb $00 + fcs "pag" + fcb $01 + fcb $08 + fcb $09 + fcb $00 + fcs "bsp" + fcb $01 + fcb $18 + fcb $0A + fcb $00 + fcs "del" + fcb $01 + fcb $0D + fcb $0B + fcb $00 + fcs "eor" + fcb $01 + fcb $1B + fcb $0C + fcb $00 + fcs "eof" + fcb $01 + fcb $04 + fcb $0D + fcb $00 + fcs "reprint" + fcb $01 + fcb $01 + fcb $0E + fcb $00 + fcs "dup" + fcb $01 + fcb $17 + fcb $0F + fcb $00 + fcs "psc" + fcb $01 + fcb $03 + fcb $10 + fcb $00 + fcs "abort" + fcb $01 + fcb $05 + fcb $11 + fcb $00 + fcs "quit" + fcb $01 + fcb $08 + fcb $12 + fcb $00 + fcs "bse" + fcb $01 + fcb $07 + fcb $13 + fcb $00 + fcs "bell" + fcb $01 + fcb $15 + fcb $14 + fcb $00 + fcs "type" + fcb $01 + fcb $02 + fcb $15 + fcb $00 + fcs "baud" + fcb $01 + fcb $11 + fcb $18 + fcb $00 + fcs "xon" + fcb $01 + fcb $13 + fcb $19 + fcb $00 + fcs "xoff" + +start lda #$32 + sta L0015,pcr + lbsr L02D1 + bcs L0181 + lda ,x + bpl L015C +L0150 ldb $01,x +L0152 lda $02,x + eorb L0015,pcr + leay u0007,u + clrb +L020F lda b,y + bsr L0221 + incb + cmpb #$20 + bcs L020F + lda #$0D + lbsr L02AF + clrb + os9 F$Exit +L0221 pshs u,y,x,b,a + ldy -$02,x +L0226 cmpb $02,x + beq L0236 + leax $04,x +L022C lda ,x+ + bpl L022C + leay -$01,y + bne L0226 + puls pc,u,y,x,b,a +L0236 bsr L02AD + tst ,x + bpl L025E + lda ,s + cmpa $03,x + beq L0246 + lda #$2D + bsr L02AF +L0246 bsr L024E + puls pc,u,y,x,b,a +L024A pshs x + bra L0252 +L024E pshs x + leax $04,x +L0252 lda ,x + anda #$7F + bsr L02AF + lda ,x+ + bpl L0252 + puls pc,x +L025E bsr L024E + lda #$3D + bsr L02AF + tst ,x + bne L0291 + ldb ,s + lda #$2F + clr u0106,u + sts L012F,pcr + bra L0074 +L0070 leax >L0115,pcr +L0074 lbsr L010B + bra L007C +L0079 comb + stb ,x +L007C ldx L015C,pcr + bra L00B2 +L00AE leax >L014C,pcr +L00B2 bsr L010B + bra L00CF +L00B6 com [-s=stype] xpos ypos width height fcol bcol [bord]" + fcb C$CR + fcb C$LF + fcc "Use: Create a new window" + fcb C$CR + fcb C$LF + fcc "Options: -s=stype place the window on a new screen, must also" + fcb C$CR + fcb C$LF + fcc " include the border color." + fcb C$CR + fcb C$LF + fcc " -z receive commands from standard input" + fcb C$CR + fcb C$LF + fcc " -? receive help message" + fcb C$CR + fcb C$LF +L0148 fdb $1B21 + +start clr L0148,pcr + ldy #$0002 + os9 I$Write + rts +L0260 lda ,x+ + cmpa #$20 + beq L0260 + leax -1,x + rts +L0269 leas $02,s +L026B lda #$01 + leax >L0015,pcr + ldy #$0133 + os9 I$Write + lbra L01AE +L027B pshs b + clrb + stb ,y +L0280 lda ,x+ + cmpa #$30 + blt L029B + cmpa #$39 + bhi L029B + suba #$30 + pshs a + lda #$0A + ldb ,y + mul + addb ,s+ + stb ,y + bvs L02A7 + bra L0280 +L029B cmpa #C$CR + beq L02AA + cmpa #C$SPAC + bsr L0260 + bra L02AA + bne L02A7 +L02A7 comb + bra L02AD +L02AA clrb + leay $01,y +L02AD puls pc,b + + emod +eom equ * + end + diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/CMDS/xmode.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/xmode.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,689 @@ +******************************************************************** +* XMode - Modify device descriptors +* +* $Id: xmode.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* +* XMode by Bruce Isted +* based on "DMode", a program by Kevin K. Darling +* +* XMode is an SCF device descriptor utility similar to the original XMode, +* intended to replace the original utility. This utility works on SCF +* descriptors in memory or on disk in single module files. +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Release to public domain BRI 89/06/21 + + nam XMode + ttl Modify device descriptors + + ifp1 + use defsfile + endc + +BuffSize equ 10 max. CHAR string length +Edtn equ 1 +MaxSize equ $80 maximum module size +NameSize equ 4 maximum module name length +Vrsn equ 1 + + org 0 +Count rmb 1 number of option bytes +DataPtr rmb 2 current option ptr +HexIn rmb 2 2 byte hex number +ModAddr rmb 2 module address +ModSize rmb 2 module size +OptEnd rmb 2 option table end offset +ParmPtr rmb 2 next name DataPtr +PathNmbr rmb 1 file path +TxtPtr rmb 2 option name ptr +Buffer rmb BuffSize miscellaneous output buffer +ModBuff rmb MaxSize module work copy buffer +stack rmb $0200 stack and parameter space +MemSize equ . + + mod Size,Name,Prgrm+Objct,ReEnt+Vrsn,Entry,MemSize + +Name fcs "XMode" + fcb Edtn edition number + +OptTable + fcc " nam" option name + fcb Sign+M$Name,NameSize offset to string offset & max. byte count to change + fcc " mgr" + fcb Sign+M$FMgr,0 offset to string offset & no changes allowed + fcc " ddr" + fcb Sign+M$PDev,0 + fcc " hpn" + fcb M$Port,1 option offset & byte count + fcc " hpa" + fcb M$Port+1,2 + fcc " upc" + fcb IT.UPC,1 + fcc " bso" + fcb IT.BSO,1 + fcc " dlo" + fcb IT.DLO,1 + fcc " eko" + fcb IT.EKO,1 + fcc " alf" + fcb IT.ALF,1 + fcc " nul" + fcb IT.NUL,1 + fcc " pau" + fcb IT.PAU,1 + fcc " pag" + fcb IT.PAG,1 + fcc " bsp" + fcb IT.BSP,1 + fcc " del" + fcb IT.DEL,1 + fcc " eor" + fcb IT.EOR,1 + fcc " eof" + fcb IT.EOF,1 + fcc " rpr" + fcb IT.RPR,1 + fcc " dup" + fcb IT.DUP,1 + fcc " psc" + fcb IT.PSC,1 + fcc " int" + fcb IT.INT,1 + fcc " qut" + fcb IT.QUT,1 + fcc " bse" + fcb IT.BSE,1 + fcc " ovf" + fcb IT.OVF,1 + fcc " par" + fcb IT.PAR,1 + fcc " bau" + fcb IT.BAU,1 + fcc " xon" + fcb IT.XON,1 + fcc " xof" + fcb IT.XOFF,1 + fcc " col" + fcb IT.COL,1 + fcc " row" + fcb IT.ROW,1 + fcc " xtp" + fcb IT.XTYP,1 + fcc " wnd" + fcb IT.WND,1 + fcc " val" + fcb IT.VAL,1 + fcc " sty" + fcb IT.STY,1 + fcc " cpx" + fcb IT.CPX,1 + fcc " cpy" + fcb IT.CPY,1 + fcc " fgc" + fcb IT.FGC,1 + fcc " bgc" + fcb IT.BGC,1 + fcc " bdc" + fcb IT.BDC,1 +TablOpts equ (*-OptTable)/6 number of table entries + fcb $80 end of option table + +UseMsg + fcb C$LF + fcc "Usage: XMode [/ || - || -?] [option] [option] [...]" + fcb C$LF,C$LF + fcc "Purpose: To report or alter current option settings of SCF device" + fcb C$LF + fcc " descriptors in memory or on disk in single module files." + fcb C$LF,C$LF + fcc "Options: nam, mgr, ddr, hpn, hpa, upc, bso, dlo, eko, alf, nul, pau," + fcb C$LF + fcc " pag, bsp, del, eor, eof, rpr, dup, psc, int, qut, bse, ovf," + fcb C$LF + fcc " par, bau, xon, xof, col, row, xtp, wnd, val, sty, cpx, cpy," + fcb C$LF + fcc " fgc, bgc, bdc" + fcb C$LF,C$LF + fcc "Examples: xmode /t2" + fcb C$LF + fcc " Prints the current option settings of the /T2 descriptor" + fcb C$LF + fcc " in memory." + fcb C$LF + fcc " xmode -modules/t4.dd nam=T2 bau=6 hpa=ff6c eof=1B" + fcb C$LF + fcc " Changes the module name in the MODULES/T4.dd file to T2," + fcb C$LF + fcc " sets the baud rate code to 6, the hardware port address" + fcb C$LF + fcc " to $FF6C, and the end of file character to $1B." + fcb C$LF + fcc " xmode -?" + fcb C$LF + fcc " Prints more complete information on all of the options." + fcb C$CR +UseLen equ *-UseMsg + +HelpMsg + fcb C$LF + fcc "The NAM option accepts only a legal OS-9 module name with a maximum of" + fcb C$LF + fcc "4 characters. It is up to the user to ensure that there is adequate" + fcb C$LF + fcc "room for the module name, and if required to rename the disk file to" + fcb C$LF + fcc "suit the new module name. The MGR and DDR options can't be changed." + fcb C$LF + fcc "All other options require hexadecimal numbers (0 through FFFF). XTP is" + fcb C$LF + fcc "for certain ACIA descriptors only. WND, VAL, STY, CPX, CPY, FGC, BGC," + fcb C$LF + fcc "and BDC are for window descriptors only." + fcb C$LF,C$LF + fcc "nam Device Name mgr File Manager Name ddr Device Driver Name" + fcb C$LF + fcc "hpn H'ware Page Number hpa H'ware Port Address upc Case Lock Flag" + fcb C$LF + fcc "bso Backspace Method dlo Delete Line Method eko Screen Echo Flag" + fcb C$LF + fcc "alf Auto Linefeed Flag nul End Of Line Nulls pau Page Pause Flag" + fcb C$LF + fcc "pag Page Length bsp Backspace Character del Delete Line Char" + fcb C$LF + fcc "eor End Of Record Char eof End Of File Char rpr Reprint Line Char" + fcb C$LF + fcc "dup Duplicate Line Char psc Pause Character int Interrupt Character" + fcb C$LF + fcc "qut Quit Character bse Backspace Echo Char ovf Overflow Character" + fcb C$LF + fcc "par Type (Parity) Code bau Baud Rate Code xon XON Character" + fcb C$LF + fcc "xof XOFF Character col Display Columns row Display Rows" + fcb C$LF + fcc "xtp Extended Type Code wnd Window Number val Valid Window Flag" + fcb C$LF + fcc "sty Window Screen Type cpx X Corner Position cpy Y Corner Position" + fcb C$LF + fcc "fgc Foreground Colour bgc Background Colour bdc Border Colour" + fcb C$CR +HelpLen equ *-HelpMsg + +Equal fcc "=" + +TypeMsg + fcb C$LF + fcc "Not an SCF descriptor!" +CR fcb C$CR +TypeLen equ *-TypeMsg + +Sizemsg + fcb C$LF + fcc "Module size out of range!" + fcb C$CR +Sizelen equ *-Sizemsg + +SynMsg + fcb C$LF + fcc "Syntax error: " +SynLen equ *-SynMsg + +**************** +* miscellaneous error and help routines + +MuchHelp + leax HelpMsg,pc + ldy #HelpLen + bra Helpprnt + +BadSize + leax Sizemsg,pc + ldy #Sizelen + bra AddHelp + +BadType + leax TypeMsg,pc + ldy #TypeLen +AddHelp + lda #2 + os9 I$WritLn +Help + leax UseMsg,pc + ldy #UseLen +Helpprnt + lda #2 + os9 I$WritLn + lbra OkayEnd2 + +**************** +Entry + ldd #0 + std + bne Help + pshs u + lda #Devic + os9 F$Link link to module + bcs Help + stx delimiter char? + bne Syntax no, go report error + +ChkLen + cmpb Byte: + suba #$30 make number from ASCII + bmi Syntax + cmpa #10 is it number? + bcs Num + anda #$5F make uppercase + suba #$11-$0A make hex $A-$F + cmpa #$0A + bcs Syntax + cmpa #$10 not hex char? + bcc Syntax + +Num + ldb #16 fancy asl *4 + mul + pshs b save top 4 bits + ldd + +SetNum2 + ldb 4,y get option offset + leay ModBuff,u point to module + leay b,y point to option + ldd : +OutCR + leax CR,pc + ldy #1 + lda #1 + os9 I$WritLn + rts + +**************** +* Output Current Desc Info: +Info + bsr OutCR do a + ldb #TablOpts number of table entries + pshs b save counter + leax OptTable,pc point to text table + stx after every 8th option + lbra InfoLoop ..loop + +* -------------- +* Print 1/2 Byte Hex Char: +OutOne + cmpa #10 + bcs Number + adda #$11-10 make alpha + +Number + adda #$30 make ASCII + sta L05F2,pcr Point to polling routine + stx eo,pcr move secondary vectors + pshs x from end of rom: + leay >D.VECTRS,pcr + ldx #D.Clock (Tick-NMI) +L0079 ldd ,y++ get vector + addd ,s add offset + std ,x++ store + cmpx #D.XNMI done? + bls L0079 ..no + leas 2,s drop offset + + ldx D.XSWI2 set calls to sys + stx D.UsrSvc + ldx D.XIRQ set IRQ to sys + stx D.UsrIRQ + + leax SysCall,pcr set syscall handler + stx D.SysSvc + stx D.XSWI2 + + leax S.SysIRQ,pcr set sysirq handler + stx D.SysIRQ + stx D.XIRQ + + leax >S.SvcIRQ,pcr IRQ svc handler + stx D.SvcIRQ + leax >S.POLL,pcr default poll 'til IOMan + stx D.Poll + leax S.AltIRQ,pcr default keyboard till CC3io ++ + stx D.AltIRQ ++ + leax S.Flip0,pcr Grfdrv return vector ++ + stx D.Flip0 ++ + leax S.Flip1,pcr GrfDrv exec vector ++ + stx D.Flip1 ++ + + leay SysCalls,pcr enter os9p1 svc calls: + lbsr InstSSvc + +*------------------------------------------------* + ldu D.PrcDBT set up first proc desc: + ldx D.SysPrc + stx 0,u proc table entries + stx 1,u zero and one + + lda #1 sys proc id=01 + sta P$ID,x + lda #SysState set sys state + sta P$State,x + lda #SysTask sys task # ++ + sta D.SysTsk + sta P$Task,x +* optimization below saves one byte + ldd #$FFFF top priority/age + std P$Prior,x store it +* lda #$FF +* sta P$Prior,x +* sta P$Age,x + + leax P$DATImg,x point sysdat -> sys proc + stx D.SysDAT + clra + clrb + std ,x++ first block always sys + +* DAT.BlCt-ROMCount-RAMCount: + ldy #6 next 6 are unused ++ + ldd #DAT.Free +L00EF std ,x++ + leay -1,y + bne L00EF + + ldd #IOBlock last one is Kernel ++ + std ,x++ + + ldx D.Tasks first task# is sys's + inc 0,x + inc 1,x Task 1 is GrfDrv ++ + +*------------------------------------------------* +* set 1st 8K sys mem used + ldx D.SysMem + ldb D.CCStk (=$20) ++ +L0104 inc ,x+ + decb + bne L0104 + +*------------------------------------------------* +* determine size of CoCo's memory (128K/512K) + clr D.MemSz default is 128k ++ + ldd #$0313 blocks $03 and $13 ++ + std DAT.Regs+5 map at logical $A000 ++ + ldx #$A000 point to first block ++ + ldd #$DC78 get inverted sync bytes ++ + std ,x store at start of first block ++ + cmpd 8192,x in second block too? ++ + beq L0122 yes, just 128k ++ + inc D.MemSz else set 512k flag ++ + +L0122 ldy #$2000 point to second block in map ++ + ldx D.BlkMap X=$0200 + +* Check Memory Blocks Loop: + +L0128 pshs x save current map pointer + ldd ,s D=map ptr + subd D.BlkMap D=block number + cmpb #IOBlock is it sys? + bne L0136 ..no, test for 512k ++ + ldb #RAMinUse load marker ++ + bra L015B go set in map ++ + +L0136 lda D.MemSz 512k memory? ++ + bne L013E yes, continue ++ + cmpb #$0F end of 128k mem? ++ + bhs L0159 yes, set notram ++ + +L013E stb >DAT.Regs+1 set block at $2000 for test ++ + ldu ,y get two bytes + ldx #$00FF store test bytes + stx ,y + cmpx ,y same on read + bne L0159 ..end if no mem here + + ldx #$FF00 make sure again + stx ,y + cmpx ,y + bne L0159 ..bad mem + stu ,y restore original bytes + bra L015D do next + +* End of Memory: + +L0159 ldb #NotRAM set non-mem flag + +L015B stb [,s] store at ,X in table ++ + +L015D puls x get current map pointer + leax 1,x next block + cmpx D.BlkMap+2 end of map? + blo L0128 ..no, keep trying + +*------------------------------------------------* +* Search For ROM Modules: + + ldx D.BlkMap X=map strt (X=$0200) + inc ,x mark as RAMinUse + ldx D.BlkMap+2 start at end of map (X=$0240) + + leax -1,x back up 1 (X=$023F) + +*------------------------------------------------* + tfr x,d else D=block number (D=$023F) + subd D.BlkMap make into block number (D=$003F) + + pshs d save block number + leay ,s Y = var pointer for routine below + + ldx #$0D00 offset in block ++ + +*------------------------------------------------* +* Check Block for Modules Loop: + +L017F pshs x,y + lbsr L0AF0 set up Y for X offset + ldb 1,y B=block# from image + stb >DAT.Regs map into sys zero + lda ,x get byte from block + clr >DAT.Regs back to sys + puls x,y + cmpa #M$ID1 module? + bne L01A7 + + lbsr L0463 do verify + bcc L019D + cmpb #E$KwnMod 'Known Module'? + bne L01A7 ..no, continue +L019D ldd #M$Size else get mod size + lbsr lddxy + leax d,x skip over it + bra L01A9 + +* Not Known Module: + +L01A7 leax 1,x byte ptr+1 + +L01A9 cmpx #$1E00 don't overrun vector page! ++ + blo L017F ok to continue ++ + bsr L01D2 setup system mem map ++ + +*------------------------------------------------* +* OS9p1 init finished: + +L01B0 os9 F$Boot boot! + bcs Crash crash if problem + leax InitMod,pcr 'Init' + bsr LinkSys link to it + bcs Crash crash if error +L01BF stu D.Init save Init ptr +L01C1 leax OS9p2Nm,pcr 'OS9p2' + bsr LinkSys link to it + bcs Crash crash if not found... +L01D0 jmp ,y ...else do OS9p2... +Crash jmp D.Crash report boot failed + +* Setup system memory map. + +L01D2 ldx D.SysMem point to map ++ + leax $ED00/256,x kernel offset in map ++ + lda #NotRam mark IOPage ++ + sta 18,x as Not RAM ++ + ldb #$12 18 pages in kernel ++ + +L01DF lda #RAMinUse mark kernel ++ + +L01E1 sta ,x+ RAM as in use ++ + decb all done ++ + bne L01E1 no, continue + ldx D.BlkMap+2 end of map++ + sta -1,x mark block #3F ++ + rts exit ++ + +* Link to Module (X = ptr to mod name): +LinkSys lda #Systm system module + os9 F$Link try to find it + rts + +*------------------------------------------------* +* System Service Calls +*------------------------------------------------* +SysCalls fcb F$Link + fdb FLink-*-2 + fcb F$PrsNam + fdb FPrsNam-*-2 + fcb F$CmpNam + fdb FCmpNam-*-2 + fcb F$CmpNam+$80 (sys) + fdb SCmpNam-*-2 + fcb F$CRC + fdb FCRC-*-2 + fcb F$SRqMem+$80 + fdb FSRqMem-*-2 + fcb F$SRtMem+$80 + fdb FSRtMem-*-2 + fcb F$AProc+$80 + fdb FAProc-*-2 + fcb F$NProc+$80 + fdb FNProc-*-2 + fcb F$VModul+$80 + fdb FVModul-*-2 + fcb F$SSvc + fdb FSSvc-*-2 + fcb F$SLink+$80 + fdb FSLink-*-2 + fcb F$Boot+$80 + fdb FBoot-*-2 + fcb F$BtMem+$80 + fdb FBtMem-*-2 + fcb F$Move+$80 + fdb FMove-*-2 + fcb F$AllRam + fdb FAllRam-*-2 + fcb F$AllImg+$80 + fdb FAllImg-*-2 + fcb F$SetImg+$80 + fdb FSetImg-*-2 + fcb F$FreeLB+$80 + fdb FFreeLB-*-2 + fcb F$FreeHB+$80 + fdb FFreeHB-*-2 + fcb F$AllTsk+$80 + fdb FAllTsk-*-2 + fcb F$DelTsk+$80 + fdb FDelTsk-*-2 + fcb F$SetTsk+$80 + fdb FSetTsk-*-2 + fcb F$ResTsk+$80 + fdb FResTsk-*-2 + fcb F$RelTsk+$80 + fdb FRelTsk-*-2 + fcb F$DATLog+$80 + fdb FDATLog-*-2 + fcb F$LDAXY+$80 + fdb FLDAXY-*-2 + fcb F$LDDDXY+$80 + fdb FLDDDXY-*-2 + fcb F$LDABX+$80 + fdb FLDABX-*-2 + fcb F$STABX+$80 + fdb FSTABX-*-2 + fcb F$ELink+$80 + fdb FELink-*-2 + fcb F$FModul+$80 + fdb FFModul-*-2 + fcb F$AlHRam+$80 new call ++ + fdb FAlHRam-*-2 for CoCo3 ++ + fcb $80 End of Table + +*------------------------------------------------* +InitMod fcs "Init" +OS9p2Nm fcs "OS9p2" +BootMod fcs "Boot" + +*------------------------------------------------* +Vectors jmp [-16,x] goto irq routine + +*------------------------------------------------* +* User State SWI Vectors: +*------------------------------------------------* + +XSWI3 ldx D.Proc proc desc + ldu P$SWI3,x diff swi3 vector? + beq L028E ..no, do normal + +L027B lbra L0E5E else do usr call. + +XSWI2 ldx D.Proc X=proc desc + ldu P$SWI2,x swi2 svc ptr + beq L028E ..zero, do normal + bra L027B else do usr map + +XSWI ldx D.Proc proc desc + ldu P$SWI,x swi ptr + bne L027B ..do user, else: + +*------------------------------------------------* +* System SWI calls: (X=pd, U=svc) + +L028E ldd D.SysSvc set system state: + std D.XSWI2 + ldd D.SysIRQ + std D.XIRQ + lda P$State,x + ora #SysState + sta P$State,x + + sts P$SP,x and save user stack + leas P$Stack-R$Size,x get local sys stack + andcc #^IntMasks okay interrupts + leau ,s U=sys reg stack + bsr L02CB copy user stack here + + ldb P$Task,x B=task# + ldx R$PC,u X=PC ptr + lbsr FLDBBX get call byte from user map ++ + leax 1,x increment PC + stx R$PC,u past call + + ldy D.UsrDis Y=user dispatch table + lbsr L033B do the call + ldb R$CC,u okay interrupts + andb #^IntMasks on return + stb R$CC,u to user map + + ldx D.Proc + bsr L02DA copy back new user stack + lda P$State,x drop sys state + anda #^SysState + lbra L0D7C and return to user. + +*------------------------------------------------* +* Get Caller's Regs: + +L02CB pshs cc,x,y,u ++ + ldb P$Task,x A=user tsk# ++ + ldx P$SP,x X=from user stack + lbsr L0BF5 get offset in 8k space ++ + leax $A000,x +$A000 =logical address ++ + bra L02E9 get regs & rts. + +* Return Regs to Caller: + +L02DA pshs cc,x,y,u save state ++ + ldb P$Task,x B=user tsk# + ldx P$SP,x X=to user stack + lbsr L0BF5 get offset in 8k space ++ + leax $A000,x +$A000 =logical address ++ + exg x,u U=user, X=sys + +* move caller stack --> + +L02E9 pshs u save U ++ + lbsr L0C09 get DAT image pointer in U ++ + leau a,u point to block # in image ++ + leau 1,u point to LSB ++ +* lda ,u++ first block # in A ++ --BGP +* ldb ,u second block # in B ++ --BGP + lda ,u first block # in A ++ ++BGP + ldb 2,u second block # in B ++ ++BGP + puls u recover U ++ ++S.KONO donot use sysstack while use page 5 + orcc #IntMasks mask interrupts ++ + std DAT.Regs+5 set DAT ++ + ldy #R$SIZE register stack size ++ + +L0303 ldd ,x++ move them ++ + std ,u++ ++ + leay -2,y done yet? ++ + bne L0303 no, continue ++ + ldx D.SysDAT system DAT image ++ + lda 11,x get real ++ + ldb 13,x system blocks ++ + std DAT.Regs+5 and restore system map ++ + puls cc,x,y,u,pc clean up and rts ++ + +*------------------------------------------------* +* Sys State OS Call: +*------------------------------------------------* +SysCall leau ,s U=reg stack + lda D.SSTskN get task image ++ + clr D.SSTskN set to system ++ + pshs a save old task # ++ + lda R$CC,u + tfr a,cc set CC=user CC + ldx R$PC,u get call + ldb ,s is task sys? ++ + beq L032F yes ++ + lbsr FLDBBX get call from user space ++ + leax 1,x point past it ++ + bra L0331 set as PC ++ + +L032F ldb ,x+ and increment PC + +L0331 stx R$PC,u past it + ldy D.SysDis Y=system dispatch table + bsr L033B do the call + lbra L0E2B end + +*------------------------------------------------* +* Do Svc Call(B), Y=table: + +L033B aslb index + bcc L0345 ..okay if not I/O + +* count I$ calls for current process (D.Proc) + pshs b save index into table + ldb #P$ICalls set up I$ counter + bsr IncCount go do it... (X is altered) + puls b recover index + + rorb else reset B + ldx $00FE,y else X=IOMan vector + bra L034F and do it. + +* count User Ticks, System Ticks, F$ calls, or I$ calls +* for current process (D.Proc) BRI +IncCount ldx =$80) + tfr d,u U=index + ldd ,y++ D=new call vector offset + leax d,y X=actual vector + ldd D.SysDis D=sys dispatch table + stx d,u store new call vector + bcs InstSSvc ..skip if sys only + ldd D.UsrDis else put in user + stx d,u dispatch table also. + +* End of Table Check: + +InstSSvc ldb ,y+ get next call + cmpb #$80 is it end-of-table? + bne L036D ..no + rts yes, end. + + +*------------------------------------------------* +* F$SLink +*------------------------------------------------* +* Link modules into map. +* A=type,X=name,Y=DAT image ptr +FSLink ldy R$Y,u get DAT image ptr + bra SLink + + +*------------------------------------------------* +* F$ELink +*------------------------------------------------* +FELink pshs u + ldb R$B,u type + ldx R$X,u name of module + bra L03AF go link it + + +*------------------------------------------------* +* F$Link +*------------------------------------------------* +FLink ldx D.Proc proc desc + leay P$DATImg,x Y=DAT image ptr + +*------------------------------------------------* +SLink pshs u save reg ptr + ldx R$X,u X=module name + lda R$A,u A=module type + lbsr L068D search moddir + + bcs L041E ..err + + leay ,u Y=moddir entry + ldu ,s get back reg ptr + stx R$X,u return X + std R$D,u return type/lang + leax ,y X=moddir entry + +L03AF bitb #ReEnt is it shareable? + bne L03BB ..yes + ldd MD$Link,x any links? + beq L03BB ..no:ok, else + ldb #E$ModBsy 'Module Busy' err + bra L041E bad end. + +L03BB ldd MD$MPtr,x D=module ptr + pshs a,b,x save ptr,entry + ldy MD$MPDAT,x Y=DAT img for module + ldd MD$MBSiz,x D=mem block size + addd #$1FFF round up A ++ + tfr a,b to 8K block ++ + lsrb B/32 + lsrb + lsrb + lsrb + lsrb ++ + adda #2 (A+2)/32 ++ + lsra + lsra + lsra + lsra + lsra ++ + pshs a save blocks needed + leau ,y U=moddir entry + bsr L0422 find it in callers map? + bcc L03EB ..yes + + lda ,s blocks needed + lbsr L0A33 room to map in? + bcc L03E8 ..okay + leas 5,s else drop junk + bra L041E bad end. + +L03E8 lbsr L0A8C set DAT image +L03EB leax P$Links,x link cnt tble + sta ,s save block # + asla index + leau a,x U=link ptr + ldx ,u increment link cnt: + leax 1,x + beq L03FC + stx ,u +L03FC ldu 3,s U=moddir entry + ldx MD$Link,u increment link cnt: + leax 1,x + beq L0406 + stx MD$Link,u +L0406 puls b,x,y,u + lbsr L0AB0 dattolog + stx R$U,u return module addrss + ldx MD$MPtr,y mod ptr + ldy MD$MPDAT,y DAT image ptr + ldd #M$Exec get exec offset + lbsr LDDXY + addd R$U,u plus mod addrss + std R$Y,u = exec address + clrb okay + rts end. + +L041E orcc #Carry set error + puls u,pc + +*------------------------------------------------* +* See if moddir image in proc map already: +*------------------------------------------------* + +* B=block img #, U=moddir ptr + +L0422 ldx D.Proc proc desc + leay P$DATImg,x Y=DAT image ptr + clra A=00 + pshs a,b,x,y save #,proc,img + subb #DAT.BlCt + negb + aslb index + leay b,y + +* Image Compare Loop: + +L0430 ldx ,s X=block cnt + pshs y,u +L0434 ldd ,y++ does proc img + cmpd ,u++ match mod image? + bne L0449 ..no + leax -1,x yes, cnt-1 + bne L0434 ..done? + + puls a,b,u D=start ptr + subd 4,s -block cnt = offset + lsrb B/2 index + stb ,s save block # + clrb okay + puls a,b,x,y,pc rts. + +L0449 puls y,u Y=start ptr + leay -2,y back up one img + cmpy 4,s too far? + bcc L0430 ..no, try again + puls a,b,x,y,pc error end. + + +*------------------------------------------------* +* F$VModul +*------------------------------------------------* +FVModul pshs u + ldx R$X,u X=mod offset + ldy R$D,u Y=DAT img ptr + bsr L0463 do the verify + ldx ,s + stu R$U,x return moddir ptr + puls u,pc + +L0463 pshs x,y + lbsr L0586 check module crc + bcs L0493 ..err + + ldd #M$Type + lbsr LDDXY get type/rev bytes + andb #$0F save rev + pshs a,b + + ldd #M$Name get name offset + lbsr LDDXY + leax d,x X points to mod name + puls a + lbsr L068D + puls a + bcs L0497 + + pshs a + andb #$0F + subb ,s+ + bcs L0497 + ldb #E$KwnMod 'Known Module' + bra L0493 + +L0491 ldb #E$DirFul 'Module Dir Full' +L0493 orcc #Carry + puls x,y,pc + +*------------------------------------------------* +L0497 ldx ,s X=module addrss + lbsr L0524 + bcs L0491 + sty MD$MPDAT,u insert DAT image ptr + stx MD$MPtr,u and module ptr + clra + clrb + std MD$Link,u link count=00 + ldd #M$Size + lbsr LDDXY get module size + pshs x mod addrss + addd ,s++ plus size + std MD$MBSiz,u + ldy [MD$MPDAT,u] Y=mod images + ldx D.ModDir X=mod dir strt + pshs u save entry + bra L04BE + +L04BC leax MD$ESize,x next moddir entry +L04BE cmpx D.ModEnd last one? + bcc L04CD ..yes, end + cmpx ,s same entry? + beq L04BC ..yes, try again + cmpy [,x] same image ptr? + bne L04BC ..no, try again + bsr L04F2 + +*------------------------------------------------* +* Mark BlockMaps as Modules: + +L04CD puls u U=dir entry + ldx D.BlkMap X=mem block map + ldd MD$MBSiz,u D=mod block size + addd #$1FFF round up size ++ + lsra A/32 = number of blocks + lsra (8K) + lsra + lsra + lsra ++ + ldy MD$MPDAT,u Y=mod dat image + +L04DE pshs a,x save block size, blkmap + ldd ,y++ D=image block# + leax d,x X=blkmap ptr + ldb ,x get block marker + orb #ModBlock set module in block + stb ,x marker + puls a,x .. + deca count-1 + bne L04DE ..mark all blocks + + clrb okay + puls x,y,pc end. + +*------------------------------------------------* +* Clear entries: + +L04F2 pshs a,b,x,y,u + ldx ,x + pshs x + clra D=0000 + clrb +L04FA ldy ,x last entry? + beq L0503 ..yes + std ,x++ no, clear + bra L04FA and loop + +L0503 puls x + ldy 2,s + ldu MD$MPDAT,u U=mod images + puls a,b + +L050C cmpx ,y same image? + bne L051B ..no, try next + stu MD$MPDAT,y yes, set new image + cmpd MD$MBSiz,y new size bigger? + bcc L0519 ..yes, use it + ldd MD$MBSiz,y else use old size +L0519 std MD$MBSiz,y set modblock size +L051B leay MD$ESize,y next entry + cmpy D.ModEnd last? + bne L050C ..no + puls x,y,u,pc end. + +*------------------------------------------------* +L0524 pshs x,y,u save mod adrs,img, + ldd #M$Size get module size + lbsr LDDXY + addd ,s end = begin+size + addd #$1FFF round to block ++ + lsra A/32 + lsra + lsra + lsra + lsra ++, + tfr a,b A,B=number of blocks + pshs b save num + incb + aslb + negb + sex sign extend into D + bsr L054E make new dir entry + bcc L054C ..okay rts + + os9 F$GCMDir else get task# + ldu #$0000 set flag + stu 5,s + bsr L054E make new dir entry +L054C puls b,x,y,u,pc rts. + +*------------------------------------------------* +* Allocate module dir image: + +L054E ldx D.ModDAT X+D = mod DAT img pointer + leax d,x + cmpx D.ModEnd would it be below last dir? + bcs L0583 ..yes, err + + ldu 7,s get back old U + bne L056E .. + pshs x save new moddat ptr + ldy D.ModEnd Y=end of dir + leay MD$ESize,y plus new entry + cmpy ,s++ collide with moddat? + bhi L0583 ..yes, err + + sty D.ModEnd store new dir end + leay -MD$ESize,y Y=new dir entry ptr + sty 7,s return it to caller +L056E stx D.ModDAT store new moddat ptr + ldy 5,s + ldb 2,s B=block count + stx 5,s return dir datimg ptr + +L0577 ldu ,y++ copy images + stu ,x++ to new mod dat entry + decb + bne L0577 + + clr ,x zero flag + clr 1,x + rts end. + +L0583 orcc #Carry set err flag + rts end. + + +*------------------------------------------------* +* Calculate CRC of Module: +*------------------------------------------------* + +L0586 pshs x,y + clra D=offset of zero + clrb + lbsr LDDXY get 2 bytes + cmpd #M$ID12 is it module? + beq L0597 ..yes + ldb #E$BMID 'Bad Module Header' + bra L05F3 ..err end. + +* Check Module Header: + +L0597 leas -1,s make var + leax 2,x X=past sync bytes + lbsr L0AF0 set Y for X offset + ldb #$07 seven bytes + lda #$4A header crc +L05A2 sta ,s save crc + lbsr LDAXY get next byte + eora ,s do crc + decb more? + bne L05A2 ..loop + + leas 1,s drop var + inca $FF+1 = 00 + beq L05B5 ..okay header + ldb #E$BMHP 'Bad Module Header' + bra L05F3 err end. + +*------------------------------------------------* +* Do CRC across module: +* +* Added code to check init module for CRC check flag +L05B5 + ldx D.Init get Init module addr ++ BGP + +* Here the FastBoot definition says that if the INIT module cannot +* be found (as is the case when OS9p1 brings up the rest of the +* system with F$Boot), then don't do CRC checking. Note that +* module header checking above is still performed in this case. + ifeq FastBoot + beq L05CX if none, do CRC checking ++ BGP + else + beq NOCRC if none, DON'T DO CRC checking ++ BGP + endc + + lda Compat1,x get compat1 byte ++BGP + bita #CRCOn test CRCOn bit ++BGP + bne L05CX if set, check CRC ++BGP +NOCRC clra else clra ++BGP + clrb and clrb ++BGP + bra L05F5 branch to end of routine ++BGP +L05CX puls x,y + ldd #$0002 + lbsr LDDXY + pshs a,b,x,y + ldd #$FFFF set temp CRC register + pshs a,b + pshs b + lbsr L0AF0 set up Y for X offset + leau ,s +L05CB tstb + bne L05D8 + pshs x + ldx #$0001 + os9 F$Sleep + puls x +L05D8 lbsr LDAXY get a byte + bsr CRCCalc pass it through the CRC calculator + ldd 3,s + subd #$0001 + std 3,s + bne L05CB + puls b,x,y + cmpb #$80 + bne L05F1 + cmpx #$0FE3 + beq L05F5 +L05F1 ldb #E$BMCRC 'Bad Module CRC' +L05F3 orcc #Carry +L05F5 puls x,y,pc + +*------------------------------------------------* +* CRC Calculator: +*------------------------------------------------* + +* A = byte to be passed through accumulator +CRCCalc eora ,u + pshs a + ldd 1,u + std ,u + clra + ldb ,s + aslb + rola + eora 1,u + std 1,u + clrb + lda ,s + lsra + rorb + lsra + rorb + eora 1,u + eorb 2,u + std 1,u + lda ,s + asla + eora ,s + sta ,s + asla + asla + eora ,s + sta ,s + asla + asla + asla + asla + eora ,s+ + bpl L0635 + ldd #$8021 + eora ,u + sta ,u + eorb 2,u + stb 2,u +L0635 rts + +*------------------------------------------------* +* F$CRC +*------------------------------------------------* +FCRC ldd R$Y,u get byte count + beq L0677 ..zero + ldx R$X,u begin ptr + pshs a,b,x + leas -3,s + ldx D.Proc + lda P$Task,x + ldb D.SysTsk + ldx R$U,u + ldy #$0003 + leau ,s + pshs a,b,x,y + lbsr L0B2C + ldx D.Proc + leay P$DATImg,x + ldx 11,s + lbsr L0AF0 +L065D lbsr LDAXY + bsr CRCCalc pass byte through CRC calculator + ldd 9,s + subd #$0001 + std 9,s + bne L065D + puls a,b,x,y + exg a,b + exg x,u + lbsr L0B2C + leas 7,s +L0677 clrb + rts + +*------------------------------------------------* +* F$FModul +*------------------------------------------------* +* Find the Module named (X) with type (A) in Y +FFModul pshs u + lda R$A,u A=type request + ldx R$X,u X=name + ldy R$Y,u Y=DAT image ptr + bsr L068D find it + puls y + std R$D,y return type/attr + stx R$X,y updated name ptr + stu R$U,y module offset + rts + +L068D ldu #$0000 address flag + pshs a,b,u + bsr L0712 get first char + cmpa #PDELIM start with pathlist delimiter? + beq L070B ..bad name error + lbsr L0741 + bcs L070E + ldu D.ModEnd U=mod end ++ + bra L0700 + +*------------------------------------------------* +* Main Loop: + +L06A1 pshs a,b,x,y + pshs x,y + ldy MD$MPDAT,u Y=mod images + beq L06F6 + ldx MD$MPtr,u X=mod ptr + pshs x,y + ldd #M$Name get mod name + lbsr LDDXY offset + leax d,x X=name address + pshs x,y save add,images + leax 8,s + ldb 13,s + leay ,s + lbsr L07DE + leas 4,s + puls x,y + leas 4,s + bcs L06FE + ldd #M$Type get mod type/lang + lbsr LDDXY + sta ,s + stb 7,s + lda 6,s + beq L06ED + anda #$F0 + beq L06E1 + eora ,s + anda #$F0 + bne L06FE +L06E1 lda 6,s + anda #$0F + beq L06ED + eora ,s + anda #$0F + bne L06FE +L06ED puls a,b,x,y + abx + clrb + ldb 1,s + leas 4,s + rts + +*------------------------------------------------* +L06F6 leas 4,s + ldd 8,s + bne L06FE + stu 8,s +L06FE puls a,b,x,y + +* Moved back one ++ + +L0700 leau -MD$ESize,u next dir entry ++ + cmpu D.ModDir last one? ++ + bcc L06A1 ..no, loop ++ + +*------------------------------------------------* + ldb #E$MNF 'Module Not Found' + bra L070E + +L070B comb + ldb #E$BNam 'Bad Name' error +L070E stb 1,s return err code + puls a,b,u,pc + +*------------------------------------------------* +* Get Module Name: + +L0712 pshs y save image strt +L0714 lbsr L0AF0 point X to name in img(Y) + lbsr L0AC8 get char + leax 1,x ptr+1 + cmpa #C$SPAC was char space? + beq L0714 ..yes, skip + + leax -1,x ptr-1 + pshs a save char + tfr y,d D=image ptr + subd 1,s -images start + asrb block#=image/2 + lbsr L0AB0 ?? + puls a,y,pc rts. + + +*------------------------------------------------* +* F$PrsNam +*------------------------------------------------* +FPrsNam ldx D.Proc proc desc + leay P$DATImg,x Y=DAT image ptr + ldx R$X,u X=name string + bsr L0741 get it and length + std R$D,u return length in D + bcs L073E ..err + stx R$X,u and X at name begin + abx plus len +L073E stx R$Y,u return Y=end of name ptr + rts end. + +* Parse Name: + +L0741 pshs y save image ptr + lbsr L0AF0 find map block + pshs x,y save X offset within block and Y block pointer + lbsr LDAXY get A=byte(X) + cmpa #PDELIM is it a pathlist delimiter? + bne L0756 ..no, go keep X offset and block Y + leas 4,s + pshs x,y + lbsr LDAXY get next char +L0756 bsr L07A1 go check if valid first character... + bcs L076A not valid, go get next name start offset in X... + clrb initialize character counter +L075B incb incb add one character + tsta last character in name string? + bmi L0766 yes, go return valid... + lbsr LDAXY go get next character... + bsr L078A go check if valid character... + bcc L075B valid, go check if last character... +L0766 andcc #^Carry + bra L077C + +*------------------------------------------------* +L076A cmpa #C$COMA comma? + bne L0775 no, check for next character +L076E leas 4,s + pshs x,y + lbsr LDAXY +L0775 cmpa #C$SPAC is it a space? + beq L076E ..yes, go get next character + comb error, set Carry + ldb #E$BNam 'Bad Name' error +L077C puls x,y recover offset and pointer + pshs cc,a,b save Carry, character and count or error code + tfr y,d copy DAT image block pointer + subd 3,s subtract original DAT image pointer + asrb convert 2 byte/block count to block number + lbsr L0AB0 go get true map offset in X... + puls cc,a,b,y,pc recover registers and return... + +L078A pshs a save character + anda #$7F drop msbit + cmpa #PDIR period? + beq ValidChr yes, go return valid character... + cmpa #'0 is it control? + bcs InvalChr ..yes + cmpa #'9 is it number? + bls ValidChr ..yes + cmpa #'_ is it '_'? + bne L07A5 ..no +ValidChr clra clear carry + puls a,pc recover original character and return + +*---------------------------------------------- +L07A1 pshs a + anda #$7F drop msbit +L07A5 cmpa #'A less than "A"? + bcs InvalChr yes, go return invalid character... + cmpa #'Z less than or equal to "Z"? + bls ValidChr yes, go return valid character + cmpa #'a less than "a"? + bcs InvalChr yes, go return invalid character + cmpa #'z less than or equal to "z"? + bls ValidChr yes, go return valid character +InvalChr coma + puls a,pc + + +*------------------------------------------------* +* F$CmpNam +*------------------------------------------------* +FCmpNam ldx D.Proc proc desc + leay P$DATImg,x Y=caller DAT image ptr + ldx R$X,u X=first name + pshs x,y save name,img + bra L07CF do it + + +*------------------------------------------------* +* F$CmpNam (sys) +*------------------------------------------------* +SCmpNam ldx D.Proc proc desc + leay P$DATImg,x Y=images + ldx R$X,u X=first name + pshs x,y save name,imgs + ldy D.SysDAT Y=system DAT image ptr + +L07CF ldx R$Y,u X=second name + pshs x,y save name2,sysimg + ldd R$D,u D=match length + leax 4,s [X]=name1 + leay ,s [Y]=name2 + bsr L07DE compare them + leas 8,s drop vars + rts end. + +* Compare two strings: + +L07DE pshs a,b,x,y,u length,name1,name2,regs + ldu 2,s U=name1 ptr + pulu x,y get name,images + lbsr L0AF0 set X for img(Y) + pshu x,y save name1 offsets + ldu 4,s + pulu x,y + lbsr L0AF0 + bra L07F6 + +L07F2 ldu 4,s + pulu x,y +L07F6 lbsr LDAXY get name2 char + pshu x,y + pshs a save char + ldu 3,s + pulu x,y + lbsr LDAXY get name1 char + pshu x,y + eora ,s compare chars + tst ,s+ check result + bmi L0816 ..msb diff + decb len-1 + beq L0813 last? + anda #$DF + beq L07F2 do next char + +L0813 comb err + puls a,b,x,y,u,pc end. + +L0816 decb len-1 + bne L0813 ..err if >0 + anda #$5F + bne L0813 + clrb okay + puls a,b,x,y,u,pc end. + + +*------------------------------------------------* +* F$SRqMem / F$BtMem +*------------------------------------------------* +FSRqMem +FBtMem ldd R$D,u get # bytes wanted + addd #$00FF round up + clrb to page + std R$D,u return it + ldy D.SysMem Y=system mem map + leas -2,s + stb ,s +L082F ldx D.SysDAT X=system DAT image + aslb index block + ldd b,x D=DAT marker + cmpd #DAT.Free is it free? + beq L0847 ..yes + ldx D.BlkMap else look + lda d,x at block map byte + cmpa #RAMinUse is it in use? + bne L0848 ..yes + leay 32,y leave map ++ + bra L084F + +* Free Ram: + +L0847 clra + +* Ram Not in Use: + +L0848 ldb #32 count=32 pages ++ +L084A sta ,y+ mark the ram + decb + bne L084A + +L084F inc ,s + ldb ,s + cmpb #DAT.BlCt all blocks done? + bcs L082F +L0857 ldb R$A,u page count +L0859 cmpy D.SysMem back to map start? + bhi L0863 ..not yet + comb + ldb #E$NoRam was MemFul ++ + bra L0894 + +L0863 lda ,-y free page? + bne L0857 ..no,try again + decb else got page+1 + bne L0859 + sty ,s + lda 1,s + lsra + lsra + lsra + lsra + lsra ++ + ldb 1,s + andb #$1F ++ + addb R$A,u + addb #$1F ++ + lsrb + lsrb + lsrb + lsrb + lsrb ++ + ldx D.SysPrc + lbsr L09BE allocate ram images + bcs L0894 + ldb R$A,u +L088A inc ,y+ + decb + bne L088A + lda 1,s + std R$U,u return ptr to mem + clrb +L0894 leas 2,s + rts + + +*------------------------------------------------* +* F$SRtMem +*------------------------------------------------* +FSRtMem ldd R$D,u + beq L08F2 + addd #$00FF + ldb R$U+1,u + beq L08A6 + comb + ldb #E$BPAddr 'Boundary Error' + rts + +L08A6 ldb R$U,u + beq L08F2 + ldx D.SysMem + abx +L08AD ldb ,x + andb #^RAMinUse + stb ,x+ + deca + bne L08AD + ldx D.SysDAT + ldy #DAT.BlCt 16 blocks/space +L08BC ldd ,x + cmpd #DAT.Free free block? + beq L08EC ..yes + ldu D.BlkMap + lda d,u + cmpa #$01 + bne L08EC + tfr x,d + subd D.SysDAT + aslb + aslb + aslb + aslb ++ + ldu D.SysMem + leau d,u + ldb #32 16 blocks in sys space ++ +L08DA lda ,u+ + bne L08EC + decb + bne L08DA + ldd ,x + ldu D.BlkMap + clr d,u + ldd #DAT.Free + std ,x +L08EC leax 2,x + leay -1,y + bne L08BC +L08F2 clrb + rts + + +*------------------------------------------------* +* F$Boot +*------------------------------------------------* +FBoot comb + lda D.Boot booted already? + bne L0966 ..yes,rts. + inc D.Boot flag it +* ldx D.Init X=init module +* beq L0908 ..use default if no Init +* ldd BootStr,x offset to Boot name +* beq L0908 ..none +* leax d,x X=Init BootStrap name +* bra L090C use it + +L0908 leax BootMod,pcr default 'Boot' name +L090C lbsr LinkSys link to module + bcs L0966 ..err rts + jsr ,y do the boot + bcs L0966 ..err + std D.BtSz Bootfile size ++ + stx D.BtPtr Boot start address ++ + leau d,x + tfr x,d + anda #$E0 ++ + clrb + pshs a,b,u + lsra + lsra + lsra + lsra ++ + ldy D.SysDAT + leay a,y +*------------------------------------------------* +* Find & Verify Boot Modules: + +L092D ldd ,x get header + cmpd #M$ID12 (87CD) is it a module? + bne L0954 ..no + tfr x,d + subd ,s + tfr d,x + tfr y,d + os9 F$VModul + pshs b + ldd 1,s + leax d,x + puls b + bcc L094E + cmpb #E$KwnMod 'Known Module'? + bne L0954 ..no +L094E ldd 2,x + leax d,x + bra L0956 + +L0954 leax 1,x +L0956 cmpx 2,s end of boot mem? + bcs L092D ..no, try more + leas 4,s + ldx D.SysDAT ++ + ldb 13,x ++ + incb ++ + ldx D.BlkMap ++ + lbra L01DF ++ + +L0966 rts + + +*------------------------------------------------* +* F$AllRam +*------------------------------------------------* +FAllRam ldb R$B,u get # ram blocks desired + bsr L0970 + bcs L096F + std R$D,u +L096F rts + +*------------------------------------------------* +L0970 pshs a,b,x,y + ldx D.BlkMap X=block map start + +* Start at new block begin: + +L0974 leay ,x Y=start + ldb 1,s B=count +L0978 cmpx D.BlkMap+2 at end of block map? + bcc L0995 ..yes,end. + lda ,x+ is block free? + bne L0974 ..no, try new start + decb yes, count-1 + bne L0978 keep trying + +L0983 tfr y,d D=begin block ptr ++ + subd D.BlkMap D=begin block number + sta R$A-1,s return number on ,S + lda R$B-1,s A=count + stb R$B-1,s + +* mark off blocks + +L098D inc ,y+ mark as ram in use + deca + bne L098D + clrb + puls a,b,x,y,pc okay end. + +L0995 comb + ldb #E$NoRam 'Sys Ram Full' + stb 1,s return err + puls a,b,x,y,pc bad end. + +*------------------------------------------------* +* F$AlHRam +*------------------------------------------------* + +FALHRAM ldb R$B,u get block count ++ + bsr L09A5 find blocks ++ + bcs L09A4 error ++ + std R$D,u return count in D ++ + +L09A4 rts ++ + +L09A5 pshs a,b,x,y match up stack ++ + ldx D.BlkMap+2 point to end of map ++ + +L09A9 ldb R$B-1,s get block count ++ + +L09AB cmpx D.BlkMap at bottom of map? ++ + bls L0995 yes, error ++ + lda ,-x block free? ++ + bne L09A9 no ++ + decb found them all? ++ + bne L09AB no, continue ++ + tfr x,y match up registers ++ + bra L0983 allocate blocks ++ + +*------------------------------------------------* +* F$AllImg +*------------------------------------------------* +FAllImg ldd R$D,u A=begin blk#, B=# of blocks + ldx R$X,u X=proc desc +L09BE pshs a,b,x,y,u + asla + leay P$DATImg,x Y=DAT image ptr + leay a,y Y=image ptr + clra + tfr d,x + ldu D.BlkMap + pshs a,b,x,y,u +L09CD ldd ,y++ D=image + cmpd #DAT.Free unused? + beq L09E2 ..yes + lda d,u else what is it? + cmpa #RAMinUse ram? + puls a,b + bne L09F7 ..no + + subd #$0001 + pshs a,b +L09E2 leax -1,x + bne L09CD + ldx ,s++ + beq L0A00 +L09EA lda ,u+ + bne L09F2 + leax -1,x + beq L0A00 +L09F2 cmpu D.BlkMap+2 + bcs L09EA + +L09F7 ldb #E$MemFul 'Proc Memory Full' (207) + leas 6,s + stb R$B-1,s + comb + puls a,b,x,y,u,pc + +*------------------------------------------------* +L0A00 puls x,y,u +L0A02 ldd ,y++ + cmpd #DAT.Free + bne L0A16 +L0A0A lda ,u+ + bne L0A0A + inc ,-u + tfr u,d + subd D.BlkMap + std -2,y + +L0A16 leax -1,x + bne L0A02 + ldx 2,s + lda P$State,x get proc state & + ora #ImgChg flag image change + sta P$State,x . + clrb + puls a,b,x,y,u,pc + + +*------------------------------------------------* +* F$FreeHB +*------------------------------------------------* +FFreeHB ldb R$B,u B=block count + ldy R$Y,u + bsr L0A31 + bcs L0A30 + sta R$A,u +L0A30 rts + +L0A31 tfr b,a +L0A33 suba #$09 + nega + pshs x,b,a + ldd #$FFFF + pshs b,a + bra L0A58 + +FFreeLB ldb R$B,u + ldy R$Y,u + bsr L0A4B + bcs L0A4A + sta R$A,u +L0A4A rts + +L0A4B lda #$FF + pshs x,b,a + lda #$01 + subb #$09 + negb + pshs b,a + bra L0A58 + +L0A58 clra + ldb $02,s + addb ,s + stb $02,s + cmpb $01,s + bne L0A75 + ldb #$CF + cmpy DAT.Regs + lda ,x + clr >DAT.Regs + puls pc,cc + +LDAXY bsr L0AC8 + leax $01,x + bra L0AF0 + +L0AEA leax >-$2000,x + leay $02,y +L0AF0 cmpx #$2000 + bcc L0AEA + rts + +FLDDDXY ldd R$D,u + leau R$X,u + pulu y,x + bsr LDDXY + std -$07,u + clrb + rts +LDDXY pshs y,x + leax d,x + bsr L0AF0 + bsr LDAXY + pshs a + bsr L0AC8 + tfr a,b + puls pc,y,x,a + +FLDABX ldb R$B,u + ldx R$X,u + lbsr L0C12 + sta R$A,u + rts + +FSTABX ldd R$D,u + ldx R$X,u + lbra L0C28 + +FMove ldd R$D,u + ldx R$X,u + ldy R$Y,u + ldu R$U,u +L0B2C pshs u,y,x,b,a + leay ,y + lbeq L0BF2 + pshs y,b,a + tfr a,b + lbsr L0C0F + leay a,u + pshs y,x + ldb $09,s + ldx $0E,s + lbsr L0C0F + leay a,u + pshs y,x + ldd #$2000 + subd ,s + pshs b,a + ldd #$2000 + subd $06,s + pshs b,a + ldx $08,s + leax >-$6000,x + ldu $04,s + leau >-$4000,u +L0B6A pshs cc + ldd [<$07,s] + pshs b + ldd [<$0C,s] + pshs b + ldd <$11,s + cmpd $03,s + bls L0B82 + ldd $03,s +L0B82 cmpd $05,s + bls L0B89 + ldd $05,s +L0B89 cmpd #$0040 + bls L0B84 + ldd #$0040 +L0B84 std $0F,s + puls y + orcc #IntMasks + sty >$FFA5 + andb #$07 + beq L0B99 +L0B92 lda ,x+ + sta ,u+ + decb + bne L0B92 +L0B99 ldb $0E,s + lsrb + lsrb + lsrb + beq L0BBC + pshs b + exg x,u +L0BA4 pulu y,b,a + std ,x + sty $02,x + pulu y,b,a + std $04,x + sty $06,x + leax $08,x + dec ,s + bne L0BA4 + leas $01,s + exg x,u +L0BBC ldy $FFA5 + puls cc + ldd $0E,s + subd $0C,s + beq L0BEF + std $0E,s + ldd ,s + subd $0C,s + bne L0BD7 + ldd #$2000 + leax >-$2000,x + inc $0B,s + inc $0B,s +L0BD7 std ,s + ldd $02,s + subd $0C,s + bne L0BEA + ldd #$2000 + leau >-$2000,u + inc $07,s + inc $07,s +L0BEA std $02,s + lbra L0B6A +L0BEF leas <$10,s +L0BF2 clrb + puls pc,u,y,x,b,a + +L0BF5 pshs b + tfr x,d + anda #$1F + exg d,x + anda #$E0 + lsra + lsra + lsra + lsra +L0C07 puls pc,b +L0C0F bsr L0BF5 +*L0C09 pshs b --BGP +L0C09 + ldu DAT.Regs + lda ,x + clr >DAT.Regs + puls pc,u,x,b,cc + +L0C28 andcc #^Carry + pshs u,x,b,a,cc + bsr L0C0F + ldd a,u + lda $01,s + orcc #IntMasks + stb >DAT.Regs + sta ,x + clr >DAT.Regs + puls pc,u,x,b,a,cc + +FLDBBX andcc #^Carry + pshs u,x,a,cc + bsr L0C0F + ldd a,u + orcc #IntMasks + stb >DAT.Regs + ldb ,x + clr >DAT.Regs + puls pc,u,x,a,cc + +FAllTsk ldx R$X,u +L0C58 ldb P$Task,x + bne L0C64 + cmpx <$004A + beq L0C64 + bsr L0CA6 + bcs L0C65 + stb P$Task,x + bsr L0C79 +L0C64 clrb +L0C65 rts + +FDelTsk ldx R$X,u get proc desc ptr +L0C68 ldb P$Task,x + beq L0C65 + clr P$Task,x + bra L0CC3 +L0C70 lda P$State,x + bita #ImgChg + bne L0C79 + rts + +FSetTsk ldx R$X,u +L0C79 lda P$State,x + anda #^ImgChg + sta P$State,x + andcc #^Carry + pshs u,y,x,b,a,cc + ldb P$Task,x + leax P$DATImg,x + ldu D.SvcIRQ] + bcc L0D5B + ldx D.SvcIRQ] + puls a + bsr L0E39 + bcc XFIRQ + ldb R$CC,s + orb #IntMasks + stb R$CC,s +XFIRQ rti + +L0E29 clr ,-s +L0E2B ldx D.Poll] +S.POLL orcc #Carry + rts + +L0E4C ldb $06,x + orcc #IntMasks + bsr L0E8D + lda + leau P$NIO,u + ldb #NefIOSiz Net table size + +L0250 lda ,x+ + sta ,u+ + decb + bne L0250 + + puls x,u recover proc. desc. addresses + leax P$DIO,x copy default data/exec dirs: + leau P$DIO,u + ldb #DefIOSiz +L0261 lda ,x+ + sta ,u+ + decb + bne L0261 + + ldy #3 + +* dup 1st 3 paths: + +L026C lda ,x+ + beq L0276 skip if not open + os9 I$Dup + bcc L0276 + clra + +* as std in/out/err: + +L0276 sta ,u+ + leay -1,y count-1 + bne L026C + + ldx ,s X=child proc desc + ldu 2,s U=caller regs + lbsr L04B1 link/load mod, set proc desc + bcs L02CF ..err + pshs a,b save size + os9 F$AllTsk get task# for child + bcs L02CF + +L028C lda P$PagCnt,x D=mem amt + clrb + subd ,s D-mod size + tfr d,u U=dest + ldb P$Task,x B=child task# for parm copy + ldx U(B) *Y copy over data + + ldx ,s copy over child's stack + lda U(B) *Y + + puls x,u + os9 F$DelTsk release child task# + ldy 256? + beq L02FE ..no, ok + comb else + ldb #E$PrcFul 'Process Table Full' + bra L032F + +L02FE pshs b save index + ldd #P$Size get 512 bytes + os9 F$SRqMem for proc desc + puls a A=index + bcs L032F ..err + sta P$ID,u set proc ID + tfr u,d D=proc desc addrss + sta ,x set proc desc msb in table + + clra D=0000 + leax P$PID,u start after ID + ldy #$80 256 byte count +L0317 std ,x++ clear proc desc + leay -1,y + bne L0317 + + ldy + ldx + leau P$SP,u + ldy #$007E 252 byte count + +L03C3 ldd ,x++ copy bytes + std ,u++ + leay -1,y + bne L03C3 + + ldu 2,S get new proc desc address + leau P$DATImg,u point to DAT image + ldx ,S get old proc desc + lda P$Task,x get old task # + asla task # x2 is index + ldx blocks) + lsrb + lsrb + lsrb + lsrb + lda #DAT.BlCt max count=16 + pshs b -num used + suba ,s+ =number to release: + leay P$DATImg,x Y=images + aslb index + leay b,y first block + ldu #DAT.Free not used flag +L040C stu ,y++ clear proc images + deca + bne L040C + + ldu 2,s set new proc desc + stu + cmpx ,s++ dest ptr? + puls y size + bhi L0471 ..yes + beq L0474 same place + leay ,y size=zero? + beq L0474 ..yes + + pshs a,b,x + tfr y,d size + leax d,x source end ptr + pshs u save dest + cmpx ,s++ source within dest? + puls a,b,x + bls L0471 ..no + + pshs a,b,x,y,u + tfr y,d size + leax d,x source end ptr + leau d,u dest end ptr + +* Copy Parms: + +L0457 ldb ,s source task# + leax -1,x back up fm end + os9 F$LDABX get byte + exg x,u src <--> dest + ldb 1,s task# + leax -1,x back up dest ptr + os9 F$STABX store byte + exg x,u + leay -1,y cnt-1 + bne L0457 + + puls a,b,x,y,u + bra L0474 + +*------------------------------------------------* +L0471 os9 F$Move X(A)-->U(B) *Y +L0474 lda U(B) *Y copy from proc desc + puls x,u stack to user reg stack + lda P$ID,u get id + lbsr L0386 delete temp proc desc & free task# + os9 F$DelTsk delete task# + orcc #IntMasks halt interrupts + ldd 00 + inca else send to all ('cept zero) +L0647 cmpa ,x our proc? + beq L064D ..skip if is + bsr L0652 else send signal +L064D inca ID+1 + bne L0647 done 255? + clrb yep + rts end. + +*------------------------------------------------* +* Send signal to Proc A: + +L0652 lbsr L0B2E find proc desc + pshs cc,a,y,u + bcs L066A ..not found + tst R$B,u is signal = zero? (Kill) + bne L066D ..no + ldd P$User,x are we superuser? + beq L066D ..yes + cmpd P$User,y else same user? + beq L066D ..yes + ldb #E$IPrcID 'Illegal Proc ID' + inc ,s set carry bit +L066A lbra L06F4 + +L066D orcc #IntMasks stop interrupts + ldb R$B,u B=signal + bne L067B skip if not Kill + + ldb #E$PrcAbt 'Keyboard Abort' (#2) + lda P$State,y + ora #Condem condemn process + sta P$State,y + +* Wake Up Dest Process: + +L067B lda P$State,y + anda #^Suspend (F7) drop suspend + sta P$State,y state + lda P$Signal,y have signal now? + beq L068F ..no + deca else was it wake? + beq L068F ..yes + inc ,s set carry + ldb #E$USigP 'Signal Error' + bra L06F4 + +L068F stb P$Signal,y save signal + ldx #D.SProcQ-P$Queue search sleep queue + clra ticks left=0000 + clrb + +L0697 leay ,x Y is base desc + ldx P$Queue,x X is next qproc + beq L06D3 ..last + ldu P$SP,x else get process + addd R$X,u add ticks + cmpx 2,s same as dest proc desc? + bne L0697 ..no, loop + + pshs a,b save tick count + lda P$State,x is process time sleeping? + bita #TimSleep + beq L06CF ..no it's not + + ldd ,s get tick count + beq L06CF ..bra if none + ldd R$X,u get time left + pshs a,b save it + ldd 2,s get ticks left + std R$X,u make it new time left + puls a,b tick count + ldu P$Queue,x qproc after this one? + beq L06CF ..no + std ,s + lda P$State,u time sleeping? + bita #TimSleep + beq L06CF ..no its not + + ldu P$SP,u next proc SP + ldd ,s update tick count + addd R$X,u + std R$X,u + +L06CF leas 2,s drop + bra L06E0 give signal... + +*------------------------------------------------* +L06D3 ldx #D.WProcQ-P$Queue search wait queue +L06D6 leay ,x base proc desc + ldx P$Queue,x get next in queue + beq L06F4 ..end if none + cmpx 2,s signal dest proc? + bne L06D6 ..no + +L06E0 ldd P$Queue,x take proc out of queue + std P$Queue,y + lda P$Signal,x has signal + deca other than S$Wake? + bne L06F1 ..yes + sta P$Signal,x no, clear for wakeup + lda ,s restore CC + tfr a,cc +L06F1 os9 F$AProc insert proc in active queue +L06F4 puls cc,a,y,u,pc return. + +*------------------------------------------------* +* F$Icpt +*------------------------------------------------* +FIcpt ldx U(B) *Y + ldx U(B) *Y +L0962 rts end. + +*------------------------------------------------* +* F$GBlkMp +*------------------------------------------------* +FGblkMp ldd #$2000 RETURN 8K BLOCK SIZE + std R$D,u + ldd U(B) *Y + rts + +*------------------------------------------------* +* F$GModDr +*------------------------------------------------* +FGModDr ldd U(B) *Y + rts end. + +*------------------------------------------------* +* F$SUser +*------------------------------------------------* +FSUser ldx address + asla + asla + asla + clrb + addd MD$MPtr,u point to module + tfr d,x + os9 F$IODel delete I/O module + bcc L0A4B ..ok + + ldx MD$Link,u else if error, + leax 1,x + stx MD$Link,u increment link cnt + bra L0A4F + +L0A4B lbsr L01D5 clear moddir entry +L0A4E clrb ok +L0A4F rts end. + +*------------------------------------------------* +* F$Find64 +*------------------------------------------------* +FFind64 lda R$A,u get pd block number + ldx R$X,u get block address + bsr L0A5C find it + bcs L0A5B ..err + sty R$Y,u return address +L0A5B rts end. + +* Find Path/Process Descriptor: + +L0A5C pshs a,b save number, make space + tsta number=zero? + beq L0A70 ..yes,bad + clrb else... + lsra number/4 + rorb (point to block ptr) + lsra + rorb + lda a,x use index to get + tfr d,y block address + beq L0A70 ..none + tst ,y is block in use? + bne L0A71 ..yes, okay! +L0A70 coma set error +L0A71 puls a,b,pc return. + +*------------------------------------------------* +* F$All64 +*------------------------------------------------* +FAll64 ldx R$X,u get base page + bne L0A7F ..okay if have one + bsr L0A89 else allocate page + bcs L0A88 ..err + stx ,x insert first page flag + stx R$X,u return base page +L0A7F bsr L0A9F get one 64-byte block + bcs L0A88 ..err + sta R$A,u return block number + sty R$Y,u return block address +L0A88 rts end. + +*------------------------------------------------* +* Allocate Base Block: + +L0A89 pshs u save U + ldd #$0100 get 256-byte page + os9 F$SRqMem + leax ,u X=page address + puls u + bcs L0A9E ..err + clra A=00 + clrb 256 byte count +L0A99 sta d,x clear block + incb + bne L0A99 +L0A9E rts + +*------------------------------------------------* +* Find & Set Block In Use: + +L0A9F pshs x,u + clra +L0AA2 pshs a + clrb + lda a,x + beq L0AB4 + tfr d,y + clra +L0AAC tst d,y + beq L0AB6 + addb #64 + bcc L0AAC +L0AB4 orcc #Carry +L0AB6 leay d,y + puls a + bcc L0AE1 + inca try all pages + cmpa #64 until 64th page + bcs L0AA2 + + clra +L0AC2 tst a,x + beq L0AD0 + inca + cmpa #64 + bcs L0AC2 + + comb + ldb #E$PthFul 'Path Table Full' + bra L0AEE + +*------------------------------------------------* +L0AD0 pshs a,x + bsr L0A89 + bcs L0AF0 + leay ,x + tfr x,d + tfr a,b + puls a,x + stb a,x + clrb + +* D=Block Address: + +L0AE1 aslb + rola + aslb + rola + + ldb #$3F + +* Clear Block: + +L0AE7 clr b,y + decb + bne L0AE7 + sta ,y +L0AEE puls x,u,pc okay rts. + +L0AF0 leas 3,s drop vars + puls x,u,pc return. + +*------------------------------------------------* +* F$Ret64 +*------------------------------------------------* +FRet64 lda R$A,u + ldx R$X,u + pshs a,b,x,y,u + clrb + tsta + beq L0B22 + lsra + rorb + lsra + rorb + pshs a + lda a,x + beq L0B20 + tfr d,y + clr ,y + clrb + tfr d,u + clra +L0B10 tst d,u + bne L0B20 + addb #64 + bne L0B10 + inca + os9 F$SRtMem + lda ,s + clr a,x +L0B20 clr ,s+ +L0B22 puls a,b,x,y,u,pc + +*------------------------------------------------* +* F$GProcP +*------------------------------------------------* +FGProcP lda R$A,u get id + bsr L0B2E find proc esc + bcs L0B2D ..err + sty R$Y,u return pointer +L0B2D rts end. + +*------------------------------------------------* +* Find Process Descriptor A, address --> Y: + +L0B2E pshs a,b,x save id, etc + ldb ,s B=id + beq L0B40 ..can't be zero + ldx + + cmpa #DAT.BlCt over 16? (8 ON COCO) + bhi L0BAA ..err WAS BCC + + leas -$10,s + ldx R$X,u beginning block# desired + leay ,s point to local vars + ldb #1 ++BGP +L0B82 stx ,y++ put images +* leax 1,x desired on + abx ++BGP + deca the local stack + bne L0B82 + + ldb R$B,u number of blocks + ldx block# + lsra + lsra + lsra + lsra + cmpa R$B,u end of mem? + bcs L0BAA ..error +L0BCE lda P$State,x mark image change + ora #ImgChg + sta P$State,x + lda R$U,u get mem ptr + lsra index as image ptr + lsra + lsra + lsra + leay P$DATImg,x proc images + leay a,y point to block image + ldb R$B,u get block count + ldx #DAT.Free free flag +L0BE4 stx ,y++ clear image(s) + decb + bne L0BE4 +L0BE9 clrb okay + rts end. + +*------------------------------------------------* +* F$DelRam +*------------------------------------------------* +FDelRam ldb R$B,u get block count + beq L0C11 ..zero + ldd = 100? + blo HunDone ;If not, go do Tens + inca ;Increment hundreds digit + subb #100 ;Subtract 100 from B + bra Huns ;Go do again +HunDone leax HunDig,u ;Where to put digit + bsr WritDig ;Go put it there + clra ;Start A again as 0 +Tens cmpb #10 ;Is B >= 10? + blo TenDone ;If not, go do Ones + inca ;Increment hundreds digit + subb #10 ;Subtract 10 from B + bra Tens ;Go do again +TenDone leax TenDig,u ;Where to put digit + bsr WritDig ;Go put it there + tfr b,a ;Get ones digit + leax OneDig,u ;Where to put digit + bsr WritDig ;Go put it there + puls d,x,pc ;Restore registers and return +*+ +* FUNCTION WritDig +* PURPOSE Copy digit into user space +* TAKES A = digit to copy (not in ASCII yet) +* X = where to put digit +*- +WritDig equ * + pshs d ;Save registers + adda #'0 ;Convert A to ASCII + ldb P$Task,y ;Get task number + os9 F$StABX ;Write that digit to user space + puls d,pc ;Restore registers and return +*+ +* FUNCTION CalcNum +* PURPOSE Converts ASCII number in user space to binary +* TAKES Buf (in user space) = ASCII number +* GIVES B = number converted +* X = points to first nonnumeric character +*- +CalcNum equ * + pshs a ;Save register + leax Buf,u ;Get pointer to buffer + clrb ;Set accumulator to zero +NextDig bsr LoadDig ;Get digit from user space + suba #'0 ;Convert to binary; is it less than zero? + bmi CalcBye ;If so, return + cmpa #9 ;Is the digit more than nine? + bhi CalcBye ;If so, return + pshs a ;Save the digit while we multiply + lda #10 ;Multiply current number by 10 + mul ;Do it + addb ,s+ ;Add new digit to number + leax 1,x ;Advance X to next digit + bra NextDig ;Go get the next digit +CalcBye puls a,pc ;Restore register and return +*+ +* FUNCTION LoadDig +* PURPOSE Get digit from user space +* TAKES X = pointer to digit in user space +* GIVES A = digit in user space +*- +LoadDig equ * + pshs b ;Save register + ldb P$Task,y ;Get user process task number + os9 F$LdABX ;Get digit + puls b,pc ;Restore register and return +*+ +* FUNCTION PrinMsg +* PURPOSE Prints out the Error #xxx message +*- +PrinMsg equ * + pshs y,x,a ;Save registers + lda P$Path+2,y ;Get StdErr path number + leax Buf,u ;Get pointer to message + ldy #ErrLen ;Maximum ErrLen characters to print + os9 I$Write ;Write out error message + puls a,x,y,pc ;Restore registers and return +*+ +* FUNCTION DoCR +* PURPOSE Prints a carriage return +*- +DoCR equ * + pshs x,d ;Save registers + ldb P$Task,y ;Get user task number + lda #$0D ;Load A with a CR + leax Buf,u ;Get pointer to buffer + os9 F$StABX ;Move the CR to the buffer + bsr PrinBuf ;Go print it + puls d,x,pc ;Restore registers and return +*+ +* FUNCTION PrinBuf +* PURPOSE Prints out the string from user space +* TAKES X (in user space) = String to print +*- +PrinBuf equ * + pshs y,a ;Save registers + lda P$Path+2,y ;Get StdErr path number + ldy #BufLen ;Maximum BufLen characters to print + os9 I$WritLn ;Write out message + puls a,y,pc ;Restore registers and return +*+ +* FUNCTION RdBuf +* PURPOSE Reads in a string from file to user space +* TAKES A = path number +* GIVES Buf (in user space) = String read in +*- +RdBuf equ * + pshs y,x ;Save registers + leax Buf,u ;Get pointer to buffer + ldy #BufLen ;Maximum BufLen characters to read + os9 I$ReadLn ;Read in line from file + puls x,y,pc ;Restore registers and return +*+ +* FUNCTION OpenFil +* PURPOSE Open path to error message file +* TAKES Buf (in user space) = name of file +* GIVES A = Path number +*- +OpenFil equ * + pshs x ;Save register + lda #READ. ;Open path for read access + leax Buf,u ;Get pointer to string + os9 I$Open ;Open path + puls x,pc ;Restore registers and return A +*+ +* FUNCTION ClosFil +* PURPOSE Close path to error message file +* TAKES A = Path number +*- +ClosFil equ * + os9 I$Close ;Close file + rts ;Return +P4Name fcc "OS9p4" + fcb $D +ErrMsg fcc "Error #000" +ErrLen equ *-ErrMsg +FilNam fcc "/dd/sys/errmsg" + fcb $D +FilLen equ *-FilNam + emod +OS9End equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/MODULES/os9p4_regdump.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/MODULES/os9p4_regdump.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,328 @@ + +* +* Copyright February,1989 by Ron Lammardo +* +* This system call can be used in an application program to dump the +* current contents of all user registers in Hex,Decimal,Binary and Ascii +* (Registers "A" and "B" Only). This module MUST be present in the +* bootfile. If no OS9P3 module is found,change the "mname" and "nextname" +* as appropriate. +* +* +* If there is a conflict with the code used for this system called, it can +* be changed by resetting the equate at "F$RegDmp" +* +* NOTE: All registers EXCEPT 'CC' are preserved....OS9 internally resets +* the condition code register upon service call exit. + + nam os9p4 + ttl User Register Dump System Call for OS9 Level-II + + ifp1 + use defsfile + endc + +typelang set systm+objct +attrev set reent+revision +revision set 1 +edition set 1 + + mod Eom,Mname,Typelang,Attrev,Start,0 + +mname + fcs /OS9P4/ name of this module + fcb edition + +svctabl + fcb F$RegDmp F$RegDmp code + fdb regdmp-*-2 offset to actual code + fcb $80 end of table + +start + leay + leax reg080,pcr point to start of control table + clra clear msb of register + ldb R$A,y get register from stack + bsr reg000 dump register A + ldb R$B,y get register from stack + bsr reg000 dump regsietr B + inc -1,u turn off ascii char print flag + ldd R$X,y get register from stack + bsr reg000 dump register X + ldd R$Y,y get register from stack + bsr reg000 dump regisetr Y + ldd R$U,y get register from stack + bsr reg000 dump register U + ldb R$CC,y get register from stack + bsr reg000 dump register CC + ldb R$DP,y get register from stack + bsr reg000 dump register DP + ldd R$PC,y get user Task Number + bsr reg000 dump register PC + ldy + leas 60,s restore stack pointer + puls cc,a,b,dp,x,y,u,pc restore all registers and return + +* Dump a register in "D" +* X = Control Table Location +* U = Output buffer Location + +reg000 + pshs y save y register + tfr d,y register in y + lda ,x # of bytes + leax 3,x point past table entry + pshs a,x,y,u save registers + ldd -2,x get register name + std ,u++ move to buffer + ldd #"=$ get chars + std ,u++ move to buffer + ldd 3,s get reg + lbsr gethex convert to hex + tst 0,s 1 byte ? + bne reg010 no...skip this + ldd 2,u get 2 lsb's + std ,u store in msb's + ldd #$2020 get two blanks + std 2,u store in lsb's + +reg010 + ldd #$2023 get a space and "#" + std 4,u move in two spaces + leau 6,u point to start of decimal output buffer + ldd 3,s get register + lbsr getdec convert to decimal + tst 0,s is it one byte + bne reg020 no..skip this + ldd 2,u else get third & fourth chars + std ,u store as first two + lda 4,u get fifth char + sta 2,u store as third + ldd #$2020 get two spaces + std 3,u store as 4th & 5th chars + +reg020 + ldd #$2025 get a blank & "%" + std 5,u move it to buffer + leau 7,u point to start of binary output area + tfr a,b space in 'b' + std 16,u space out ascii char + ldd 3,s get register + bsr getbin convert to binary + tst 0,s check byte count + bne reg040 skip if two bytes + ldb #8 loop counter + +reg030 + lda 8,u get two chars from second 8 digits + sta ,u+ store in first 8 digits + lda #$20 get two blanks + sta 7,u store in second 8 digits + decb decrement counter + bne reg030 loop back if not done + leau -8,u back up to beginning of binary digit output + ldb 4,s get lsb of register + tst -18,u check if we want to print ascii char + bne reg040 nope..skip this + cmpb #$20 compare char with space + blo reg040 if lower..skip this + cmpb #'z compare with last alpha char + bhi reg040 if higher..skip this + stb 17,u else store the char + +reg040 + lda #$0d get a + sta 18,u and store it + leax -17,u back up to buffer start + bsr reg070 send it + clra clear msb for next reg + puls b,x,y,u restore registers + puls y,pc restore y & return + +reg050 + fcb $0d + +reg060 + leax + +reg070 + pshs x,y,u,a,b save registers + ldy +* 8 UL +* 7 UH +* 6 YL + +* 5 YH +* 4 XL +* 3 XH +* 2 A +* 1 PL +* SP-> 0 PH +* + +IOMAGIC equ 5 ;5 bytes to PD pointer + +* Local pipe buffer equates + +CInit equ %00100000 ;Set this bit to override PD queue parameters + +* Conditional assembly + +ANON set 0 ;Anonymous pipes only +NAMED set 1 ;Anonymous and named pipes +MSGS set 2 ;Both types of pipes, and message queues +WIZBANG set NAMED ;What features are we providing? + +NODIR set 0 ;Don't allow DIR on pipe devices +YESDIR set 1 ;Allow DIR on pipe devices +PIPEDIR set YESDIR ;Does DIR work on pipes? + +SLOWPD set 0 ;Slow PD location algorithm +QUICKPD set 1 ;Fast PD location algorithm +PDALGO set QUICKPD ;How to convert PD to system path # + +RECKLES set 0 ;Don't check for certain errors +CAREFUL set 1 ;Check for certain errors +CAUTION set CAREFUL + + page +* +* Module Header +* + +edition set 1 + + mod MODSIZE,MODNAM,FlMgr+Objct,ReEnt+XVER,JmpTbl,$0000 + +* Module Name + +MODNAM fcs "PipeMan" + fcb edition + +* Jump table + +JmpTbl lbra Create + lbra Open + lbra MakDir + lbra ChgDir + lbra Delete + lbra Seek + lbra Read + lbra Write + lbra ReadLn + lbra WriteLn + lbra GetStt + lbra SetStt + lbra Close + + page +* +* Create a named or anonymous pipe +* +* The size of the queue is determined by examining +* the path descriptor, since this information has +* been copied there from the device descriptor. +* +* Reg-U points to stacked registers of user. +* Reg-Y points to path descriptor +* +* If success, carry clear and X points to pipe buffer +* + +* Create function allows user to override both element +* count and element size. Override is enabled if if bit +* 5 of the access mode is set. For override, if MS bit +* of Reg-Y is clear, just use Reg-Y as queue element +* count. If MS bit of Reg-Y is set, use LS byte of +* Reg-Y as element size ($00 = no change) and bottom 7 +* bits of MS byte of Reg-Y as element count ($00 = no change) + +Create equ * + + lda R$A,U ;Get access mode + bita #CInit + beq Open + +* Handle queue size override + + ldd R$Y,U ;Get queue size initializer + bpl SetCnt ; (branch if just setting count) + +* Set element size and count + + tstb + beq Creat00 ; (branch if using default size) + + stb PD.ESiz,Y ;Reg-B = size of each element + +Creat00 anda #$7F + beq Open ; (branch if using default count) + + tfr a,B + clra + +* Set number of elements in queue from Reg-D + +SetCnt std PD.ECnt,Y ;Reg-D = number of elements + +* Enter here for normal OPEN + +Open equ * + +* Move number of elements in queue to make room for name + + ldd PD.ECnt,Y + std PD.QSiz,Y + +* Parse pathname + + clrb ;Assume anonymous pipe + clra ;Assume not 1st pipe + ldx R$X,U ;Point at file name in user's space + pshs U,Y,X,D ;Save file name, PD, reg. base, 1st & anon flag + +* Caller's Regs Ptr +* PD Ptr +* Path name uptr +* Named flag +* SP-> First flag + + os9 F$PrsNam ;Error if driver name (e.g. /pipe) invalid + bcs BadName + +* See if named or anonymous pipe requested. + + lbsr GtNext ;Return CC=MI if at end of path name + cmpa #'/ + beq HasName + +* /pipe____ +* X Y +* Pipe is anonymous -- set up dummy name in PD. +* Stack must match the named pipe setup + +NotName tfr Y,X ;Skip any trailing blanks + os9 F$PrsNam ; (should return carry set) + ldd #1 ;Length of dummy name + pshs Y,X,D + + ldy 10,S ;Get PD pointer + clr PD.Name,Y ; and set dummy name + + bra GoCheck + +* /pipe/foo____ +* X Y +* Pipe is named -- check length and flag on stack + +HasName tfr Y,X + os9 F$PrsNam ;Scan off the name + bcs BadName + + cmpb #NameMax ;Check length of name + bhi BadName + +* Length OK. X points to start of name, Y to end of name, +* B has name length. +* Save registers & length, and do final parse to skip white + + com 1,S ;Set "named" flag + clra + pshs Y,X,D + + tfr Y,X + os9 F$PrsNam ;Error if trying for pipe subdirectory + bcc BadNam2 + +* /pipe/foo____ +* X Y +* Need to get the pipe name into our address space +* Use the PD for a temporary buffer. + +NameOK ldx + +GoCheck ldx 10,S ;Get PD pointer + ldx PD.DEV,X ;Get device table pointer + ldu V$Stat,X ;Get static storage pointer + ldx V.List,U ;Get pointer to head of pipe bfr linked list + bne Not1st ; (reg-X = $0000 if no previous pipes) + +* This is the 1st pipe for this descriptor. +* Reg-X = $0000 +* Set flag and process as a new pipe. + + com 6,S ;This is the first pipe + bra NewPipe ;This is a new pipe + +* No time like the present for some error handlers + +* Generic error, cleaning stack + +BadXit2 leas 8,S + coma ;Set carry + rts + +* Bad Pathname -- 2 versions, depending on +* how much junk is on the stack. + +BadNam2 leas 6,S ;Clean stack +BadName ldb #E$BPNam + bra BadXit2 + +* Not Enough System RAM + +TooBig ldb #E$NoRAM +BadExit leas 6,S ;Clean stack + bra BadXit2 + +* Look up the pipe name, unless the pipe is anonymous. +* +* Reg-U points to driver static storage. +* Reg-X points to next pipe buffer to check. + +Not1st tst 7,S ;Unnamed pipes are always new + beq NewPipe + + ldy 10,S ;point at PD + leay PD.Name,Y ; then point at name in PD + +* Main loop. Always at least 1 pipe buffer to check first time through. +* Reg-X points to buffer to check, or $0000 if none. +* Reg-Y points to desired pipe name. + +ChkLoop pshs X + ldx PP.PD,X ;Point at PD for this pipe buffer + leax PD.Name,X ; and then point at name stored in PD + lbsr Compare + puls X + lbeq OldPipe ; (got a match) + + ldd PP.Next,X ;Don't fall off the edge + beq NewPipe ; (end of list) + + tfr D,X ;Advance to next buffer + bra ChkLoop + +* Pipe name not found. Create a new pipe. +* +* Reg-U points to driver static storage. +* Reg-X points to last pipe buffer checked ($0000 if 1st pipe) + +NewPipe ldy 10,S ;Get PD pointer + + ifeq (PIPEDIR-YESDIR) + lda PD.MOD,Y ;Check pipe attributes + bita #DIR. + beq NEWP1 + +* Initialize pipe characteristics for DIR. bit set + + lbsr SizDirP +* beq XYZZY ;Special if no pipes created + endc + +* Normal (non-dir) processing + +NewP1 ldd PD.QSiz,Y ;Get max element count + bne DoNew ; (graceful operation if no count) + +* Default pipe parameters if none in PD. + + ldd #$0100 ;Assume 256 byte buffer, 1 byte element + sta PD.ESiz,Y ;Reg-A = 1 + subd #PP.Data ;Compute elements for total size = 256 + std PD.QSiz,Y Use parameters in PD + +DoNew lbsr ECtoBC ;Convert element count to byte count in D + bcs TooBig ; (carry set if too big) + +* Carry has exit status +* Reg-D = # bytes for queue, w/o overhead +* Reg-X = previous buffer +* Reg-U = driver static storage + + tfr U,Y ;Save static storage pointer + + addd #PP.Data ;Add in overhead + bcs TooBig + + pshs D ;Save buffer size + os9 F$SrqMem ;Attempt to allocate buffer + puls D ;Recover size, clean stack, lose error msg + bcs TooBig + +* Found enough memory for pipe buffer. +* +* Pointer in Reg-U +* Size in Reg-D +* Previous buffer in Reg-X. +* Driver static storage in Reg-Y. +* +* Initialize the buffer + + pshs U,D ;Save buffer pointer & size + +* Clear pipe buffer header + + ldb #PP.Data ;Size of header +ClrBuf clr ,U+ + decb + bne ClrBuf + + puls D,U + +* Initialize path descriptor and other fields of pipe buffer +* for new pipe. +* +* Pointer in Reg-U +* Size in Reg-D +* Previous buffer in Reg-X. +* Driver static storage in Reg-Y. +* +* IOMan has already prefilled the PD to $00 and +* has set PD.CNT for this path to 1. + + pshs Y,X ;Save static storage pointer & prev.buff + + ldy (4+10),S ;Get PD pointer to Reg-Y + sty PP.PD,U ;Save pointer to PD in pipe buffer + + leax D,U ;Point to end of pipe.buff + 1 + stx PD.End,Y + + leax PP.Data,U ;Initial Next in & Next out pointers + stx PD.NxtI,Y + stx PD.NxtO,Y + + ldx 1) + +* Internal error + +IntErr comb + ldb #255 + rts + +NOTEOF comb Set Error Flag ++ + ldb #E$NOTRDY Get Error Code ++ + rts Return ++ + +* Not SS.Ready. Check for SS.Siz + +NotSSRdy cmpa #SS.Size Test for Size call + bne NotSSSiz + +* Process SS.Siz -- return size of queue in ELEMENTS. + +G.Siz ldd PD.QSiz,Y ;Get max. # of queue elements + std R$U,U + clr (R$X+0),U Set 16 MSB's to $0000 + clr (R$X+1),U +GOK001 bra G.OK + +* Not SS.Siz. Check for SS.EOF + +NotSSSiz cmpa #SS.EOF + bne NotSSEOF + +* Process SS.EOF +* Handle like SS.Rdy, but preserve Reg-B + +G.EOF bsr G.Siz + ldb #0 ;NOT clrb -- preserve carry + stb R$B,U + bcc G.OK ;No error if ready + + ldb #E$EOF ;Carry is already set + rts + +* Not SS.EOF. Check for SS.FD + + ifeq (PIPEDIR-YESDIR) +NotSSEOF cmpa #SS.FD + bne NotSSFD + +* Process SS.FD + + lbsr DoSSFD + bra G.OK ;Successful always + else +NotSSEOF equ * + endc + +* Not SS.FD. Check for SS.ScSiz + +NotSSFD cmpa #SS.ScSiz ;Force UNKNOWN here + lbeq UnKnown + +NotSCSZ equ * + +NotSSAT equ * + +* Process unknown GETSTT + +* lbra UNKNOWN + bra G.OK +* bra NotEOF + + page +* +* SETSTT processing +* +* Supports the following codes: +* +* SS.Opt Option section +* SS.Siz No effect unless size=0; then clears pipe buffer +* SS.FD No effect +* SS.SSig Set signal on data available +* SS.Relea Release signal +* +* SS.Opt handled in IOMAN, etc. +* SS.Siz, SS.SSig, SS.Relea by Chris Burke, modified +* from OSK. +* + +SetStt lda R$B,U Get User B Register ++ + cmpa #SS.Opt + beq SST.Ign ; (ignore) + cmpa #SS.FD + beq SST.Ign + +* Check for SS.SIZ + + cmpa #SS.Size + bne NoS.Siz + + ldd R$U,U ;Get caller's size + bne SST.Ign + +* Clear the pipe + + ldx PD.Buf,Y + leau PP.Data,X + stu PD.NxtI,Y + stu PD.NxtO,Y + clr (PD.BCnt+0),Y + clr (PD.BCnt+1),Y + clr PD.RFlg,Y + clr PD.Wrtn,Y + +QST.OK bra SST.OK + +* Check for SS.SSig + +NoS.Siz cmpa #SS.SSig + bne NoS.Sig + + leax PD.Read,Y ;Point at read packet + tst PM.Cpr,X ;Error if already somebody waiting + bne NOTEOF + +* Set signal trap + + lda PD.CPR,Y ;Set process ID + sta PM.CPR,X + lda (R$X+1),U ;Get signal code + sta PM.Sig,X + tst PD.BCnt,Y ;Immediate signal if + lbne SendSig + + bra QST.OK + +* Check for release of signal + +NoS.Sig cmpa #SS.Relea + bne NoS.Rel + + leax PD.Read,Y ;Point at read packet + lda PM.CPR,X + cmpa PD.CPR,Y ;Our process set it? + bne QST.OK + +* Release signal trap + + clrb + lbra Switch + +* Not SS.Relea. Check for SS.Attr + +NoS.Rel cmpa #SS.Attr + bne NoS.Atr + +* Change attributes if allowed + + ldx $0100,u +L0180 clra + clrb + tfr d,x +L0184 pshu x,b,a + cmpu $04,s + bhi L0184 + puls pc,u,x,b,a +L018D pshs y + lbsr L07B5 + bcs L0170 + ldu $06,y + stx $04,u + ldd <$35,y + bne L01CA + lda <$34,y + bne L01CA + ldb $01,y + andb #$80 + lbne L02AF + std <$16,y + sta <$18,y + std <$13,y + sta <$15,y + ldx <$1E,y + lda $02,x + std <$11,y + sta <$1B,y + ldd ,x + std $0F,y + std <$19,y + puls pc,y +L01CA lda $01,y + lbsr L09E6 + bcs L0170 + bita #$02 + beq L01DB + lbsr L02D1 + lbsr L1206 +L01DB puls y +L01DD clra + clrb + std $0B,y + std $0D,y + std <$13,y + sta <$15,y + sta <$19,y + lda ,u + sta <$33,y + ldd <$10,u + std <$16,y + lda <$12,u + sta <$18,y + ldd <$13,u + std <$1A,y + ldd $09,u + ldx $0B,u + ldu <$30,y + cmpu $05,u + beq L0218 + ldu $05,u + ldu $01,u + ldd $0F,u + ldx <$11,u +L0218 std $0F,y + stx <$11,y + clr $0A,y + rts +L0220 lbsr L0039 + bcs L0273 + lda <$33,y + ora #$40 + lbsr L09E6 + bcs L0273 + ldd #$0040 + std <$11,y + bsr L0285 + bcs L0273 + lbsr L0C78 + bcs L0273 + lbsr L112C + ldu $08,y + lda ,u + ora #$80 + sta ,u + bsr L0278 + bcs L0273 + lbsr L017A + ldd #$2EAE + std ,u + stb <$20,u + lda <$37,y + sta <$1D,u + ldd <$38,y + std <$1E,u + lda <$34,y + sta <$3D,u + ldd <$35,y + std <$3E,u + lbsr L120E +L0273 bra L02B4 +L0275 lbsr L112C +L0278 ldx $08,y + ldd $0F,y + std $09,x + ldd <$11,y + std $0B,x + clr $0A,y +L0285 lbra L1206 +L0288 clra + tst $02,y + bne L02AE + lbsr L1240 + bcs L02B4 + ldb $01,y + bitb #$02 + beq L02B4 + ldd <$34,y + bne L02A2 + lda <$36,y + beq L02B4 +L02A2 bsr L0275 + lbsr L05EE + bcc L02B4 + lbsr L0F07 + bra L02B4 +L02AE rts +L02AF ldb #$D6 +L02B1 coma +L02B2 puls y +L02B4 pshs b,cc + ldu $08,y + beq L02CF + ldd #$0100 + os9 F$SRtMem + ldx <$30,y + beq L02CF + lbsr L0A99 + lda ,x + ldx <$0088 + os9 F$Ret64 +L02CF puls pc,b,cc +L02D1 lbsr L112C + ldu $08,y + lda $08,u + ldx <$0050 + pshs x,a + ldx <$004A + stx <$0050 + leax $03,u + os9 F$Time + puls x,a + stx <$0050 + sta $08,u + rts +L02EC pshs y + lda $01,y + ora #$80 + sta $01,y + lbsr L018D + bcs L02B2 + ldx <$0050 + ldu <$35,y + ldb $01,y + bitb #$03 + beq L030D + ldb <$34,y + stb <$23,x + stu <$24,x +L030D ldb $01,y + bitb #$04 + beq L031C + ldb <$34,y + stb <$29,x + stu <$2A,x +L031C clrb + bra L02B2 +L031F pshs y + lbsr L07B5 + bcs L02B2 + ldd <$35,y + bne L0332 + tst <$34,y + lbeq L02AF +L0332 lda #$42 + lbsr L09E6 + lbcs L02B2 + ldu $06,y + stx $04,u + lbsr L112C + lbcs L03D7 + ldx $08,y + dec $08,x + beq L0358 + lbsr L1206 + nop + pshs u,x,b + clra + clrb + std $03,s + bra L03A2 +L0358 ldb <$34,y + ldx <$35,y + pshs u,x,b + ldd #$0100 + os9 F$SRqMem + bcc L036C + clra + clrb + bra L037A +L036C stu $03,s + ldx $08,y + clrb +L0371 lda ,x+ + sta ,u+ + decb + bne L0371 + ldd $03,s +L037A std $03,s + clra + clrb + std $0F,y + std <$11,y + lbsr L0F07 + bcs L03F7 + ldb <$34,y + ldx <$35,y + stb <$16,y + stx <$17,y + ldx $08,y + ldd <$13,x + addd #$0001 + std <$1A,y + lbsr L0FD5 +L03A2 bcs L03F7 + lbsr L1240 + lbsr L0A99 + lda <$37,y + sta <$34,y + ldd <$38,y + std <$35,y + lbsr L112C + bcs L03F7 + lbsr L0A33 + ldu $08,y + lbsr L01DD + ldd <$3A,y + std $0B,y + ldd <$3C,y + std $0D,y + lbsr L0960 + bcs L03F7 + clr ,x + lbsr L120E +L03D7 ldu $03,s + beq L0402 + ldb ,s + ldx $01,s + stb <$34,y + stx <$35,y + ldx <$08,y + stx <$01,s + stu <$08,y + lbsr L1206 + ldu <$01,s + stu <$08,y +L03F7 ldu <$03,s + beq L0402 + ldd #$0100 + os9 F$SRtMem +L0402 leas $05,s + lbra L02B2 +L0407 ldb $0A,y + bitb #$02 + beq L0420 + lda $05,u + ldb $08,u + subd $0C,y + bne L041B + lda $04,u + sbca $0B,y + beq L0424 +L041B lbsr L1240 + bcs L0428 +L0420 ldd $04,u + std $0B,y +L0424 ldd $08,u + std $0D,y +L0428 rts +L0429 bsr L046C + beq L044F + bsr L0450 + pshs u,y,x,b,a + exg x,u + ldy #$0000 + lda #$0D +L0439 leay $01,y + cmpa ,x+ + beq L0442 + decb + bne L0439 +L0442 ldx $06,s + bsr L04A4 + sty $0A,s + puls u,y,x,b,a + ldd $02,s + leax d,x +L044F rts +L0450 lbsr L04DC + leax -$01,x + lbsr L0988 + cmpa #$0D + beq L0462 + ldd $02,s + lbne L04E2 +L0462 ldu $06,y + ldd $06,u + subd $02,s + std $06,u + bra L04C9 +L046C ldd $06,u + lbsr L0B15 + bcs L04A0 + ldd $06,u + bsr L047C + bcs L04A0 + std $06,u + rts +L047C pshs b,a + ldd <$11,y + subd $0D,y + tfr d,x + ldd $0F,y + sbcb $0C,y + sbca $0B,y + bcs L049D + bne L049A + tstb + bne L049A + cmpx ,s + bcc L049A + stx ,s + beq L049D +L049A clrb + puls pc,b,a +L049D comb + ldb #$D3 +L04A0 leas $02,s + bra L04CE +L04A4 pshs x + ldx <$0050 + lda <$00D0 + ldb $06,x + puls x + os9 F$Move + rts +L04B2 bsr L046C + beq L04C4 + bsr L04C5 +L04B8 pshs u,y,x,b,a + exg x,u + tfr d,y + bsr L04A4 + puls u,y,x,b,a + leax d,x +L04C4 rts +L04C5 bsr L04DC + bne L04E2 +L04C9 clrb +L04CA leas -$02,s +L04CC leas $0A,s +L04CE pshs b,cc + lda $01,y + bita #$02 + bne L04D9 + lbsr L0B0B +L04D9 puls b,cc + rts +L04DC ldd $04,u + ldx $06,u + pshs x,b,a +L04E2 lda $0A,y + bita #$02 + bne L0502 + tst $0E,y + bne L04FD + tst $02,s + beq L04FD + leax >L057A,pcr + cmpx $06,s + bne L04FD + lbsr L10A1 + bra L0500 +L04FD lbsr L125F +L0500 bcs L04CA +L0502 ldu $08,y + clra + ldb $0E,y + leau d,u + negb + sbca #$FF + ldx ,s + cmpd $02,s + bls L0515 + ldd $02,s +L0515 pshs b,a + jsr [<$08,s] + stx $02,s + lda $0A,y + anda #$BF + sta $0A,y + ldb $01,s + addb $0E,y + stb $0E,y + bne L0539 + lbsr L1240 + inc $0D,y + bne L0537 + inc $0C,y + bne L0537 + inc $0B,y +L0537 bcs L04CC +L0539 ldd $04,s + subd ,s++ + std $02,s + jmp [<$04,s] +L0542 pshs y + clrb + ldy $06,u + beq L0567 + ldx <$0050 + ldb $06,x + ldx $04,u +L0550 leay -$01,y + beq L0567 + os9 F$LDABX + leax $01,x + cmpa #$0D + bne L0550 + tfr y,d + nega + negb + sbca #$00 + addd $06,u + std $06,u +L0567 puls y +L0569 ldd $06,u + lbsr L0B15 + bcs L05A1 + ldd $06,u + beq L05A0 + bsr L05A2 + bcs L05A1 + bsr L058B +L057A pshs y,b,a + tfr d,y + bsr L05D4 + puls y,b,a + leax d,x + lda $0A,y + ora #$03 + sta $0A,y + rts +L058B lbsr L04DC + lbne L04E2 + leas $08,s + ldy <$30,y + lda #$01 + lbsr L0ADA + ldy $01,y +L05A0 clrb +L05A1 rts +L05A2 addd $0D,y + tfr d,x + ldd $0B,y + adcb #$00 + adca #$00 +L05AC cmpd $0F,y + bcs L05A0 + bhi L05B8 + cmpx <$11,y + bls L05A0 +L05B8 pshs u + ldu <$11,y + stx <$11,y + ldx $0F,y + std $0F,y + pshs u,x + lbsr L0C78 + puls u,x + bcc L05D2 + stx $0F,y + stu <$11,y +L05D2 puls pc,u +L05D4 pshs x + ldx <$0050 + lda $06,x + ldb <$00D0 + puls x + os9 F$Move + rts +L05E2 ldb $02,u + cmpb #$00 + beq L0608 + cmpb #$06 + bne L05F4 + clr $02,u +L05EE clra + ldb #$01 + lbra L047C +L05F4 cmpb #$01 + bne L05FB + clr $02,u + rts +L05FB cmpb #$02 + bne L0609 + ldd $0F,y + std $04,u + ldd <$11,y + std $08,u +L0608 rts +L0609 cmpb #$05 + bne L0616 + ldd $0B,y + std $04,u + ldd $0D,y + std $08,u + rts +L0616 cmpb #$0F + bne L0630 + lbsr L112C + bcs L0608 + ldu $06,y + ldd $06,u + tsta + beq L0629 + ldd #$0100 +L0629 ldx $04,u + ldu $08,y + lbra L04B8 +L0630 cmpb #$20 + bne L0649 + lbsr L1240 + bcs L0608 + ldb $06,u + ldx $08,u + lbsr L1143 + bcs L0608 + ldu $06,y + ldd $06,u + clra + bra L0629 +L0649 lda #$09 + lbra L1145 +L064E ldb $02,u + cmpb #$00 + bne L0662 + ldx $04,u + leax $02,x + leau <$22,y + ldy #$000D + lbra L05D4 +L0662 cmpb #$02 + bne L06A4 + ldd <$35,y + bne L0672 + tst <$34,y + lbeq L07B1 +L0672 lda $01,y + bita #$02 + beq L06A0 + ldd $04,u + ldx $08,u + cmpd $0F,y + bcs L068B + bne L0688 + cmpx <$11,y + bcs L068B +L0688 lbra L05AC +L068B std $0F,y + stx <$11,y + ldd $0B,y + ldx $0D,y + pshs x,b,a + lbsr L0F07 + puls u,x + stx $0B,y + stu $0D,y + rts +L06A0 comb + ldb #$CB +L06A3 rts +L06A4 cmpb #$0F + bne L06E2 + lda $01,y + bita #$02 + beq L06A0 + lbsr L112C + bcs L06A3 + pshs y + ldx $04,u + ldu $08,y + ldy <$0050 + ldd $08,y + bne L06C5 + ldd #$0102 + bsr L06D4 +L06C5 ldd #$0305 + bsr L06D4 + ldd #$0D03 + bsr L06D4 + puls y + lbra L1206 +L06D4 pshs u,x + leax a,x + leau a,u + clra + tfr d,y + lbsr L05D4 + puls pc,u,x +L06E2 cmpb #$11 + bne L0701 + ldd $08,u + ldx $04,u + cmpx #$FFFF + bne L06FE + cmpx $08,u + bne L06FE + ldu <$30,y + lda $07,u + ora #$02 + sta $07,u + lda #$FF +L06FE lbra L0B24 +L0701 cmpb #$10 + bne L070E + ldd $04,u + ldx <$30,y + std <$12,x + rts +L070E cmpb #$1E + bne L071E + ldx <$1E,y + lda $05,u + sta <$1E,x + clr <$1D,x +L071D rts +L071E cmpb #$1C + bne L078D + lbsr L112C + bcs L071D + ldx <$0050 + lda $08,x + beq L0733 + ldx $08,y + cmpa $01,x + bne L0789 +L0733 lda $05,u + tfr a,b + ldu $08,y + eorb ,u + bpl L0784 + tsta + bmi L076D + ldx <$1E,y + ldd $08,x + cmpd <$34,y + bne L0752 + ldb $0A,x + cmpb <$36,y + beq L0789 +L0752 ldb $0B,y + ldx $0C,y + pshs x,b + std $0B,y + ldb #$20 + std $0D,y +L075E lbsr L094B + bcs L0771 + tst ,x + beq L075E + puls x,b + stb $0B,y + stx $0C,y +L076D ldb #$EE + bra L078B +L0771 puls x,a + sta $0B,y + stx $0C,y + cmpb #$D3 + bne L078B + lbsr L112C + ldu $08,y + ldx $06,y + lda $05,x +L0784 sta ,u + lbra L1206 +L0789 ldb #$D6 +L078B coma + rts +L078D cmpb #$2C + bne L07AC + lda <$33,y + bita #$40 + lbne L0A94 + ldx <$30,y + lda $05,u + sta <$18,x + ldu <$0050 + lda <$0000,u + sta <$17,x + clrb + rts +L07AC lda #$0C + lbra L1145 +L07B1 comb + ldb #$D0 +L07B4 rts +L07B5 ldd #$0100 + stb $0A,y + os9 F$SRqMem + bcs L07B4 + stu $08,y + leau ,y + ldx <$0088 + os9 F$All64 + exg y,u + bcs L07B4 + stu <$30,y + clr <$17,u + sty $01,u + stu <$10,u + ldx $06,y + ldx $04,x + pshs u,y,x + leas -$04,s + clra + clrb + sta <$34,y + std <$35,y + std <$1C,y + lbsr L0988 + sta ,s + cmpa #$2F + bne L0804 + lbsr L0993 + sta ,s + lbcs L0916 + leax ,y + ldy $06,s + bra L0827 +L0804 anda #$7F + cmpa #$40 + beq L0827 + lda #$2F + sta ,s + leax -$01,x + lda $01,y + ldu <$0050 + leau <$20,u + bita #$04 + beq L081D + leau $06,u +L081D ldb $03,u + stb <$34,y + ldd $04,u + std <$35,y +L0827 ldu $03,y + stu <$3E,y + lda <$21,y + ldb >L0011,pcr + mul + addd $02,u + addd #$000F + std <$1E,y + lda ,s + anda #$7F + cmpa #$40 + bne L0848 + leax $01,x + bra L086A +L0848 lbsr L1119 + lbcs L091E + ldu $08,y + ldd $0E,u + std <$1C,y + ldd <$35,y + bne L086A + lda <$34,y + bne L086A + lda $08,u + sta <$34,y + ldd $09,u + std <$35,y +L086A stx $04,s + stx $08,s +L086E lbsr L1240 + lbcs L091E + lda ,s + anda #$7F + cmpa #$40 + beq L0884 + lbsr L112C + lbcs L091E +L0884 lbsr L0A33 + lda ,s + cmpa #$2F + bne L08F8 + clr $02,s + clr $03,s + lda $01,y + ora #$80 + lbsr L09E6 + bcs L0916 + lbsr L01DD + ldx $08,s + leax $01,x + lbsr L0993 + std ,s + stx $04,s + sty $08,s + ldy $06,s + bcs L0916 + pshs u,y + ldu <$30,y + leau <$20,u + clra + tfr d,y + lbsr L05D4 + puls u,y + lbsr L0960 + bra L08CA +L08C5 bsr L0921 +L08C7 lbsr L094B +L08CA bcs L0916 + tst ,x + beq L08C5 + clra + ldb $01,s + exg x,y + ldx <$30,x + leax <$20,x + lbsr L09C8 + ldx $06,s + exg x,y + bcs L08C7 + bsr L092F + lda <$1D,x + sta <$34,y + ldd <$1E,x + std <$35,y + lbsr L0A99 + lbra L086E +L08F8 ldx $08,s + tsta + bmi L0905 + os9 F$PrsNam + leax ,y + ldy $06,s +L0905 stx $04,s + clra +L0908 lda ,s + leas $04,s + pshs b,a,cc + lda $0A,y + anda #$BF + sta $0A,y + puls pc,u,y,x,b,a,cc +L0916 cmpb #$D3 + bne L091E + bsr L0921 + ldb #$D8 +L091E coma + bra L0908 +L0921 pshs b,a + lda $04,s + cmpa #$2F + beq L0949 + ldd $06,s + bne L0949 + puls b,a +L092F pshs b,a + stx $06,s + lda <$34,y + sta <$37,y + ldd <$35,y + std <$38,y + ldd $0B,y + std <$3A,y + ldd $0D,y + std <$3C,y +L0949 puls pc,b,a +L094B ldb $0E,y + addb #$20 + stb $0E,y + bcc L0960 + lbsr L1240 + inc $0D,y + bne L0960 + inc $0C,y + bne L0960 + inc $0B,y +L0960 ldd #$0020 + lbsr L047C + bcs L0987 + ldd #$0020 + lbsr L0B15 + bcs L0987 + lda $0A,y + bita #$02 + bne L0980 + lbsr L10A1 + bcs L0987 + lbsr L125F + bcs L0987 +L0980 ldb $0E,y + lda $08,y + tfr d,x + clrb +L0987 rts +L0988 pshs u,x,b + ldu <$0050 + ldb $06,u + os9 F$LDABX + puls pc,u,x,b +L0993 os9 F$PrsNam + pshs x + bcc L09C0 + clrb +L099B pshs a + anda #$7F + cmpa #$2E + puls a + bne L09B6 + incb + leax $01,x + tsta + bmi L09B6 + bsr L0988 + cmpb #$03 + bcs L099B + lda #$2F + decb + leax -$03,x +L09B6 tstb + bne L09BE +L09B9 comb + ldb #$D7 + puls pc,x +L09BE leay ,x +L09C0 cmpb #$20 + bhi L09B9 + andcc #$FE + puls pc,x +L09C8 pshs y,x,b,a +L09CA lda ,y+ + bmi L09DA + decb + beq L09D7 + eora ,x+ + anda #$DF + beq L09CA +L09D7 comb + puls pc,y,x,b,a +L09DA decb + bne L09D7 + eora ,x + anda #$5F + bne L09D7 + clrb + puls pc,y,x,b,a +L09E6 tfr a,b + anda #$07 + andb #$C0 + pshs x,b,a + lbsr L112C + bcs L0A15 + ldu $08,y + ldx <$0050 + ldd $08,x + beq L09FE + cmpd $01,u +L09FE puls a + beq L0A05 + lsla + lsla + lsla +L0A05 ora ,s + anda #$BF + pshs a + ora #$80 + anda ,u + cmpa ,s + beq L0A1E + ldb #$D6 +L0A15 leas $02,s + coma + puls pc,x +L0A1A ldb #$FD + bra L0A15 +L0A1E ldb $01,s + orb ,u + bitb #$40 + beq L0A31 + ldx <$30,y + cmpx $05,x + bne L0A1A + lda #$02 + sta $07,x +L0A31 puls pc,x,b,a +L0A33 pshs u,y,x + clra + clrb + std $0B,y + std $0D,y + sta <$19,y + std <$1A,y + ldb <$34,y + ldx <$35,y + pshs x,b + ldu <$1E,y + ldy <$30,y + sty $05,y + leau <$15,u + bra L0A5A +L0A58 ldu $03,u +L0A5A ldx $03,u + beq L0A88 + ldx $01,x + ldd <$34,x + cmpd ,s + bcs L0A58 + bhi L0A88 + ldb <$36,x + cmpb $02,s + bcs L0A58 + bhi L0A88 + ldx <$30,x + lda $07,y + bita #$02 + bne L0A94 + sty $03,y + ldd $05,x + std $05,y + sty $05,x + bra L0A8F +L0A88 ldx $03,u + stx $03,y + sty $03,u +L0A8F clrb +L0A90 leas $03,s + puls pc,u,y,x +L0A94 comb + ldb #$FD + bra L0A90 +L0A99 pshs u,y,x,b,a + ldu <$1E,y + leau <$15,u + ldx <$30,y + leay ,x + bsr L0AD8 + bra L0AAE +L0AAA ldx $05,x + beq L0AD3 +L0AAE cmpy $05,x + bne L0AAA + ldd $05,y + std $05,x + bra L0ABB +L0AB9 ldu $03,u +L0ABB ldd $03,u + beq L0AD3 + cmpy $03,u + bne L0AB9 + ldx $03,y + cmpy $05,y + beq L0AD1 + ldx $05,y + ldd $03,y + std $03,x +L0AD1 stx $03,u +L0AD3 sty $05,y + puls pc,u,y,x,b,a +L0AD8 lda #$07 +L0ADA pshs u,y,x,b,a + bita $07,y + beq L0AE9 + coma + anda $07,y + sta $07,y + bita #$02 + bne L0B06 +L0AE9 leau ,y +L0AEB ldx <$10,u + cmpy <$10,u + beq L0B03 + stu <$10,u + leau ,x + lda <$14,u + ldb #$01 + os9 F$Send + bra L0AEB +L0B03 stu <$10,u +L0B06 puls pc,u,y,x,b,a +L0B08 comb + ldb #$FD +L0B0B pshs y,b,cc + ldy <$30,y + bsr L0AD8 + puls pc,y,b,cc +L0B15 ldx #$0000 + bra L0B24 +L0B1A ldu <$30,y + lda <$15,u + sta $07,u + puls u,y,x,b,a +L0B24 pshs u,y,x,b,a + ldu <$30,y + lda $07,u + sta <$15,u + lda ,s + bsr L0BA8 + bcc L0BA6 + ldu <$0050 + lda <$14,x +L0B39 os9 F$GProcP + bcs L0B4B + lda <$1E,y + beq L0B4B + cmpa ,u + bne L0B39 + ldb #$FE + bra L0BA3 +L0B4B lda <$14,x + sta <$1E,u + ldy $04,s + lda $0A,y + anda #$BF + sta $0A,y + ldu <$30,y + ldd <$10,x + stu <$10,x + std <$10,u + lbsr L0C5F + ldx <$12,u + os9 F$Sleep + pshs x + leax ,u + bra L0B78 +L0B75 ldx <$10,x +L0B78 cmpu <$10,x + bne L0B75 + ldd <$10,u + std <$10,x + stu <$10,u + puls x + ldu <$0050 + clr <$1E,u + lbsr L105C + bcs L0BA3 + leax ,x + bne L0B1A + ldu <$30,y + ldx <$12,u + lbeq L0B1A + ldb #$FC +L0BA3 coma + stb $01,s +L0BA6 puls pc,u,y,x,b,a +L0BA8 std -$02,s + bne L0BB3 + cmpx #$0000 + lbeq L0B0B +L0BB3 bsr L0BCB + lbcs L0B08 + pshs u,y,x + ldy <$30,y + lda #$01 + lbsr L0ADA + ora $07,y + sta $07,y + clrb + puls pc,u,y,x +L0BCB pshs u,y,b,a + leau ,y + ldy <$30,y + subd #$0001 + bcc L0BDA + leax -$01,x +L0BDA addd $0D,u + exg d,x + adcb $0C,u + adca $0B,u + bcc L0BE9 + ldx #$FFFF + tfr x,d +L0BE9 std $0C,y + stx $0E,y + cmpd $0F,u + bcs L0C01 + bhi L0BF9 + cmpx <$11,u + bcs L0C01 +L0BF9 lda $07,y + ora #$04 + sta $07,y + bra L0C0A +L0C01 lda #$04 + bita $07,y + beq L0C0A + lbsr L0ADA +L0C0A ldd $0B,u + ldx $0D,u + std $08,y + stx $0A,y + lda $05,u + sta <$14,y + leax ,y +L0C19 cmpy $05,x + beq L0C5D + ldx $05,x + ldb <$14,y + cmpb <$14,x + beq L0C19 + lda $07,x + beq L0C19 + ora $07,y + bita #$02 + bne L0C5C + lda $07,x + anda $07,y + bita #$04 + bne L0C5C + ldd $08,x + cmpd $0C,y + bhi L0C19 + bcs L0C4C + ldd $0A,x + cmpd $0E,y + bhi L0C19 + beq L0C5C +L0C4C ldd $0C,x + cmpd $08,y + bcs L0C19 + bhi L0C5C + ldd $0E,x + cmpd $0A,y + bcs L0C19 +L0C5C comb +L0C5D puls pc,u,y,b,a +L0C5F pshs y,x,b,a + ldx <$0050 + lda <$10,x + beq L0C75 + clr <$10,x + ldb #$01 + os9 F$Send + os9 F$GProcP + clr $0F,y +L0C75 clrb + puls pc,y,x,b,a +L0C78 pshs u,x +L0C7A bsr L0CDA + bne L0C8A + cmpx <$1A,y + bcs L0CD1 + bne L0C8A + lda <$12,y + beq L0CD1 +L0C8A lbsr L112C + bcs L0CCE + ldx $0B,y + ldu $0D,y + pshs u,x + ldd $0F,y + std $0B,y + ldd <$11,y + std $0D,y + lbsr L10BB + puls u,x + stx $0B,y + stu $0D,y + bcc L0CD1 + cmpb #$D5 + bne L0CCE + bsr L0CDA + bne L0CBA + tst <$12,y + beq L0CBD + leax $01,x + bne L0CBD +L0CBA ldx #$FFFF +L0CBD tfr x,d + tsta + bne L0CCA + cmpb <$2E,y + bcc L0CCA + ldb <$2E,y +L0CCA bsr L0D10 + bcc L0C7A +L0CCE coma + puls pc,u,x +L0CD1 lbsr L10A1 + bcs L0CCE + bsr L0CE8 + puls pc,u,x +L0CDA ldd <$10,y + subd <$14,y + tfr d,x + ldb $0F,y + sbcb <$13,y + rts +L0CE8 clra + ldb #$02 + pshs u,x + ldu <$30,y + bra L0D06 +L0CF2 ldu $01,u + ldx $0F,y + stx $0F,u + ldx <$11,y + stx <$11,u + bitb $01,y + beq L0D03 + inca +L0D03 ldu <$30,u +L0D06 ldu $05,u + cmpy $01,u + bne L0CF2 + tsta + puls pc,u,x +L0D10 pshs u,x + lbsr L0DBE + bcs L0D57 + lbsr L112C + bcs L0D57 + ldu $08,y + clra + clrb + std $09,u + std $0B,u + leax <$10,u + ldd $03,x + beq L0D9F + ldd $08,y + inca + pshs b,a + bra L0D3F +L0D32 clrb + ldd -$02,x + beq L0D53 + addd $0A,u + std $0A,u + bcc L0D3F + inc $09,u +L0D3F leax $05,x + cmpx ,s + bcs L0D32 + lbsr L0FD5 + clra + clrb + sta <$19,y + std <$1A,y + comb + ldb #$D9 +L0D53 leas $02,s + leax -$05,x +L0D57 bcs L0DBC + ldd -$04,x + addd -$02,x + pshs b,a + ldb -$05,x + adcb #$00 + cmpb <$16,y + puls b,a + bne L0D9F + cmpd <$17,y + bne L0D9F + ldu <$1E,y + ldd $06,u + ldu $08,y + subd #$0001 + coma + comb + pshs b,a + ldd -$05,x + eora <$16,y + eorb <$17,y + lsra + rorb + lsra + rorb + lsra + rorb + anda ,s+ + andb ,s+ + std -$02,s + bne L0D9F + ldd -$02,x + addd <$1A,y + bcs L0D9F + std -$02,x + bra L0DAE +L0D9F ldd <$16,y + std ,x + lda <$18,y + sta $02,x + ldd <$1A,y + std $03,x +L0DAE ldd $0A,u + addd <$1A,y + std $0A,u + bcc L0DB9 + inc $09,u +L0DB9 lbsr L1206 +L0DBC puls pc,u,x +L0DBE pshs u,y,x,b,a + ldb #$0C +L0DC2 clr ,-s + decb + bne L0DC2 + ldx <$1E,y + ldd $04,x + std $04,s + ldd $06,x + std $02,s + std $0A,s + ldx $03,y + ldx $04,x + leax <$12,x + subd #$0001 + addb $0E,x + adca #$00 + bra L0DE6 +L0DE4 lsra + rorb +L0DE6 lsr $0A,s + ror $0B,s + bcc L0DE4 + std ,s + ldd $02,s + std $0A,s + subd #$0001 + addd $0C,s + bcc L0E00 + ldd #$FFFF + bra L0E00 +L0DFE lsra + rorb +L0E00 lsr $0A,s + ror $0B,s + bcc L0DFE + cmpa #$08 + bcs L0E0D + ldd #$0800 +L0E0D std $0C,s + lbsr L103F + lbcs L0EFB + ldx <$1E,y + ldd <$1A,x + cmpd $0E,x + bne L0E2F + lda <$1C,x + cmpa $04,x + bne L0E2F + ldb <$1D,x + cmpb $04,x + bcs L0E3D +L0E2F ldd $0E,x + std <$1A,x + lda $04,x + sta <$1C,x + clrb + stb <$1D,x +L0E3D incb + stb $06,s + ldx <$1E,y + cmpb <$1E,x + beq L0E79 + lbsr L109A + lbcs L0EFB + ldb $06,s + cmpb $04,s + bls L0E5A + clra + ldb $05,s + bra L0E5D +L0E5A ldd #$0100 +L0E5D ldx $08,y + leau d,x + ldy $0C,s + clra + clrb + os9 F$SchBit + bcc L0EA6 + cmpy $08,s + bls L0E79 + sty $08,s + std $0A,s + lda $06,s + sta $07,s +L0E79 ldy <$10,s + ldb $06,s + cmpb $04,s + bcs L0E8A + bhi L0E89 + tst $05,s + bne L0E8A +L0E89 clrb +L0E8A ldx <$1E,y + cmpb <$1D,x + bne L0E3D + ldb $07,s + beq L0EF9 + cmpb $06,s + beq L0E9F + stb $06,s + lbsr L109A +L0E9F ldx $08,y + ldd $0A,s + ldy $08,s +L0EA6 std $0A,s + sty $08,s + os9 F$AllBit + ldy <$10,s + ldb $06,s + lbsr L1072 + bcs L0EFB + ldx <$1E,y + lda $06,s + deca + sta <$1D,x + clrb + lsla + rolb + lsla + rolb + lsla + rolb + stb <$16,y + ora $0A,s + ldb $0B,s + ldx $08,s + ldy <$10,s + std <$17,y + stx <$1A,y + ldd $02,s + bra L0EEF +L0EE0 lsl <$18,y + rol <$17,y + rol <$16,y + lsl <$1B,y + rol <$1A,y +L0EEF lsra + rorb + bcc L0EE0 + clrb + ldd <$1A,y + bra L0F03 +L0EF9 ldb #$F8 +L0EFB ldy <$10,s + lbsr L1079 + coma +L0F03 leas $0E,s + puls pc,u,y,x +L0F07 clra + lda $01,y + bita #$80 + bne L0F78 + ldd $0F,y + std $0B,y + ldd <$11,y + std $0D,y + ldd #$FFFF + tfr d,x + lbsr L0B24 + bcs L0F77 + lbsr L0CE8 + bne L0F78 + lbsr L10BB + bcc L0F2F + cmpb #$D5 + bra L0F70 +L0F2F ldd <$14,y + subd $0C,y + addd <$1A,y + tst $0E,y + beq L0F3E + subd #$0001 +L0F3E pshs b,a + ldu <$1E,y + ldd $06,u + subd #$0001 + coma + comb + anda ,s+ + andb ,s+ + ldu <$1A,y + std <$1A,y + beq L0F72 + tfr u,d + subd <$1A,y + pshs x,b,a + addd <$17,y + std <$17,y + bcc L0F68 + inc <$16,y +L0F68 bsr L0FD5 + bcc L0F79 + leas $04,s + cmpb #$DB +L0F70 bne L0F77 +L0F72 lbsr L112C + bcc L0F82 +L0F77 coma +L0F78 rts +L0F79 lbsr L112C + bcs L0FD2 + puls x,b,a + std $03,x +L0F82 ldu $08,y + ldd <$11,y + std $0B,u + ldd $0F,y + std $09,u + tfr x,d + clrb + inca + leax $05,x + pshs x,b,a + bra L0FBD +L0F97 ldd -$02,x + beq L0FCA + std <$1A,y + ldd -$05,x + std <$16,y + lda -$03,x + sta <$18,y + bsr L0FD5 + bcs L0FD2 + stx $02,s + lbsr L112C + bcs L0FD2 + ldx $02,s + clra + clrb + std -$05,x + sta -$03,x + std -$02,x +L0FBD lbsr L1206 + bcs L0FD2 + ldx $02,s + leax $05,x + cmpx ,s + bcs L0F97 +L0FCA clra + clrb + sta <$19,y + std <$1A,y +L0FD2 leas $04,s + rts +L0FD5 pshs u,y,x,a + ldx <$1E,y + ldd $06,x + subd #$0001 + addd <$17,y + std <$17,y + ldd $06,x + bcc L0FFD + inc <$16,y + bra L0FFD +L0FEE lsr <$16,y + ror <$17,y + ror <$18,y + lsr <$1A,y + ror <$1B,y +L0FFD lsra + rorb + bcc L0FEE + clrb + ldd <$1A,y + beq L103D + ldd <$16,y + lsra + rorb + lsra + rorb + lsra + rorb + tfr b,a + ldb #$DB + cmpa $04,x + bhi L103C + inca + sta ,s +L101B bsr L103F + bcs L101B + ldb ,s + bsr L109A + bcs L103C + ldx $08,y + ldd <$17,y + anda #$07 + ldy <$1A,y + os9 F$DelBit + ldy $03,s + ldb ,s + bsr L1072 + bcc L103D +L103C coma +L103D puls pc,u,y,x,a +L103F lbsr L1240 + bra L104C +L1044 lbsr L0C5F + os9 F$IOQu + bsr L105C +L104C bcs L105B + ldx <$1E,y + lda <$17,x + bne L1044 + lda $05,y + sta <$17,x +L105B rts +L105C ldu <$0050 + ldb <$19,u + cmpb #$01 + bls L1069 + cmpb #$03 + bls L1070 +L1069 clra + lda $0C,u + bita #$02 + beq L1071 +L1070 coma +L1071 rts +L1072 clra + tfr d,x + clrb + lbsr L1210 +L1079 pshs cc + ldx <$1E,y + lda $05,y + cmpa <$17,x + bne L1098 + clr <$17,x + ldx <$0050 + lda <$10,x + beq L1098 + lbsr L0C5F + ldx #$0001 + os9 F$Sleep +L1098 puls pc,cc +L109A clra + tfr d,x + clrb + lbra L1143 +L10A1 ldd $0C,y + subd <$14,y + tfr d,x + ldb $0B,y + sbcb <$13,y + cmpb <$19,y + bcs L10B9 + bhi L10BB + cmpx <$1A,y + bcc L10BB +L10B9 clrb +L10BA rts +L10BB pshs u + bsr L112C + bcs L1117 + clra + clrb + std <$13,y + stb <$15,y + ldu $08,y + leax <$10,u + lda $08,y + ldb #$FC + pshs b,a +L10D4 ldd $03,x + beq L10F9 + addd <$14,y + tfr d,u + ldb <$13,y + adcb #$00 + cmpb $0B,y + bhi L1106 + bne L10ED + cmpu $0C,y + bhi L1106 +L10ED stb <$13,y + stu <$14,y + leax $05,x + cmpx ,s + bcs L10D4 +L10F9 clra + clrb + sta <$19,y + std <$1A,y + comb + ldb #$D5 + bra L1115 +L1106 ldd ,x + std <$16,y + lda $02,x + sta <$18,y + ldd $03,x + std <$1A,y +L1115 leas $02,s +L1117 puls pc,u +L1119 pshs x,b + lbsr L1240 + bcs L1128 + clrb + ldx #$0000 + bsr L1143 + bcc L112A +L1128 stb ,s +L112A puls pc,x,b +L112C ldb $0A,y + bitb #$04 + bne L10B9 + lbsr L1240 + bcs L10BA + ldb $0A,y + orb #$04 + stb $0A,y + ldb <$34,y + ldx <$35,y +L1143 lda #$03 +L1145 pshs u,y,x,b,a + lda $0A,y + ora #$20 + sta $0A,y + ldx <$0050 + lda $0A,x + tfr a,b + addb #$03 + bcc L1159 + ldb #$FF +L1159 stb $0A,x + stb $0B,x + ldx <$30,y + sta <$16,x + ldu $03,y + ldu $02,u + bra L116F +L1169 lbsr L0C5F + os9 F$IOQu +L116F lda $04,u + bne L1169 + lda $05,y + sta $04,u + ldd ,s + ldx $02,s + pshs u + bsr L11F4 + puls u + ldy $04,s + pshs cc + bcc L118A + stb $02,s +L118A lda $0A,y + anda #$DF + sta $0A,y + clr $04,u + ldx <$30,y + lda <$16,x + ldx <$0050 + sta $0A,x + lda ,s + bita #$01 + bne L11D4 + lda $01,s + cmpa #$06 + bne L11D4 + pshs u,y,x + ldy <$30,y + leau ,y +L11B0 ldx <$05,u + cmpy <$05,u + beq L11D2 + leau ,x + lda <$17,u + beq L11B0 + ldx <$0050 + cmpa <$00,x + beq L11B0 + clr <$17,u + ldb <$18,u + os9 F$Send + bra L11B0 +L11D2 puls u,y,x +L11D4 lda <$10,x + beq L11F2 + lda $01,y + bita #$04 + bne L11F2 + ldx <$1E,y + lda $05,y + cmpa <$17,x + beq L11F2 + lbsr L0C5F + ldx #$0001 + os9 F$Sleep +L11F2 puls pc,u,y,x,b,a,cc +L11F4 pshs pc,x,b,a + ldx $03,y + ldd ,x + ldx ,x + addd $09,x + addb ,s + adca #$00 + std $04,s + puls pc,x,b,a +L1206 ldb <$34,y + ldx <$35,y + bra L1210 +L120E bsr L1229 +L1210 lda #$06 + pshs x,b,a + ldd <$1C,y + beq L121F + ldx <$1E,y + cmpd $0E,x +L121F puls x,b,a + lbeq L1145 + comb + ldb #$FB + rts +L1229 ldd $0C,y + subd <$14,y + tfr d,x + ldb $0B,y + sbcb <$13,y + exg d,x + addd <$17,y + exg d,x + adcb <$16,y + rts +L1240 clrb + pshs u,x + ldb $0A,y + andb #$46 + beq L125D + tfr b,a + eorb $0A,y + stb $0A,y + andb #$01 + beq L125D + eorb $0A,y + stb $0A,y + bita #$02 + beq L125D + bsr L120E +L125D puls pc,u,x +L125F pshs u,x + lbsr L10A1 + bcs L12CF + bsr L1240 + bcs L12CF +L126A ldb $0B,y + ldu $0C,y + leax ,y + ldy <$30,y +L1274 ldx <$30,x + cmpy $05,x + beq L12BE + ldx $05,x + ldx $01,x + cmpu $0C,x + bne L1274 + cmpb $0B,x + bne L1274 + lda $0A,x + bita #$02 + beq L1274 + bita #$20 + bne L1297 + bita #$40 + beq L12A9 +L1297 lda $05,x + ldy $01,y + lbsr L0C5F + os9 F$IOQu + lbsr L105C + bcc L126A + bra L12CF +L12A9 ldy $01,y + ldd $08,x + ldu $08,y + std $08,y + stu $08,x + lda $0A,x + ora #$40 + sta $0A,y + clr $0A,x + puls pc,u,x +L12BE ldy $01,y + lbsr L1229 + lbsr L1143 + bcs L12CF + lda $0A,y + ora #$42 + sta $0A,y +L12CF puls pc,u,x + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 CoCoOS9/level2v3/MODULES/scf.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/MODULES/scf.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,933 @@ +******************************************************************** +* SCF - Sequential Character file manager +* +* $Id: scf.asm,v 1.1.1.1 2001/02/21 23:30:55 boisy Exp $ +* +* This contains an added SetStat call to allow placing prearranged +* data into the keyboard buffer of ANY SCF related device. +* +* This also includes Kevin Darlings SCF Editor patches. +* This means windows, VDG screens, terminals, etc. +* +* Remember to have a Carriage Return ($0D) at the end of the buffer +* to terminate it without having trailing garbage (this will be fixed +* to be automatic in a future version). +* +* ENTRY PARAMETERS: +* x = Address of string to place in buffer +* y = Length of the string to place in buffer +* a = Path number (usually 0) +* b = $A0 (syscall SETSTAT function call number) +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 13 Obtained from L2 Upgrade archive +* 16 Updated to Curtis Boyle's version, contains BGP 98/10/20 +* several optimizations and new SetStat to +* stuff any string in the input buffer. + + nam SCF + ttl Sequential Character file manager + +* Disassembled 98/08/24 22:11:42 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile +* use scfdefs + endc + +tylg set FlMgr+Objct +atrv set ReEnt+rev +rev set $00 +edition set 16 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 0 +size equ . + +name fcs /SCF/ + fcb edition + +start lbra Create + lbra Open + lbra MakDir + lbra ChgDir + lbra Delete + lbra Seek + lbra Read + lbra Write + lbra ReadLn + lbra WriteLn + lbra GetStat + lbra SetStat + lbra Term + +L0038 puls y + +* ChgDir/Makdir entry +ChgDir +MakDir comb + ldb #E$BPNam +L003D rts + + +****************************** +* +* Create or open a path to device +* +* Entry: Y = Path descriptor pointer +* U = Callers register stack pointer + +* Check for pathname legality +Open +Create ldx PD.DEV,y get device table entry pointer + stx L033F,pcr + subb #$29 + lslb + leax b,x + stx $02,s + puls x + jsr [,s++] + bra L02F9 +L033F bra L03BB + bra L03A5 + bra L0351 + bra L0366 + bra L0381 + bra L038B + puls pc + bra L03A5 + bra L03A5 +L0351 leas $02,s + sta ,u + lbsr L0413 + ldu $06,y + leax $01,x + stx $06,u + lbsr L042B + leas $02,s + lbra L0453 +L0366 leas $02,s + leax ,x + lbeq L02A2 + bra L030C +L0370 pshs b + lda #$0D + sta ,u + bsr L037D + puls b + lbra L02A4 +L037D lda #$0D + bra L03D7 +L0381 lda <$2B,y + sta ,u + bsr L03B5 +L0388 lbsr L0418 +L038B cmpx $0D,y + beq L03A2 + leax $01,x + cmpx $02,s + bcc L03A0 + lda ,u+ + beq L0388 + cmpa <$2B,y + bne L0388 + leau -$01,u +L03A0 leax -$01,x +L03A2 rts + +L03A3 bsr L03BF +L03A5 leax ,x + beq L03B5 + tst <$23,y + beq L03A3 + tst <$24,y + beq L03B5 + bsr L037D +L03B5 ldx #$0000 + ldu $08,y +L03BA rts +L03BB leax ,x + beq L03A2 +L03BF leau -$01,u + leax -$01,x + tst <$24,y + beq L03BA + tst <$22,y + beq L03D4 + bsr L03D4 + lda #$20 + lbsr L0565 +L03D4 lda <$32,y +L03D7 lbra L0565 +L03DA pshs u,y,x + ldx $0A,y + ldu $03,y + bra L03EA + +L03E2 pshs u,y,x + ldx PD.DEV,y + ldu PD.DV2,y + beq L03F1 +L03EA ldu V$STAT,u + ldb $(HOME)/OS9/init.asm + os9l1 asm init.asm o=Init + mv $(HOME)/OS9/CMDS/Init . + +# part1.s1 is the core module "P1" - must be loaded at $f800 +# according to os9sysprog section 3.0 +# part2.s1 are all the other position independent modules + +part1.s1: OS9 + $(BINEX) -o part1.s1 -a f000 -x f076 OS9 +part2.s1: OS9p2 SysGo Init IOMan SCF Shell Pty Term + $(BINEX) -o part2.s1 -a d000 OS9p2 SysGo Init IOMan SCF Shell Pty Term +d64intrvect.s1: D64Intrvect + $(BINEX) -o d64intrvect.s1 -a ffe0 D64Intrvect + +rom.s1: part1.s1 part2.s1 d64intrvect.s1 + cat part2.s1 d64intrvect.s1 part1.s1 >rom.s1 + +install: rom.s1 + mv rom.s1 ../rom.s1 diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/OS9 Binary file os9/level1/OS9 has changed diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/OS9p2 Binary file os9/level1/OS9p2 has changed diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/README Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,21 @@ + OS-NINE - OS-Nine Is Not an Emulator + ==================================== + +The purpose of these device is to make ideal devices for the v6809 emulator. +The devices read and write to a predefined memory-location which the emulator +reacts to and for the SCF-device reads and writes to stdin/stdout. +For the RBF device it will write to a VDK file. + +When everything is ready I create a boot file in S-Record format which +will be given to the v6809 emulator as an argument. + +TO DO: + +- Make a device driver to replace ACIA. This driver I call PTY. (Pseudo tty) +- Make a device descriptor called TERM describing PTY's parameters. +- Make a device driver for diskio. To be called PDISK. Make a device descriptor + called D0. +- Don't make a clock module, and don't use the original one. +- OS-9 modules the emulator must be initialised with + OS9 (at $F800) ,OS9p2, SYSGO, INIT, IOMAN, SCFMAN, RBFMAN, + PTY, TERM, PDISK, D0, SHELL diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/SCF Binary file os9/level1/SCF has changed diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/Shell Binary file os9/level1/Shell has changed diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/SysGo Binary file os9/level1/SysGo has changed diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/clock.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/clock.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,75 @@ +******************************************************************** +* Clock - OS-9 Level One V2 Clock module +* +* $Id: clock.asm,v 1.1.1.1 2001/02/21 23:30:52 boisy Exp $ +* +* NOTE: This clock is TOTALLY VALID for ALL DATES between 1900-2155 +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 5 Tandy/Microware original version +* 6 Modified to handle leap years properly for BGP 99/05/03 +* 1900 and 2100 A.D. + + nam Clock + ttl OS-9 Level One V2 Clock module + + ifp1 + use os9defs + endc + +tylg set Systm+Objct +atrv set ReEnt+rev +rev set $01 +edition set $06 +TimerPort set $e030 + + mod eom,name,tylg,atrv,ClkEnt,size + +size equ . + +name fcs /Clock/ + fcb edition + +SysTbl fcb F$Time + fdb FTime-*-2 + fcb $80 + + +ClockIRQ clra + tfr a,dp +L00AE jsr [>D.Poll] + bcc L00AE +L00B4 jmp [>D.AltIRQ] + rts + +ClkEnt equ * + pshs cc + orcc #FIRQMask+IRQMask mask ints + leax >ClockIRQ,pcr + stx SysTbl,pcr + os9 F$SSvc + ldx #TimerPort + ldb #$8f start timer + stb ,x + puls pc,cc + +* F$Time system call code +FTime ldx R$X,u + ldy #TimerPort + ldb #$04 + stb ,y + ldd 1,y + std ,x + ldd 3,y + std 2,x + ldd 5,y + std 4,x + clrb + rts + + emod +eom equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/d0 Binary file os9/level1/d0 has changed diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/d0.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/d0.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,50 @@ +******************************************************************** +* progname - program module +* +* $Id: d0.asm,v 1.1 2002/06/14 12:35:43 roug Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* - Original Dragon Data distribution version +* +* $Log: d0.asm,v $ +* Revision 1.1 2002/06/14 12:35:43 roug +* Add work done on ideal devices +* +* + + nam D0 + ttl 40-track floppy disk device descriptor + + ifp1 + use os9defs + endc +tylg set Devic+Objct +atrv set ReEnt+rev +rev set $02 + mod eom,name,tylg,atrv,mgrnam,drvnam + fcb $FF mode byte + fcb $00 extended controller address + fdb $E040 physical controller address + fcb initsize-*-1 initilization table size + fcb $01 device type:0=scf,1=rbf,2=pipe,3=scf + fcb $00 drive number + fcb $00 step rate + fcb $20 drive device type + fcb $01 media density:0=single,1=double + fdb $0100 number of cylinders (tracks) + fcb $01 number of sides + fcb $00 verify disk writes:0=on + fdb $0012 # of sectors per track + fdb $0012 # of sectors per track (track 0) + fcb $01 sector interleave factor + fcb $08 minimum size of sector allocation +initsize equ * +name equ * + fcs /D0/ +mgrnam equ * + fcs /RBF/ +drvnam equ * + fcs /PDisk/ + emod +eom equ * diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/d1.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/d1.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,50 @@ +******************************************************************** +* progname - program module +* +* $Id: d0.asm,v 1.1 2002/06/14 12:35:43 roug Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* - Original Dragon Data distribution version +* +* $Log: d0.asm,v $ +* Revision 1.1 2002/06/14 12:35:43 roug +* Add work done on ideal devices +* +* + + nam D1 + ttl 40-track floppy disk device descriptor + + ifp1 + use os9defs + endc +tylg set Devic+Objct +atrv set ReEnt+rev +rev set $02 + mod eom,name,tylg,atrv,mgrnam,drvnam + fcb $FF mode byte + fcb $00 extended controller address + fdb $E040 physical controller address + fcb initsize-*-1 initilization table size + fcb $01 device type:0=scf,1=rbf,2=pipe,3=scf + fcb $01 drive number + fcb $00 step rate + fcb $20 drive device type + fcb $01 media density:0=single,1=double + fdb $0100 number of cylinders (tracks) + fcb $01 number of sides + fcb $00 verify disk writes:0=on + fdb $0012 # of sectors per track + fdb $0012 # of sectors per track (track 0) + fcb $01 sector interleave factor + fcb $08 minimum size of sector allocation +initsize equ * +name equ * + fcs /D1/ +mgrnam equ * + fcs /RBF/ +drvnam equ * + fcs /PDisk/ + emod +eom equ * diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/init.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/init.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,28 @@ +* OS9 standard init modul. + nam Init + ttl os9 system module + + ifp1 + use os9defs + endc +null set $0000 +tylg set Systm+$00 +atrv set ReEnt+rev +rev set $01 + mod eom,initnam,tylg,atrv + fcb 0 + fdb $c000 + fcb $0C + fcb $0C + fdb sysgo + fdb null system device (sysdev) + fdb systerm + fdb null bootstrap module (bootst) +initnam fcs "Init" +sysgo fcs "SysGo" +sysdev fcs "/D0" +systerm fcs "/Term" +bootst fcs "Boot" + emod +eom equ * + diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/mdir Binary file os9/level1/mdir has changed diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/os9defs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/os9defs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,701 @@ + opt -l + ttl OS-9 System Symbol Definitions + pag +************************************************************ +* +* System Service Request Code Definitions +* + ORG 0 +LEVEL equ 1 +F$Link rmb 1 Link to Module +F$Load rmb 1 Load Module from File +F$UnLink rmb 1 Unlink Module +F$Fork rmb 1 Start New Process +F$Wait rmb 1 Wait for Child Process to Die +F$Chain rmb 1 Chain Process to New Module +F$Exit rmb 1 Terminate Process +F$Mem rmb 1 Set Memory Size +F$Send rmb 1 Send Signal to Process +F$Icpt rmb 1 Set Signal Intercept +F$Sleep rmb 1 Suspend Process +F$SSpd rmb 1 Suspend Process +F$ID rmb 1 Return Process ID +F$SPrior rmb 1 Set Process Priority +F$SSWI rmb 1 Set Software Interrupt +F$PErr rmb 1 Print Error +F$PrsNam rmb 1 Parse Pathlist Name +F$CmpNam rmb 1 Compare Two Names +F$SchBit rmb 1 Search Bit Map +F$AllBit rmb 1 Allocate in Bit Map +F$DelBit rmb 1 Deallocate in Bit Map +F$Time rmb 1 Get Current Time +F$STime rmb 1 Set Current Time +F$CRC rmb 1 Generate CRC +F$GPrDsc rmb 1 get Process Descriptor copy +F$GBlkMp rmb 1 get System Block Map copy +F$GModDr rmb 1 get Module Directory copy +F$CpyMem rmb 1 Copy External Memory +F$SUser rmb 1 Set User ID number +F$UnLoad rmb 1 Unlink Module by name + ORG $28 Beginning of System Reserved Calls +F$SRqMem rmb 1 System Memory Request +F$SRtMem rmb 1 System Memory Return +F$IRQ rmb 1 Enter IRQ Polling Table +F$IOQu rmb 1 Enter I/O Queue +F$AProc rmb 1 Enter Active Process Queue +F$NProc rmb 1 Start Next Process +F$VModul rmb 1 Validate Module +F$Find64 rmb 1 Find Process/Path Descriptor +F$All64 rmb 1 Allocate Process/Path Descriptor +F$Ret64 rmb 1 Return Process/Path Descriptor +F$SSvc rmb 1 Service Request Table Initialization +F$IODel rmb 1 Delete I/O Module +F$SLink rmb 1 System Link +F$Boot rmb 1 Bootstrap System +F$BtMem rmb 1 Bootstrap Memory Request +F$GProcP rmb 1 Get Process ptr +F$Move rmb 1 Move Data (low bound first) +F$AllRAM rmb 1 Allocate RAM blocks +F$AllImg rmb 1 Allocate Image RAM blocks +F$DelImg rmb 1 Deallocate Image RAM blocks +F$SetImg rmb 1 Set Process DAT Image +F$FreeLB rmb 1 Get Free Low Block +F$FreeHB rmb 1 Get Free High Block +F$AllTsk rmb 1 Allocate Process Task number +F$DelTsk rmb 1 Deallocate Process Task number +F$SetTsk rmb 1 Set Process Task DAT registers +F$ResTsk rmb 1 Reserve Task number +F$RelTsk rmb 1 Release Task number +F$DATLog rmb 1 Convert DAT Block/Offset to Logical +F$DATTmp rmb 1 Make temporary DAT image +F$LDAXY rmb 1 Load A [X,[Y]] +F$LDAXYP rmb 1 Load A [X+,[Y]] +F$LDDDXY rmb 1 Load D [D+X,[Y]] +F$LDABX rmb 1 Load A from 0,X in task B +F$STABX rmb 1 Store A at 0,X in task B +F$AllPrc rmb 1 Allocate Process Descriptor +F$DelPrc rmb 1 Deallocate Process Descriptor +F$ELink rmb 1 Link using Module Directory Entry +F$FModul rmb 1 Find Module Directory Entry +F$MapBlk rmb 1 Map Specific Block +F$ClrBlk rmb 1 Clear Specific Block +F$DelRAM rmb 1 Deallocate RAM blocks + pag +************************************************************ +* +* I/O Service Request Code Definitions +* + ORG $80 +I$Attach rmb 1 Attach I/O Device +I$Detach rmb 1 Detach I/O Device +I$Dup rmb 1 Duplicate Path +I$Create rmb 1 Create New File +I$Open rmb 1 Open Existing File +I$MakDir rmb 1 Make Directory File +I$ChgDir rmb 1 Change Default Directory +I$Delete rmb 1 Delete File +I$Seek rmb 1 Change Current Position +I$Read rmb 1 Read Data +I$Write rmb 1 Write Data +I$ReadLn rmb 1 Read Line of ASCII Data +I$WritLn rmb 1 Write Line of ASCII Data +I$GetStt rmb 1 Get Path Status +I$SetStt rmb 1 Set Path Status +I$Close rmb 1 Close Path +I$DeletX rmb 1 Delete from current exec dir + + +************************************************************ +* +* File Access Modes +* +READ. equ %00000001 +WRITE. equ %00000010 +UPDAT. equ READ.+WRITE. +EXEC. equ %00000100 +PREAD. equ %00001000 +PWRIT. equ %00010000 +PEXEC. equ %00100000 +SHARE. equ %01000000 +DIR. equ %10000000 + pag +************************************************************ +* +* Signal Codes +* + ORG 0 +S$Kill rmb 1 Non-Interceptable Abort +S$Wake rmb 1 Wake-up Sleeping Process +S$Abort rmb 1 Keyboard Abort +S$Intrpt rmb 1 Keyboard Interrupt + + + +************************************************************ +* +* Status Codes for GetStat/PutStat +* + ORG 0 +SS.Opt rmb 1 Read/Write PD Options +SS.Ready rmb 1 Check for Device Ready +SS.Size rmb 1 Read/Write File Size +SS.Reset rmb 1 Device Restore +SS.WTrk rmb 1 Device Write Track +SS.Pos rmb 1 Get File Current Position +SS.EOF rmb 1 Test for End of File +SS.Link rmb 1 Link to Status routines +SS.ULink rmb 1 Unlink Status routines +SS.Feed rmb 1 issue form feed +SS.Frz rmb 1 Freeze DD. information +SS.SPT rmb 1 Set DD.TKS to given value +SS.SQD rmb 1 Sequence down hard disk +SS.DCmd rmb 1 Send direct command to disk +SS.DevNm rmb 1 Return Device name (32-bytes at [X]) +SS.FD rmb 1 Return File Descriptor (Y-bytes at [X]) +SS.Ticks rmb 1 Set Lockout honor duration +SS.Lock rmb 1 Lock/Release record +SS.DStat rmb 1 Return Display Status (CoCo) +SS.Joy rmb 1 Return Joystick Value (CoCo) +SS.BlkRd rmb 1 Block Read +SS.BlkWr rmb 1 Block Write +SS.Reten rmb 1 Retension cycle +SS.WFM rmb 1 Write File Mark +SS.RFM rmb 1 Read past File Mark +SS.ELog rmb 1 Read Error Log +SS.SSig rmb 1 Send signal on data ready +SS.Relea rmb 1 Release device +SS.AlfaS rmb 1 Return Alfa Display Status (CoCo) + + ttl Structure Formats + pag +************************************************************ +* +* Module Definitions +* +* Universal Module Offsets +* + ORG 0 +M$ID rmb 2 ID Code +M$Size rmb 2 Module Size +M$Name rmb 2 Module Name +M$Type rmb 1 Type / Language +M$Revs rmb 1 Attributes / Revision Level +M$Parity rmb 1 Header Parity +M$IDSize equ . Module ID Size +* +* Type-Dependent Module Offsets +* +* System, File Manager, Device Driver, Program Module +* +M$Exec rmb 2 Execution Entry Offset +* +* Device Driver, Program Module +* +M$Mem rmb 2 Stack Requirement +* +* Device Driver, Device Descriptor Module +* +M$Mode rmb 1 Device Driver Mode Capabilities +* +* Device Descriptor Module +* + ORG M$IDSize +M$FMgr rmb 2 File Manager Name Offset +M$PDev rmb 2 Device Driver Name Offset + rmb 1 M$Mode (defined above) +M$Port rmb 3 Port Address +M$Opt rmb 1 Device Default Options +M$DTyp rmb 1 Device Type +* +* Configuration Module Entry Offsets +* + ORG M$IDSize +MaxMem rmb 3 Maximum Free Memory +PollCnt rmb 1 Entries in Interrupt Polling Table +DevCnt rmb 1 Entries in Device Table +InitStr rmb 2 Initial Module Name +SysStr rmb 2 System Device Name +StdStr rmb 2 Standard I/O Pathlist +BootStr rmb 2 Bootstrap Module name + pag +************************************************************ +* +* Module Field Definitions +* +* ID Field +* +M$ID1 equ $87 Module ID code byte one +M$ID2 equ $CD Module ID code byte two +M$ID12 equ M$ID1*256+M$ID2 +* +* Module Type / Language byte +* +* Field Masks +* +TypeMask equ %11110000 Type Field +LangMask equ %00001111 Language Field +* +* Type Values +* +Devic equ $F0 Device Descriptor Module +Drivr equ $E0 Physical Device Driver +FlMgr equ $D0 File Manager +Systm equ $C0 System Module +Data equ $40 Data Module +Multi equ $30 Multi-Module +Sbrtn equ $20 Subroutine Module +Prgrm equ $10 Program Module +* +* Language Values +* +Objct equ 1 6809 Object Code Module +ICode equ 2 Basic09 I-code +PCode equ 3 Pascal P-code +CCode equ 4 C I-code +CblCode equ 5 Cobol I-code +FrtnCode equ 6 Fortran I-code +* +* Module Attributes / Revision byte +* +* Field Masks +* +AttrMask equ %11110000 Attributes Field +RevsMask equ %00001111 Revision Level Field +* +* Attribute Flags +* +ReEnt equ %10000000 Re-Entrant Module +* +* Device Type Values +* +DT.SCF equ 0 Sequential Character File Type +DT.RBF equ 1 Random Block File Type +DT.Pipe equ 2 Pipe File Type +* +* CRC Result Constant +* +CRCCon1 equ $80 +CRCCon23 equ $0FE3 + pag +************************************************************ +* +* Machine Characteristics Definitions +* +R$CC equ 0 Condition Codes register +R$A equ 1 A Accumulator +R$B equ 2 B Accumulator +R$D equ R$A Combined A:B Accumulator +R$DP equ 3 Direct Page register +R$X equ 4 X Index register +R$Y equ 6 Y Index register +R$U equ 8 User Stack register +R$PC equ 10 Program Counter register +R$Size equ 12 Total register package size + +Entire equ %10000000 Full Register Stack flag +FIRQMask equ %01000000 Fast-Interrupt Mask bit +HalfCrry equ %00100000 Half Carry flag +IRQMask equ %00010000 Interrupt Mask bit +Negative equ %00001000 Negative flag +Zero equ %00000100 Zero flag +TwosOvfl equ %00000010 Two's Comp Overflow flag +Carry equ %00000001 Carry bit +IntMasks equ IRQMask+FIRQMask +Sign equ %10000000 sign bit + +true equ 1 useful name +false equ 0 useful name + + + ttl Error Code Definitions + pag +************************************************************ +* +* Error Code Definitions +* + org 200 +E$PthFul rmb 1 Path Table full +E$BPNum rmb 1 Bad Path Number +E$Poll rmb 1 Polling Table Full +E$BMode rmb 1 Bad Mode +E$DevOvf rmb 1 Device Table Overflow +E$BMID rmb 1 Bad Module ID +E$DirFul rmb 1 Module Directory Full +E$MemFul rmb 1 Process Memory Full +E$UnkSvc rmb 1 Unknown Service Code +E$ModBsy rmb 1 Module Busy +E$BPAddr rmb 1 Bad Page Address +E$EOF rmb 1 End of File + rmb 1 +E$NES rmb 1 Non-Existing Segment +E$FNA rmb 1 File Not Accesible +E$BPNam rmb 1 Bad Path Name +E$PNNF rmb 1 Path Name Not Found +E$SLF rmb 1 Segment List Full +E$CEF rmb 1 Creating Existing File +E$IBA rmb 1 Illegal Block Address + rmb 1 +E$MNF rmb 1 Module Not Found + rmb 1 +E$DelSP rmb 1 Deleting Stack Pointer memory +E$IPrcID rmb 1 Illegal Process ID + rmb 1 +E$NoChld rmb 1 No Children +E$ISWI rmb 1 Illegal SWI code +E$PrcAbt rmb 1 Process Aborted +E$PrcFul rmb 1 Process Table Full +E$IForkP rmb 1 Illegal Fork Parameter +E$KwnMod rmb 1 Known Module +E$BMCRC rmb 1 Bad Module CRC +E$USigP rmb 1 Unprocessed Signal Pending +E$NEMod rmb 1 Non Existing Module + +E$BNam rmb 1 Bad Name +E$BMHP rmb 1 (bad module header parity) +E$NoRam rmb 1 No Ram Available +E$BPrcID rmb 1 Bad Process ID +E$NoTask rmb 1 No available Task number + + rmb $F0-. reserved + +E$Unit rmb 1 Illegal Unit (drive) +E$Sect rmb 1 Bad SECTor number +E$WP rmb 1 Write Protect +E$CRC rmb 1 Bad Check Sum +E$Read rmb 1 Read Error +E$Write rmb 1 Write Error +E$NotRdy rmb 1 Device Not Ready +E$Seek rmb 1 Seek Error +E$Full rmb 1 Media Full +E$BTyp rmb 1 Bad Type (incompatable) media +E$DevBsy rmb 1 Device Busy +E$DIDC rmb 1 Disk ID Change +E$Lock rmb 1 Record is busy (locked out) +E$Share rmb 1 Non-sharable file busy +E$DeadLk rmb 1 I/O Deadlock error + + + page +************************************************************ +* +* Path Descriptor Offsets +* + ORG 0 +PD.PD rmb 1 Path Number +PD.MOD rmb 1 Mode (Read/Write/Update) +PD.CNT rmb 1 Number of Open Images +PD.DEV rmb 2 Device Table Entry Address +PD.CPR rmb 1 Current Process +PD.RGS rmb 2 Caller's Register Stack +PD.BUF rmb 2 Buffer Address +PD.FST rmb 32-. File Manager's Storage +PD.OPT equ . PD GetSts(0) Options +PD.DTP rmb 1 Device Type + rmb 64-. Path options +PDSIZE equ . + + +* +* Pathlist Special Symbols +* +PDELIM equ '/ Pathlist Name Separator +PDIR equ '. Directory +PENTIR equ '@ Entire Device + page +************************************************************ +* +* File Manager Entry Offsets +* + ORG 0 +FMCREA rmb 3 Create (Open New) File +FMOPEN rmb 3 Open File +FMMDIR rmb 3 Make Directory +FMCDIR rmb 3 Change Directory +FMDLET rmb 3 Delete File +FMSEEK rmb 3 Position File +FMREAD rmb 3 Read from File +FMWRIT rmb 3 Write to File +FMGSTA rmb 3 Get File Status +FMSSTA rmb 3 Set File Status +FMCLOS rmb 3 Close File + + + +************************************************************ +* +* Device Driver Entry Offsets +* + ORG 0 +D$INIT rmb 3 Device Initialization +D$READ rmb 3 Read from Device +D$WRIT rmb 3 Write to Device +D$GSTA rmb 3 Get Device Status +D$PSTA rmb 3 Put Device Status +D$TERM rmb 3 Device Termination + page +************************************************************ +* +* Device Table Format +* + ORG 0 +V$DRIV rmb 2 Device Driver module +V$STAT rmb 2 Device Driver Static storage +V$DESC rmb 2 Device Descriptor module +V$FMGR rmb 2 File Manager module +V$USRS rmb 1 use count +DEVSIZ equ . + + + +************************************************************ +* +* Device Static Storage Offsets +* + ORG 0 +V.PAGE rmb 1 Port Extended Address +V.PORT rmb 2 Device 'Base' Port Address +V.LPRC rmb 1 Last Active Process ID +V.BUSY rmb 1 Active Process ID (0=UnBusy) +V.WAKE rmb 1 Active PD if Driver MUST Wake-up +V.USER equ . Driver Allocation Origin + + + +************************************************************ +* +* Interrupt Polling Table Format +* + ORG 0 +Q$POLL rmb 2 Absolute Polling Address +Q$FLIP rmb 1 Flip (EOR) Byte ..normally Zero +Q$MASK rmb 1 Polling Mask (after Flip) +Q$SERV rmb 2 Absolute Service routine Address +Q$STAT rmb 2 Static Storage Address +Q$PRTY rmb 1 Priority (Low Numbers=Top Priority) +POLSIZ equ . + + + + opt l + opt -l + ttl Direct Page Definitions + page +************************************************************ +* +* Direct Page Variable Definitions +* + org $20 reserve first 32 bytes + +D.FMBM rmb 4 Free memory bit map pointers +D.MLIM rmb 2 Memory limit +D.ModDir rmb 4 Module directory +D.Init rmb 2 Rom base address +D.SWI3 rmb 2 Swi3 vector +D.SWI2 rmb 2 Swi2 vector +D.FIRQ rmb 2 Firq vector +D.IRQ rmb 2 Irq vector +D.SWI rmb 2 Swi vector +D.NMI rmb 2 Nmi vector +D.SvcIRQ rmb 2 Interrupt service entry +D.Poll rmb 2 Interrupt polling routine +D.UsrIRQ rmb 2 User irq routine +D.SysIRQ rmb 2 System irq routine +D.UsrSvc rmb 2 User service request routine +D.SysSvc rmb 2 System service request routine +D.UsrDis rmb 2 User service request dispatch table +D.SysDis rmb 2 System service reuest dispatch table +D.Slice rmb 1 Process time slice count +D.PrcDBT rmb 2 Process descriptor block address +D.Proc rmb 2 Process descriptor address +D.AProcQ rmb 2 Active process queue +D.WProcQ rmb 2 Waiting process queue +D.SProcQ rmb 2 Sleeping process queue +D.Time equ . Time +D.Year rmb 1 +D.Month rmb 1 +D.Day rmb 1 +D.Hour rmb 1 +D.Min rmb 1 +D.Sec rmb 1 +D.Tick rmb 1 +D.TSec rmb 1 Ticks / second +D.TSlice rmb 1 Ticks / time-slice +D.IOML rmb 2 I/O mgr free memory low bound +D.IOMH rmb 2 I/O mgr free memory hi bound +D.DevTbl rmb 2 Device driver table addr +D.PolTbl rmb 2 Irq polling table addr +D.PthDBT rmb 2 Path descriptor block table addr +D.BTLO rmb 2 Bootstrap low address +D.BTHI rmb 2 Bootstrap hi address +D.DMAReq rmb 1 DMA in use flag +D.AltIRQ rmb 2 Alternate IRQ vector (CC) +D.KbdSta rmb 2 Keyboard scanner static storage (CC) +D.DskTmr rmb 2 Disk Motor Timer (CC) +D.CBStrt rmb 16 Reserved for CC warmstart ($71) +D.Clock rmb 2 Address of Clock Tick Routine (CC) + +* TABLE SIZES + +BMAPSZ equ 32 BIT MAP SIZE +SVCTNM equ 2 NUMBER OF SERVICE REQUEST TABLES +SVCTSZ equ (256-BMAPSZ)/SVCTNM-2 SERVICE REQUEST TABLE SIZE + + page +************************************************************ +* +* Process Descriptor Definitions +* +DefIOSiz equ 12 +NumPaths equ 16 Number of Local Paths + + ORG 0 +P$ID rmb 1 Process ID +P$PID rmb 1 Parent's ID +P$SID rmb 1 Sibling's ID +P$CID rmb 1 Child's ID +P$SP rmb 2 Stack ptr +P$CHAP rmb 1 process chapter number +P$ADDR rmb 1 user address beginning page number +P$PagCnt rmb 1 Memory Page Count +P$User rmb 2 User Index +P$Prior rmb 1 Priority +P$Age rmb 1 Age +P$State rmb 1 Status +P$Queue rmb 2 Queue Link (Process ptr) +P$IOQP rmb 1 Previous I/O Queue Link (Process ID) +P$IOQN rmb 1 Next I/O Queue Link (Process ID) +P$PModul rmb 2 Primary Module +P$SWI rmb 2 SWI Entry Point +P$SWI2 rmb 2 SWI2 Entry Point +P$SWI3 rmb 2 SWI3 Entry Point +P$DIO rmb DefIOSiz default I/O ptrs +P$PATH rmb NumPaths I/O path table +P$Signal rmb 1 Signal Code +P$SigVec rmb 2 Signal Intercept Vector +P$SigDat rmb 2 Signal Intercept Data Address + rmb $40-. unused +P$Size equ . Size of Process Descriptor + +* +* Process State Flags +* +SysState equ %10000000 +TimSleep equ %01000000 +TimOut equ %00100000 +ImgChg equ %00010000 +Condem equ %00000010 +Dead equ %00000001 + page +************************************************************ +* +* OS-9 Level I Definitions +* +* Definition of Level I V1.1 symbols +* renamed under Level I V1.2 +* +F$UNLK equ F$Unlink Unlink Module +F$CHAN equ F$Chain Chain process to new module +F$SLEP equ F$Sleep Process Sleep +F$SPRI equ F$SPrior set process priority +F$PNAM equ F$PrsNam Parse Name +F$CNAM equ F$CmpNam Compare Two Names +F$SBIT equ F$SchBit Search Bit Map +F$ABIT equ F$AllBit Allocate Bit Map +F$DBIT equ F$DelBit Deallocate Bit Map +F$STIM equ F$STime set current time +F$SRQM equ F$SRqMem System Memory Request +F$SRTM equ F$SRtMem System Memory Return +F$APRC equ F$AProc enter active process queue +F$NPRC equ F$NProc start next active process +F$VMOD equ F$VModul Validate module +F$F64 equ F$Find64 Find process/path descriptor +F$A64 equ F$ALL64 allocate process/path descriptor +F$R64 equ F$Ret64 return process/path descriptor +F$IODL equ F$IODel delete i/o module +I$ATCH equ I$Attach device to system +I$DTCH equ I$Detach device from system +I$CREA equ I$Create create new file +I$MDIR equ I$MakDir make directory file +I$CDIR equ I$ChgDir change default directory +I$DLET equ I$Delete delete a file +I$WRIT equ I$Write write data +I$RDLN equ I$ReadLn read line +I$WRLN equ I$WritLn write line +I$GSTT equ I$GetStt get status +I$SSTT equ I$SetStt set status +I$CLOS equ I$Close close path + +S$ABT equ S$Abort Keyboard abort signal +S$INTR equ S$Intrpt Keyboard interrupt signal + +COBOL equ CblCode COBOL module type + +SS.RST equ SS.Reset Reset Device +SS.WTK equ SS.WTrk Write Track +SS.SIZ equ SS.Size File size +SS.FEE equ SS.Feed Form feed +SS.DCM equ SS.Dcmd Hard disk command +M$STAK equ M$Mem Module Stack Requirement +P$PCNT equ P$PagCnt Memory page count +P$PRIO equ P$Prior Priority +P$STAT equ P$State Process state +P$QUEU equ P$Queue Queue link (process ptr) +P$PMOD equ P$PModul Primary module ptr +P$SIGN equ P$Signal Process Signal +P$SIGV equ P$SigVec Signal intercept vector +P$SIGD equ P$SigDat Signal intercept data address +E$PTHF equ E$PthFul path table full +E$IID equ E$BMID Illegal module ID block +E$DIRF equ E$DirFul Module directory full +E$MEMF equ E$MemFul Memory full +E$USVC equ E$UnkSvc Unknown Service Request error +E$MODB equ E$ModBsy Module busy +E$RNAM rmb E$EOF+1 returning non-allocated memory +E$BBND equ E$BPAddr Bad page address +E$BPN equ E$BPNam bad path name +E$LNEM equ E$MNF Module not found +E$DESP equ E$DelSP deleting stack ptr memory +E$IPID equ E$IPrcID illegal process ID +E$ISC equ E$IPrcID+1 +E$NOCH equ E$NoChld No children +E$PRCF equ E$PrcFul Process table full +E$KMOD equ E$KwnMod Known module +E$BCRC equ E$BMCRC Bad module CRC +E$USP equ E$USigP unprocessed signal pending +E$IFKP equ E$IForkP illegal fork parameter +E$RD equ E$Read Read error +E$WR equ E$Write Write error +E$NRDY equ E$NotRdy Device Not Ready +REVMSK equ Revsmask +INISTR equ InitStr +TYPMSK equ TypeMask +LANMSK equ LangMask +IRQM equ IRQMask +FIRQM equ FIRQMask +NPATHS equ NumPaths +SYSTAT equ SysState +TSLEEP equ TimSleep + +*************** +* +* Defs of Level I V1.1 renamed under V1.2 +* +D.MODD equ D.ModDir Module directory ptr +D.BASE equ D.Init ROM base address +D.ISVC equ D.SvcIRQ Interrupt service entry +D.UIRQ equ D.UsrIRQ User IRQ routine +D.SIRQ equ D.SysIRQ System IRQ routine +D.UREQ equ D.UsrSVC User service request routine +D.SREQ equ D.SysSVC System service request routine +D.USVC equ D.UsrDis User svc dispatch table +D.SSVC equ D.SysDis System svc dispatch table +D.SLIC equ D.Slice Process time slice count +D.PRDB equ D.PrcDBT Process Descriptor Block table +D.APRQ equ D.AProcQ Active process queue ptr +D.WPRQ equ D.WProcQ Waiting process queue +D.SPRQ equ D.SProcQ Sleeping process queue ptr +D.MNTH equ D.Month +D.TIC equ D.Tick +D.TSLC equ D.TSlice Ticks / Time-slice + + opt l diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/pdisk.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/pdisk.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,125 @@ +********************************************* +* Rdisk +* A driver for a Ram disk! +* Modified for os9l1 emulator by Soren Roug 2001 +* + + nam Pdisk + ttl A Device Driver for a RAM Disk + + ifp1 + use os9defs + use rbfdefs + endc + +*********************** +* Edition History + +* # date Comments +* -- -------- ---------------------------------------------- + +Revision equ 1 +NumDrvs set 2 Number of drives + + org Drvbeg + rmb NumDrvs*DrvMem +RAMSTA equ . + + mod RAMEND,RAMNAM,Drivr+Objct,Reent+Revision,RAMENT,RAMSTA + fcb $FF mode byte + +RAMNAM fcs /Pdisk/ + +RAMENT lbra INIT + lbra READ + lbra WRITE + lbra GETSTA + lbra PUTSTA + lbra TERM + +***************************** +* INIT +* Set up the v09 disk + +INIT ldb #NumDrvs Set no drives to 2 +* Setup drive tables + stb V.NDRV,u save it + lda #$FF + leax DRVBEG,u point to drive table start +L0111 sta DD.TOT+1,x + sta pia1b + lsra + bcc L006C + nop + nop + decb + bne L0055 + pshs x + ldx #$0001 + os9 F$Sleep sleep for one clock tick + puls x + bra L0053 +L006C puls a + pshs cc + orcc #$50 + sta >pia0b + lda >pia1a + ora #$02 + sta >pia1a + anda #$FD + sta >pia1a + puls pc,cc +************** +* GETSTA +* +GETSTA cmpa #SS.Ready + bne chkeof +allok clrb + rts +chkeof cmpa #SS.EOF + beq allok +************** +* PUTSTA +* +PUTSTA comb + ldb #E$UnkSvc + rts +************** +* TERM +* Terminate driver +* +TERM rts + emod +PEND equ * + diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/pty-dd.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/pty-dd.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,48 @@ +**************************************** +* PTY Descriptor module +* +* Source by Soren Roug 2001 +* + ifp1 + use os9defs + endc + + nam P1 + ttl PTY Device Descriptor + + mod PEND,PNAM,DEVIC+OBJCT,REENT+1,PMGR,PDRV + + fcb READ.+WRITE.+SHARE. + fcb $FF IOBlock (unused) + fdb $E000 hardware address + fcb PNAM-*-1 option byte count + fcb $0 SCF device + fcb $0 Case (upper & lower) + fcb $1 Erase on backspace + fcb $0 delete (BSE over line) + fcb $1 echo on + fcb $1 lf on + fcb $0 eol null count + fcb $0 no pause + fcb 24 lines per page + fcb $8 backspace + fcb $18 delete line char + fcb $0D end of record + fcb $1b eof + fcb $04 reprint line char + fcb $01 duplicate last line char + fcb $17 pause char + fcb $03 interrupt char + fcb $05 quit char + fcb $08 backspace echo char + fcb $07 bell + fcb $00 n/a + fcb $00 n/a + fdb pnam offset to name + fdb $0000 offset to status routine +pnam fcs "TERM" +pmgr fcs "SCF" +pdrv fcs "PTY" + emod +pend equ * + end diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/pty.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/pty.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,133 @@ +******************************************* +* PTY +* Device Driver for emulated terminal +* Emulates the 6850 UART seen in usim +* Protocol: +* V.port is the control port. +* V.port+1 is the data port. It is bidirectional. +* bit 1: 1=data ready to read/0=no data +* bit 2: 1=ready for output +* + + nam PTY + ttl Pseudo Terminal + + ifp1 + use os9defs + use scfdefs + endc + +*********************** +* Edition History +* +* # date Comments +* - -------- ------------------------------- +* 1 16.11.01 Driver first written. SMR + +Revision equ 1 + + org V.SCF +PST equ . + + mod PEND,PNAM,Drivr+Objct,Reent+Revision,PENT,PST + fcb READ.+WRITE. +PNAM fcs /PTY/ + +PENT lbra INIT + lbra READ + lbra WRITE + lbra GETSTA + lbra PUTSTA + lbra TERM + +********************** +* INIT +* Entry: U = Static storage +* Setup the PIA +* +INIT clrb + rts + +********************** +* READ +* Entry: U = Static Storage +* Y = Path Descriptor +* Exit: A = Character read +* +* Read a byte from Port B +* +READ ldx V.PORT,u load port address +readlp ldb ,x + bitb #$01 + bne readbyte + pshs x sleep for a bit if not + ldx #1 + os9 f$sleep + puls x + bra readlp +readbyte lda 1,x read byte + clrb + rts +********************** +* WRITE +* Entry: U = Static storage +* Y = Path Descriptor +* A = Char to write +* +* Write a byte to Port B +* +WRITE ldx V.PORT,u load port address +write1 ldb ,x + bitb #$02 + bne wrt + pshs x + ldx #1 + os9 f$sleep + puls x + bra write1 +wrt sta 1,x write byte +ok clrb + rts + +********************** +* GETSTA +* U = Static Storage +* Y = Path Descriptor +* +GETSTA ldx PD.Rgs,y X=pointer to registers + lda R$B,x A=contents of B reg. + cmpa #SS.Ready check for ready code + bne gsta1 if not, check next + ldx V.Port,u use the PIA to determine + ldb ,x if data is available + bitb #$01 + bne ok + ldb #E$NotRdy + coma sets the carry flag + rts +gsta1 cmpa #SS.EOF check for eof code + beq ok which always returns ok + comb otherwise return + ldb #E$UnkSVC unknown code error + rts + +********************** +* PUTSTA +* Always return error +* +PUTSTA ldx PD.Rgs,y X=register stack + ldb R$B,x B=contents of reg B + comb otherwise return error. + ldb #E$UnkSVC + rts + +********************** +* TERM +* Terminate Driver +* +TERM clrb + rts + + emod +PEND equ * + diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/rbfdefs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/rbfdefs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,175 @@ + opt -l + ttl Random Block File Manager Definitions + +*************** +* Modification History + +* 82/07/13 PD.Exten added to path descriptor by RFD. +* 82/07/13 PE entries defined by RFD. +* 82/07/15 V.FileHd inserted in drive static by RFD. +* 82/09/10 Level One/ Level two cond added by WGP. +* 82/09/17 Record Lock cond added by WGP. +* 82/09/17 PD.SLE renamed to PD.Creat by RFD. +* 82/09/17 V.DiskID, V.BMapSz, V.MapSct added for smart +* multi-sector bitmap searching by RFD. +* 82/09/20 reserved areas added in static storage. + + pag +************************************************************ +* +* Random Block Path Descriptor Format +* + org PD.FST +PD.SMF rmb 1 State flags +PD.CP rmb 4 Current logical byte position +PD.SIZ rmb 4 File size +PD.SBL rmb 3 Segment beginning lsn +PD.SBP rmb 3 Segment beginning psn +PD.SSZ rmb 3 Segment size +PD.DSK rmb 2 Disk id +PD.DTB rmb 2 Drive table ptr + org PD.OPT + rmb 1 Device type +PD.DRV rmb 1 Drive number +PD.STP rmb 1 Step rate +PD.TYP rmb 1 Disk device type (5" 8" other) +PD.DNS rmb 1 Density capability +PD.CYL rmb 2 Number of cylinders +PD.SID rmb 1 Number of surfaces +PD.VFY rmb 1 0=verify disk writes +PD.SCT rmb 2 Default sectors/track +PD.T0S rmb 2 Default sectors/track tr00,s0 +PD.ILV rmb 1 Sector interleave offset +PD.SAS rmb 1 Segment allocation size +PD.TFM rmb 1 DMA Transfer Mode +PD.Exten rmb 2 Path Extension (PE) for record locking + rmb PDSIZE-.-13 +PD.ATT rmb 1 File attributes +PD.FD rmb 3 File descriptor psn +PD.DFD rmb 3 Directory file descriptor psn +PD.DCP rmb 4 File directory entry ptr +PD.DVT rmb 2 User readable dev tbl ptr + +* State Flags +BUFMOD equ 1 Buffer modified +SINBUF equ 2 Sector in buffer +FDBUF equ 4 File descriptor in buffer +EOFSEC equ 8 End of file sector +EOF equ 16 End of file + + ifne LEVEL-1 +************************************************** +* Random Block Path Extension Format + + org 0 +PE.PE rmb 1 PE path number +PE.PDptr rmb 2 back ptr to this PE's Path Descriptor +PE.NxFil rmb 2 Drive Open-File list ptr +PE.Confl rmb 2 circular File Conflict list +PE.Lock rmb 1 Path lockout status +PE.LoLck rmb 4 Low Locked Logical addr +PE.HiLck rmb 4 High Locked Logical addr +PE.Wait rmb 2 PE ptr to (next) locked-out PE +PE.TmOut rmb 2 Max ticks to wait for locked segment +PE.Owner rmb 1 Process ID of owner of locked segment + +* PE.Lock status codes +Unlocked equ 0 no portion of file is locked +RcdLock equ 1 record from LoLck to HiLck locked +FileLock equ 2 entire file locked +EofLock equ 4 End of file is locked + endc + +* +* Device Descriptor Format +* + + org 0 +DD.TOT rmb 3 Total number of sectors +DD.TKS rmb 1 Track size in sectors +DD.MAP rmb 2 Number of bytes in allocation bit map +DD.BIT rmb 2 Number of sectors/bit +DD.DIR rmb 3 Address of root directory fd +DD.OWN rmb 2 Owner +DD.ATT rmb 1 Attributes +DD.DSK rmb 2 Disk id +DD.FMT rmb 1 Disk format; density/sides +DD.SPT rmb 2 Sectors/track +DD.RES rmb 2 Reserved for future use +DD.SIZ equ . Device descriptor minimum size +DD.BT rmb 3 System bootstrap sector +DD.BSZ rmb 2 Size of system bootstrap +DD.DAT rmb 5 Creation date +DD.NAM rmb 32 Volume name +DD.OPT rmb 32 option area + + +* +* File Descriptor Format +* + + org 0 +FD.ATT rmb 1 Attributes +FD.OWN rmb 2 Owner +FD.DAT rmb 5 Date last modified +FD.LNK rmb 1 Link count +FD.SIZ rmb 4 File size +FD.Creat rmb 3 Segment list extension +FD.SEG equ . Beginning of segment list + +* Segment List Entry Format + org 0 +FDSL.A rmb 3 Segment beginning physical sector number +FDSL.B rmb 2 Segment size +FDSL.S equ . Segment list entry size + +FD.LS1 equ FD.SEG+((256-FD.SEG)/FDSL.S-1)*FDSL.S +FD.LS2 equ (256/FDSL.S-1)*FDSL.S + +MINSEC set 16 + + + +* +* Directory Entry Format +* + + org 0 +DIR.NM rmb 29 File name +DIR.FD rmb 3 File descriptor physical sector number +DIR.SZ equ . Diectory record size + + +**************** +* +* Static Storage +* +* +* Overall Disk Static Storage +* +* Note: This does Not reserve Any memory for Drive Tables +* Each Driver is responsible for reserving sufficient +* memory for the appropriate number of tables. +* + org V.USER Reserve required +V.NDRV rmb 1 Number of drives + rmb 8 reserved +DRVBEG equ . Beginning of drive tables +* +* Global Storage For Disk Drive Tables +* Each Table Contains The First 'DD.Siz' Bytes +* From Sector 0, And The Current Track, Stepping Rate, +* Bit-Map Use Flag, And Disk Type +* + org 0 + rmb DD.SIZ Device descriptor, sector 0 +V.TRAK rmb 2 Current track +V.BMB rmb 1 Bit-map use flag +V.FileHd rmb 2 open file list for this drive +V.DiskID rmb 2 Disk ID +V.BMapSz rmb 1 Bitmap Size +V.MapSct rmb 1 lowest reasonable bitmap sector + rmb 8 reserved +DRVMEM equ . + + opt l diff -r 7b1b25ff010a -r bd2b07db8917 os9/level1/scfdefs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/scfdefs Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,83 @@ + opt -l + ttl Sequential File Manager (SCF) Definitions + page +********** +* Static storage requirements +* SCF Devices must reserve this space for SCF + + ORG V.USER +V.TYPE rmb 1 Device type or parity +V.LINE rmb 1 lines left until end of page +V.PAUS rmb 1 immediate Pause request +V.DEV2 rmb 2 attached device's static +V.INTR rmb 1 Interrupt char +V.QUIT rmb 1 Quit char +V.PCHR rmb 1 Pause char +V.ERR rmb 1 Accumulated errors +V.XON rmb 1 X-On char +V.XOFF rmb 1 X-Off char +V.RSV rmb 12 Reserve bytes for future expansion +V.SCF equ . total SCF manager static overhead + +*************** +* Character definitions +C$NULL set 0 null char +C$RPET set $01 (ctl A - SOH) REPEAT LAST INPUT LINE +C$INTR set $03 (ctl C - ETX) KEYBOARD INTERRUPT +C$RPRT set $04 (ctl D - EOT) REPRINT CURRENT INPUT LINE +C$QUIT set $05 (ctl E - ENQ) Keyboard Abort +C$BELL set $07 (ctl G - BEL) Line overflow warning +C$BSP set $08 (ctl H - BS ) BACK SPACE +C$LF set $0A LINE FEED +C$CR set $0D CARRIAGE RETURN +C$FORM set $0C (ctl L - FF ) Form Feed +C$XON set $11 (ctl Q - DC1) Transmit Enable +C$XOFF set $13 (ctl S - DC3) Transmit Disable +C$PAUS set $17 (ctl W - ETB) PAUSE charACTER +C$DEL set $18 (ctl X - CAN) DELETE LINE +C$EOF set $1B (ctl [ - ESC) END of FILE +C$SPAC set $20 SPACE +C$PERD set '. +C$COMA set ', + +*************** +* FILE DESCRIPTOR OFFSETS +* + ORG PD.FST +PD.DV2 rmb 2 OUTPUT DEV TBL PTR +PD.RAW rmb 1 READ/WRITE OR RDLIN/WRLIN MODE +PD.MAX rmb 2 READLINE HIGH BYTE COUNT +PD.MIN rmb 1 DEVICES ARE "MINE" IF CLEAR +PD.STS rmb 2 Status routine module addr +PD.STM rmb 2 reserved for Status routine + ORG PD.OPT + rmb 1 DEVICE TYPE +PD.UPC rmb 1 CASE (0=BOTH, 1=UPPER ONLY) +PD.BSO rmb 1 BACKSP (0=BSE, 1=BSE,SP,BSE) +PD.DLO rmb 1 DELETE (0=BSE OVER LINE, 1=CRLF) +PD.EKO rmb 1 ECHO (0=NO ECHO) +PD.ALF rmb 1 AUTOLF (0=NO AUTO LF) +PD.NUL rmb 1 END of LINE NULL COUNT +PD.PAU rmb 1 PAUSE (0=NO END of PAGE PAUSE) +PD.PAG rmb 1 LINES PER PAGE +PD.BSP rmb 1 BACKSPACE charACTER +PD.DEL rmb 1 DELETE LINE charACTER +PD.EOR rmb 1 END of RECORD char (READ ONLY) +PD.EOF rmb 1 END of FILE char +PD.RPR rmb 1 REPRINT LINE char +PD.DUP rmb 1 DUP LAST LINE char +PD.PSC rmb 1 PAUSE char +PD.INT rmb 1 KBD INTR char (ctl c) +PD.QUT rmb 1 KBD QUIT char (ctl q) +PD.BSE rmb 1 BACKSPACE ECHO charACTER +PD.OVF rmb 1 LINE OVERFLOW char (BELL) +PD.PAR rmb 1 PARITY CODE +PD.BAU rmb 1 ACIA BAUD RATE (Color Computer) +PD.D2P rmb 2 OFFSET of DEV2 name +PD.XON rmb 1 ACIA X-ON char +PD.XOFF rmb 1 ACIA X-OFF char +OPTCNT set .-PD.OPT Total user settable options +PD.ERR rmb 1 most recent I/O error status +PD.TBL rmb 2 Device Table addr (copy) + + opt l diff -r 7b1b25ff010a -r bd2b07db8917 os9/level2/Makefile --- a/os9/level2/Makefile Thu Jul 12 06:25:25 2018 +0900 +++ b/os9/level2/Makefile Sat Jul 14 15:16:13 2018 +0900 @@ -12,7 +12,7 @@ LST = -l $@.lst pdisk : $(A09) pdisk.asm -o pdisk $(LST) $(LST) -# $(A09) ../modules/pdisk.asm -o pdisk $(LST) +# $(A09) ../level1/pdisk.asm -o pdisk $(LST) boot : boot.asm $(A09) boot.asm -o boot $(LST) @@ -39,7 +39,7 @@ $(A09) clock.asm -o clock $(LST) pty : - $(A09) ../modules/pty.asm -o pty $(LST) + $(A09) ../level1/pty.asm -o pty $(LST) shell : $(A09) ${SRCCMD}/shell_21.asm -o shell $(LST) diff -r 7b1b25ff010a -r bd2b07db8917 os9/level2/defsfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level2/defsfile Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,1 @@ + use ../../CoCoOS9/level2v3/defsfile diff -r 7b1b25ff010a -r bd2b07db8917 os9/level2/pdisk.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level2/pdisk.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,124 @@ +********************************************* +* Rdisk +* A driver for a Ram disk! +* Modified for os9l1 emulator by Soren Roug 2001 +* + + nam Pdisk + ttl A Device Driver for a RAM Disk + + ifp1 + use defsfile + endc + +*********************** +* Edition History + +* # date Comments +* -- -------- ---------------------------------------------- + +Revision equ 1 +NumDrvs set 2 Number of drives + + org Drvbeg + rmb NumDrvs*DrvMem +RAMSTA equ . + + mod RAMEND,RAMNAM,Drivr+Objct,Reent+Revision,RAMENT,RAMSTA + fcb $FF mode byte + +RAMNAM fcs /PDisk/ + +RAMENT lbra INIT + lbra READ + lbra WRITE + lbra GETSTA + lbra PUTSTA + lbra TERM + +***************************** +* INIT +* Set up the v09 disk + +INIT ldb #NumDrvs Set no drives to 2 +* Setup drive tables + stb V.NDRV,u save it + lda #$FF + leax DRVBEG,u point to drive table start +L0111 sta DD.TOT+1,x + sta