Mercurial > hg > Members > kono > os9 > sbc09
changeset 31:bd2b07db8917 cocoos9lv2v3
CoCoOS9 version
line wrap: on
line diff
--- /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 +
--- /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
--- /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) +
--- /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) +
--- /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 +
--- /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 +
--- /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 +
--- /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 +
--- /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 . +
--- /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 +
--- /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 +
--- /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 <D.TskIPt) ** +** $0200-$02FF : memory block usage map ($80=Not RAM,$01=in use,$02=module) ** +** $0300-$03FF : system's system call dispatch table ** +** $0400-$04FF : user's sysem call dispatch table ** +** $0500-$05FF : process descriptor pointer table ** +** $0600-$07FF : System task (Task 0, ID 1) process descriptor ** +** $0800-$08FF : System's stack space (initial ptr is $0900) ** +** $0900-$09FF : SMAP table ($01=in used, $80=NOT RAM) ** +** $0A00-$0FFF : module directory DAT Images (8 bytes each) ** +** $1000-$10FF : System Global memory (pointed to by D.CCMem) ** +** $1100-$11FF : GRFDRV global memory (DP=$11 in GRFDRV) ** +** $1200-$1247 : shared buffer between Grf/WindInt & GRFDRV (GP buffers) ** +** $1248-$127F : ???? ** +** $1280-$1A7F : the window tables (32 of $40 bytes each) ** +** $1A80-$1C7F : the screen tables (16 of $20 bytes each) ** +** $1C80-$2000 : the CC3 global mem stack (for windowing) ** +** ** +****************************************************************************** +****************************************************************************** + +* User settable values for CC3IO/TC9IO/GrfInt/WindInt & GrfDrv +MaxLines equ 25 Max. Y coord text value +Meg set false "true" if 1 or 2 meg machine + +COMP equ 0 composite monitor +RGB equ 1 RGB Analog monitor +MONO equ 2 monochrome monitor + +Monitor set RGB + +* Global definitions +KeyMse equ %00000001 keyboard mouse enabled +NumLck equ %00000010 Numlock enabled (TC-9 use only) +CapsLck equ %00000100 Capslock enabled +MaxRows equ 640 maximum X co-ordinate allowed on mouse + ifeq MaxLines-25 +MaxLine equ 198 maximum Y co-ordinate allowed on mouse + else +MaxLine equ 191 maximum Y co-ordinate allowed on mouse + endc + +***************************************************************************** +* Static memory area for each window (CC3IO/TC9IO) +* Should set up a write buffer (using parm area?) between SCF, CC3IO & Grfdrv +* so we can 'burst mode' text output (copy up to 48 chars to Grfdrv's parm +* area, and have grfdrv loop through & write all 48 chars to screen in 1 loop +* May have to have smaller limit for text to gfx screens, as it will run much +* slower, unless GrfDrv is made Partially/Fully Re-Entrant +* +* STRONG CAUTION: scfdefs MUST be included first before this file if +* V.SCF is to be resolved properly in pass 1!! + org V.SCF + +WinType rmb 1 window type (0=Windint/GrfInt,2=VDGInt) $1D +InfVld rmb 1 Rest of info here valid? (0=NO, >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
--- /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 +
--- /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
--- /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 <pathname> {[-]<opts>}" + 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 <parmptr save param ptr + clr <u0007 + com <u0007 + clra + os9 I$Open open file on commandline + bcc L00D9 branch if ok + ldx <parmptr get saved param ptr + lda #DIR.!READ. load perms + os9 I$Open open as directory + bcc L00D9 branch if ok + ldx <parmptr get param ptr + lda #DIR. load different perms + os9 I$Open try one more time + bcs L0114 branch if error +L00D9 sta <fpath save off path + stx <cmdperms save updated parm ptr + leax pathopts,u point X to buffer + ldb #SS.Opt load with status code + os9 I$GetStt get status + bcs L0114 branch if error + clrb + lda ,x get path type + cmpa #DT.RBF check if rbf path + lbne L01AC branch if not + ldx <parmptr else get parm ptr + leay <filename,u point to buffer + lda ,x+ get file name character + cmpa #PDELIM path delimiter? + bne L0106 no +L00FA sta ,y+ else save char in Y + lda ,x+ get next file name char + cmpa #C$PERD period? + bcs L0106 branch if not + cmpa #PDELIM path delimiter? + bne L00FA branch if not +L0106 lda #'@ + ldb #C$SPAC + std ,y++ + leax <filename,u point X to filename + lda #READ.!WRITE. load perms + os9 I$Open open in raw mode +L0114 lbcs L01AC branch if error + sta <rawpath + lda <fpath + clr <u001F,u + pshs u + ldx <u001C,u get MS 16 bits + ldu <u001E,u get LS 16 bits + lda <rawpath get path + os9 I$Seek seek + puls u + bcs L01AC branch if error + leax <fdesc,u point to buffer + ldy #FD.SEG + os9 I$Read + bcs L01AC + os9 F$ID get ID + cmpy #$0000 super user? + beq L014B branch if so + cmpy <fdesc+FD.OWN,u is user same as file's owner? + bne L01C1 branch if not +L014B ldx <cmdperms point to perms on cmd line + lbsr L021D + bcs L018B +L0152 lbsr L021D + bcc L0152 + clrb + lda ,x + cmpa #$0D + bne L01AC + pshs u + ldx <u001C,u + ldu <u001E,u + lda <rawpath + os9 I$Seek seek + puls u + bcs L01AC branch if error + leax <fdesc,u point to file desc + ldy #1 only 1 byte + os9 I$Write write out new attributes + bcs L01AC branch if error + os9 I$Close close file + bcs L01AC branch if error + lda <fpath get file path + os9 I$Close close file + bcs L01AC branch if error + ldb <u0007 + beq L01BE +L018B ldb <fdesc,u get attribute + leax >L00B2,pcr + leay <u0078,u + lda ,x+ +L0197 lslb + bcs L019C + lda #'- +L019C sta ,y+ + lda ,x+ + bpl L0197 + lda #C$CR + sta ,y+ + leax <u0078,u + clrb + bra L01B0 +L01AC leax >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 <fpath + ldx #$0000 + ldu #$0040 + os9 I$Seek + ldu $04,s + bcs L01BE +L01E0 leax <u0028,u + ldy #$0020 + os9 I$Read + bcs L01F7 + tst ,x + beq L01E0 + leax >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 <u0006 +L021F lda ,x+ + cmpa #C$SPAC + beq L021F + cmpa #C$COMA + beq L021F + cmpa #'- + bne L0231 + com <u0006 + lda ,x+ +L0231 leax -1,x + leay >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 <u0006 + lbeq L01C8 + lbsr L01CF +L0268 puls y,b,a + lda <fdesc,u + eora <u0006 + ora -$01,y + eora <u0006 + sta <fdesc,u + clrb + rts +L0278 eorb <u0006 + stb <u0007 + clrb + puls pc,y,b,a +L027F coma + puls pc,y,x + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/binex.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,245 @@ +******************************************************************** +* Binex - Motorola S-Record utility +* +* $Id: binex.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 67 Original Tandy distribution version + + nam Binex + ttl Motorola S-Record utility + +* Disassembled 98/09/15 00:08: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 67 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 1 +u0002 rmb 2 +u0004 rmb 1 +u0005 rmb 1 +u0006 rmb 1 +u0007 rmb 2 +u0009 rmb 1 +u000A rmb 2 +u000C rmb 1 +u000D rmb 31 +u002C rmb 1 +u002D rmb 1 +u002E rmb 1 +u002F rmb 2 +u0031 rmb 2 +u0033 rmb 2 +u0035 rmb 656 +size equ . + +name fcs /Binex/ + fcc "Copyright 1982 Motorola, Inc." + fcb $01 + +start stx <u0002 + lda #$01 + os9 I$Open + bcc L003C +L0039 os9 F$Exit +L003C sta <u0000 + stx <u0002 + lda #$02 + ldb #$7F + os9 I$Create + bcs L0039 + sta <u0001 + stx <u0002 + ldd #$0000 + sta <u0006 + std <u000A + std <u002F + ldx #$5330 + stx <u002D + ldx #$3030 + stx <u0031 + stx <u0033 +L0062 leax >L0217,pcr + lda #$01 + ldy #$0022 + os9 I$Write + leax <u0031,u + lda #$00 + ldy #$0005 + os9 I$ReadLn + leay -$01,y + cmpy #$0000 + beq L0062 + cmpy #$0004 + bhi L0062 + beq L00A7 + tfr y,d + pshs b + decb + leax <u0031,u + leay $04,x +L0095 lda b,x + sta ,-y + decb + bpl L0095 + ldb #$04 + subb ,s+ + lda #$30 +L00A2 sta ,-y + decb + bgt L00A2 +L00A7 lbsr L0178 + 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 <u0000 + leax u000C,u + ldy #$0020 + os9 I$Read + lbcs L0160 + cmpy #$0000 + lbeq L0160 + lda <u0006 + bne L0120 + inc <u0006 + lda #$31 + sta <u002E + ldx <u0004 + stx <u000A + ldx u000C,u + cmpx #$87CD + beq L0120 + leax >L0239,pcr + pshs y + ldy #$003C + lda #$01 + os9 I$Write + leax <u0035,u + ldy #$0002 + lda #$00 + os9 I$ReadLn + puls y + lda <u0035,u + anda #$DF + cmpa #$59 + beq L0120 +L011C clrb + os9 F$Exit +L0120 sty <u0007 + tfr y,d + addb #$03 + stb <u0009 + leax u0009,u + clra + ldb ,x +L012E adda ,x+ + decb + bne L012E + coma + sta ,x + leax u0009,u + leay <u002F,u + ldb ,x + incb +L013E bsr L01B6 + decb + bne L013E + ldb #$0D + stb ,y + leax <u002D,u + ldy #$0073 + lda <u0001 + os9 I$WritLn + lbcs L0039 + ldd <u000A + addd <u0007 + std <u000A + lbra L00CA +L0160 cmpb #$D3 + lbne L0039 + lda #$39 + cmpa <u002E + beq L011C + sta <u002E + ldx <u0004 + stx <u000A + ldy #$0000 + bra L0120 +L0178 bsr L017C + sta <u0004 +L017C lda ,x+ + bsr L0197 + lsla + lsla + lsla + lsla + anda #$F0 + pshs a + lda ,x+ + bsr L0197 + adda ,s+ + sta <u0005 + adda <u002C + sta <u002C + lda <u0005 + rts +L0197 suba #$30 + bmi L01A6 + cmpa #$09 + ble L01A5 + suba #$07 + cmpa #$0F + bhi L01A6 +L01A5 rts +L01A6 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
--- /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 <FPath +InpLoop lda #1 + leax <Prompt,pcr + ldy #PromptL + os9 I$WritLn + clra + leax LineBuff,u + ldy #128 + os9 I$ReadLn + bcs Close + cmpy #$0001 + beq Close + lda <FPath + os9 I$WritLn + bcc InpLoop + bra Exit +Close lda <FPath + os9 I$Close + bcs Exit + clrb +Exit os9 F$Exit + +Prompt fcc "? " +PromptL equ *-Prompt + + emod +eom equ * + end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/cobbler.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,416 @@ +******************************************************************** +* Cobbler - Boot generation utility +* +* $Id: cobbler.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 7 Reworked AD +* 8 Fixed error where $40+C$CR should have been BGP 98/10/20 +* $40*256+C$CR + + nam Cobbler + ttl Boot generation utility + +* Disassembled 94/10/23 11:19:48 by Alan DeKok + +* WARNING: This is a LEVEL II Cobbler only! + + ifp1 + use os9defs + use scfdefs + use rbfdefs + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 8 + + mod eom,name,tylg,atrv,start,size +u0000 rmb 3 +u0003 rmb 1 +u0004 rmb 12 +u0010 rmb 5 + +u0015 rmb 1 +u0016 rmb 2 +u0018 rmb 2 +* Everything before here is the DD.foo equivalent +PathO rmb 1 path output to OS9boot file +Path rmb 3 path to /DEVICE@ +KernelF rmb 1 0=write kernel track, 1= don't +BootF rmb 1 0=write boot track, 1=don't +FileNm rmb 20 /DEVICE/OS9Boot memory + rmb 16 +SysDAT rmb 16 copy of the system DAT image +FileDesc rmb $20 room for first bit of file descriptor +AllMap rmb 1024 allocation map is entirely too large... +Buffer rmb $2000 only copy 8k at a time + rmb 200 room for the stack +size equ . + +name fcs /Cobbler/ + fcb edition my version of cobbler + +L0015 fdb $0000 minimal DAT image for checking out the system. + +OS9Boot fcs '/OS9Boot' +Rel fcc /Rel/ + +start clr <KernelF force a write of the kernel track + clr <BootF force a write of the boot track +skip ldd ,x+ + cmpa #C$SPAC space? + beq skip + cmpa #'- hyphen? + bne s.001 + + andb #$DF make it uppercase + cmpb #'K force no write of kernel track? + bne check.b no, check for the boot track stuff + stb <KernelF save the kernel flag + bra s.000 + +check.b cmpb #'B don't write boot? + bne go.help no, print out help message + stb <BootF save the boot flag + +s.000 leax 1,x skip the character + lda ,x++ get the next character, and point to the next one + cmpa #$20 space? + bne go.help no, print out a help message + +s.001 leax -1,x + lda #'/ + cmpa ,x is the first character a slash? +Go.help lbne Help not a device name, error out + os9 F$PrsNam parse the name + lbcs Exit exit on error + lda #'/ is the next character a slash? + cmpa ,y check it + lbeq Help yes, dump out a help message + ldy #FileNm point to the filename buffer +L013C sta ,y+ make first character a slash + lda ,x+ copy the name over + decb + bpl L013C + ldd #$40*256+C$CR '@+CR' + std ,y save in the buffer + ldx #FileNm point to the filename again + lda #UPDAT. + os9 I$Open open /DEVICE@ + sta <Path save the path to the file + lbcs Exit dump out help on an error + leax ,y point to end of '/DEVICE' name + leay >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 <Path + os9 I$Seek seek to LSN0 + lbcs Exit dump out error if encountered + +* X is implicitely zero from the call above + ldy #DD.BSZ+2 read everything up to the boot size + lda <Path + os9 I$Read get it + lbcs Exit + + tst <BootF replace OS9Boot? + lbne no.boot no, go write the kernel track + + ldd <DD.BSZ get the boot size + lbeq L019F if non-existent, don't delete it + ldx #FileNm point to /DEVICE/OS9boot + os9 I$Delete delete it, if it exists + clra + clrb + sta <DD.BT NO OS9boot file on this disk + std <DD.BT+1 + std <DD.BSZ + lbsr L045A dump out LSN0 information again + +L019F ldd #(UPDAT.*256)+UPDAT. + ldx #FileNm create a /DEVICE/OS9Boot file + os9 I$Create + lbcs Exit + sta <PathO + + leax >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 <D.BtPtr,x address of boot in system memory + pshs d save a copy of it + ldd <D.BtSz,x size of the OS9Boot file in system memory + std <DD.BSZ save in the boot size info for LSN0 + pshs d save the size +L01F7 ldy #$2000 only do 8k at a time + cmpy ,s default to one block??? + bls L0203 + ldy ,s get the actual boot size +L0203 pshs y save a copy of it + ldx #SysDAT get dat image + tfr x,d save it + ldx $04,s get start of boot in memory + ldu #Buffer + os9 F$CpyMem copy one block at a time + lbcs Exit + ldy ,s get how much we're copying + ldx #Buffer point to the buffer + lda <PathO dump it to /DEVICE/OS9Boot file + os9 I$Write + lbcs Exit + puls d get size of what we're copying + ldy $02,s get start address of boot file in system memory + leay d,y go to the next group of data + sty $02,s save new start a address + nega + negb + sbca #$00 + ldy ,s get size of boot file left + leay d,y take out what we've done + sty ,s save it + bne L01F7 if not done, continue + leas $04,s remove start,size from the stack + + lda <PathO path to OS9Boot + ldb #SS.FD get FD information + ldx #FileDesc read the file descriptor sector + ldy #$0020 only get the first 32 bytes of it + os9 I$GetStt + lbcs Exit + + os9 I$Close close the path + lbcs Exit + + ldd <FD.SEG+3+2+3,x get size of SECOND segment in file + lbne L0488 if not zero, the file is fragmented + ldb <FD.SEG,x get first byte of address + stb <DD.BT save starting sector of the bootstrap file + ldd <FD.SEG+1,x + std <DD.BT+1 save the rest of the LSN# + lbsr L045A seek to LSN0 and dump out this information, too + + lda <KernelF do we do a kernel track? + bne ClnExit no, don't even check for floppy stuff + + lda <DD.FMT is it a HD? (Bit 7 set) + bpl Floppy if bit 7 is clear, go do track 34 stuff. + +ClnExit clrb no error +Exit1 OS9 F$Exit and exit + +no.boot lda <DD.FMT is it a HD? (bit 7 set) + bpl Floppy if OK, go write it + coma set carry + ldb #E$BTyp bad media type + bra Exit1 + +Floppy ldd #$0001 track 0, sector 1: LSN 1 + lbsr L0440 seek to it + + ldx #AllMap point to the allocation map buffer + ldy <DD.MAP get the size of the map + lda <Path + os9 I$Read read in the allocation map + bcs Exit1 + + ldd <DD.MAP get number of bytes in the map + leau d,x point to the END of the map + ldd #$2200 track 34, sector 0 + lbsr Tk2LSN get LSN of this in D + pshs d save it for later + ldy #0018 force the boot track to be 18 sectors long + OS9 F$SchBit search for 18 free sectors at D,X: ending at U + cmpd ,s++ did we find bits at the starting bit number? + bne Check no, check for REL on the disk + cmpy #0018 if found at the right spot, did we find 18 bits? + beq AllClr if so, go allocate them + +Check ldd #$2200 track 34, sector 0 + lbsr L0440 seek to it + + ldx #Buffer + ldy #$0100 read one sector + lda <Path + os9 I$Read get the first sector of the boot track + lbcs Exit + + ldd ,x++ get the first 2 bytes + cmpd #$4F53 is it 'OS'? + lbne L0496 files present on track 34, give error + ldd ,x++ + cmpa #$20 is it a BRA? + lbne L0496 + ldd ,x get some bytes from the sector + cmpd #M$ID12 is it a module header? + beq map.blk yes, go write out the kernel track + leax 2,x skip the $1205 sync bytes + ldd ,x grab the header + cmpd #M$ID12 is there a module here? + lbne L0496 no, error out + bra map.blk don't allocate track 34, REL already exists on it + +* We've found 18 bytes at D,X in the allocation bit map +* D,X,Y are set up from above +AllClr OS9 F$AllBit allocate the bits in the bitmap + +* possible problems here, as the r/w of the allocation bitmap is NOT atomic. +* some other process may come along and grab the sectors we want. +L0315 ldd #$0001 track 0, sector 1 + bsr L0440 seek to it + ldx #AllMap + ldy <DD.MAP + lda <Path + os9 I$Write dump out the allocation map again + lbcs Exit + +* Do a F$Link to REL? +map.blk ldx #$003F the boot track is in block 63 + ldb #1 one block + OS9 F$MapBlk map the block in + lbcs L049D error finding boot track in memory + + ldd #$2200 track 34, sector 0 + bsr L0440 seek to it + lda <Path + leax $0D00,u the boot track starts out at $ED00 + ldy #$1200 dump out 18 sectors + os9 I$Write dump out REL, Boot, OS9p1 + pshs cc,b + ldb #1 + OS9 F$ClrBlk un-map block $3F + puls cc,b restore possible error code + bcs L048F if there was an error, print it out and exit + os9 I$Close close the path + clrb no erros + bra Exit + +****************************** +* Convert track,sector to LSN +* +* Entry: A = track number +* B = sector number +* Exit : D = LSN# of that sector +Tk2LSN pshs b + ldb <DD.FMT + andb #$01 + beq L037F + ldb #$02 disk is 2-sided + bra L0381 + +L037F ldb #$01 disk is 1-sided +L0381 mul multiply sides by tracks + lda <DD.TKS track size in sectors + mul get LSN of the track + addb ,s add in the sector + adca #$00 make it 16-bit + leas $01,s dumb dumb dumb people... + rts + +L0440 pshs u,y,x,d + bsr Tk2LSN convert track,sector to LSN + pshs a + tfr b,a + clrb shuffle so 16-bit LSN goes to + tfr d,u 32-bit address, with the lower + puls b 16 bits all zero + clra + tfr d,x + lda <Path + os9 I$Seek seek to it + bcs L048F + puls pc,u,y,x,d + +L045A clra + clrb + tfr d,x + tfr d,u go to LSN0 + + lda <Path + os9 I$Seek seek to LSN0 + + ldy #DD.DAT X=$0000 already... + lda <Path + os9 I$Write dump it out + bcs Exit + rts + +Help leax <HelpMsg,pcr + clrb + +Print pshs b,cc + lda #$02 + ldy #$0200 + os9 I$WritLn + comb + puls b,cc + +Exit os9 F$Exit + +L0488 leax >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] </devname>' + 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
--- /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 <optbuff,u point u to 20th byte + +clearit clr ,-u clear byte + cmpu ,s done ? + bhi clearit loop back + tfr y,d move in top of mem (after param area) + subd ,s++ subtract current stack + subd #$0300 and back off variable storage + clrb round off to page bondary + std <bufsize buffer size + pshs x save x register + +getopt lda ,x+ get a char + cmpa #'- was it a '-'?? + beq chkopt yes..go check opt + cmpa #C$CR was it a <cr>?? + 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 <single set s option + bra getopt and check next char + +openin puls x restore line pointer + lda #READ. open first file + os9 I$Open + lbcs chkerr error..go see what it was + sta <inpath save path number + pshs x save second path name start + leax <fdbuff,u point to FD buffer + ldy #16 bytes to read + ldb #SS.FD get file descriptor + os9 I$GetStt + puls x restore line pointer + bcs getintyp skip this on eror + tst <single single drive copy ? + beq getintyp no..skip this stuff + lda ,x get first char of path name + ldb #E$BPNam load bad path name error message + cmpa #'/ was it a path separaor ? + bne errjump nope..error + +getintyp pshs x save out path name start + lda <inpath get path number + bsr getopts get option section + lda ,x get device type + sta <indevtyp save it + ldb #$0F default attributes...read,write,execute,public + cmpa #DT.RBF was device type RBF ? + bne openout nope...don't get file size/attributes + pshs u,x save registers + lda <inpath get path number + ldb #SS.Size Get File size + bsr getstat do the GetStt call..exit on error + stx <fsizemsb save 2 msb's of file size + stu <fsizelsb save 2 lsb's of file size + puls u,x restore registers + ldb <$13,x get file attributes + +openout stb <attribs save attributes + ldx ,s get start of second path name + lbsr destsnd send destination msg + lda #UPDAT. open file for update + ldb <attribs get attributes + os9 I$Create create the file + puls x restore x register + bcc open010 no error..skip this + inc <verify set verify off + lda #WRITE. open filein write only mode + ldb <attribs get atributes + os9 I$Create create the file + bcs errjump exit on error + +open010 sta <outpath save second path number + bsr getopts get option section + ldb ,x get device type + cmpb #DT.RBF was it RBF + beq setvfy yup...skip this + inc <verify set verify off + bra mainloop and skip all this + +errjump lbra errexit nope....error + +getopts leax <optbuff,u point to buffer + ldb #SS.Opt get option section of path descritor + +getstat os9 I$GetStt + bcs errjump exit on error + rts + +setvfy tst <verify do we want verify on + bne setsiz nope...dont set driver verify on + ldb #1 verify + stb 8,x turn verify on + ldb #SS.OPT set options + os9 I$SetStt + bcs errjump exit on error + +setsiz lda <indevtyp get device type + cmpa #DT.RBF is it an RBF file + bne mainloop nope...dont preset file size + pshs u save register + lda <outpath get out path number + ldb #SS.Size set file size + ldx <fsizemsb get 2 msb's of in file size + ldu <fsizelsb get 2 lsb's of in file size + os9 I$SetStt set the size + bcs errjump exit on error + puls u restore register + lda <outpath get out path number + leax <fdbuff,u point to FD buffer + ldy #16 number of bytes to write + ldb #SS.FD write out the FD (for dates,etc.) + os9 I$SetStt + +mainloop leax buffer,u point to buffer + clra source drive code + lbsr chkdrive send source switch msg + lda <inpath get in path number + ldy <bufsize get buffer size + os9 I$Read read a block + bcs chkeof2 if error..go check which one + lbsr destsnd send destination switch msg + lda <outpath get out path number + os9 I$Write write the block out + bcs errjump exit on error + tst <verify are we verifying ? + bne chkeof skip this + pshs u,y save registers + ldx <writemsb get 2 msb's of last write + ldu <writelsb get 2 lsb's of last write + lda <outpath get out path number + os9 I$Seek + bcs errjump exit on error + ldu 2,s get original u back + leau buffer,u point to buffer start + ldd ,s get bytes written + addd <writelsb add on to current 2 lsb positions + std <writelsb save them + ldd ,s get bytes written + bcc vfy000 skip if no carry + leax 1,x bump up 2 msb's + stx <writemsb and save them + +vfy000 ldy #$0100 chars to read for verify + std ,s save it + tsta did we write more than 255 bytes ? + bne vfy010 yes...only read 256 + tfr d,y else xfer amount we did write + +vfy010 ldx 2,s get u register + leax $200,x point to start of verify buffer + lda <outpath get output path number + os9 I$Read read a block in + bcs errexit exit on error + +vfy020 lda ,u+ get char from in buffer + cmpa ,x+ get char from out buffer + bne snderr1 not equal...send write verfiy msg + leay -1,y decrement read count + bne vfy020 if more..loop back + ldd ,s get write count back + subd #$0100 subtract verify buffer size + bhi vfy000 if more left...loop back + puls u,y else restore registers + +chkeof lda <inpath get in path number + ldb #SS.EOF check for end of file + os9 I$GetStt + bcc mainloop nope...loop back + cmpb #E$EOF are we at end of file ? + beq closeout yes...close file + + +chkeof2 cmpb #E$EOF check for end of file + bne errexit nope...error exit + bsr destsnd send msg for disk switch + +closeout lda <outpath get out path number + os9 I$Close close the file + bcc exitok exit w/o error if o.k. + bra errexit else error exit + +errmsg1 fcb $07 + fcc /Error - write verification failed./ + fcb $0D + +snderr1 leax errmsg1,pcr address of 'write verify failed' msg + bsr sndline send it + comb set carry + ldb #$01 set error + bra errexit exit + +chkerr cmpb #E$BPNam was it bad path name + bne errexit error exit + +sndinstr leax Help,pcr get instructions + bsr sndline send them +exitok clrb +errexit os9 F$Exit + +sndline ldy #256 max chars to send + lda #1 std out + os9 I$WritLn write the line + rts + +* Send message and wait for disk switch for single drive copy + +destsnd lda #1 set flag for destination message + +chkdrive tst <single are we doing single drive copy + beq msgrts nope..just exit + pshs y,x else save registers + +sndsrc pshs a save drive flag + tsta do we want source drive ? + bne snddst nope..do destination message + leax srcmsg,pcr point to 'source' msg + ldy #srcmsgsz chars to send + bra msgsnd go send it + +srcmsg fcc /Ready SOURCE/ +srcmsgsz equ *-srcmsg + +dstmsg fcc /Ready DESTINATION/ +dstmsgsz equ *-dstmsg + +cntmsg fcc /, hit C to continue: / +cntmsgsz equ *-cntmsg + + +snddst leax dstmsg,pcr point to 'destination' msg + ldy #dstmsgsz chars to send + +msgsnd lda #1 std out + os9 I$Write write it + leax cntmsg,pcr point to 'hit C ...' + ldy #cntmsgsz get size of message + os9 I$Write write it + leax ,-s back up for dummy buffer + ldy #1 chars to read + clra std in + os9 I$Read read one char + lda ,s+ + pshs y,x,a save registers + leax crmsg,pcr point to <cr> + 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 <Path1> <Path2> [-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
--- /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, <gene_heskett@wvlink.mpl.com> +* +* 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 <u0006 + os9 F$Time + bsr PrntDate go print the date in buffer + lda [,s++] now, did we have a -t + eora #$54 option on the commandline? + anda #$DF + bne L008C wasn't a t + ldd #C$SPAC*256+C$SPAC else space it out + std ,u++ + bsr L00A1 and go add the time to the buffer +L008C lda #C$CR terminate the line to print + sta ,u+ + lda #1 standard out + ldx <u0006 + ldy #$0028 + os9 I$WritLn and go print it + bcs L009E + clrb +L009E os9 F$Exit +L00A1 ldb <SysHour + bsr L00D2 + ldb <SysMin + bsr L00AB + ldb <SysSec +L00AB lda #$3A + sta ,u+ + bra L00D2 +PrntDate leay >MonTable,pcr + ldb <SysMonth + beq L00C4 + cmpb #$0C + bhi L00C4 +L00BD lda ,y+ + bpl L00BD + decb + bne L00BD +L00C4 bsr PrtStrng + ldb <SysDay + bsr L00D2 + leay >DtComa,pcr + bsr PrtStrng + ldb <SysYear get year + cmpb #100 compare against 100 (2000) + blo is19 if less than, it's 19XX, so branch + subb #100 else subtract 100 + cmpb #100 compare against 100 + blo is20 if less than, it's 20XX, so branch + subb #100 + pshs b + ldb #21 + bra pr +is20 pshs b + ldb #20 + bra pr +is19 pshs b + ldb #19 +pr bsr L00D2 + puls b +L00D2 lda #$2F +L00D4 inca + subb #$64 + bcc L00D4 + sta ,u+ + cmpa #$30 + bne L00E1 + leau -1,u +L00E1 lda #$3A +L00E3 deca + addb #$0A + bcc L00E3 + sta ,u+ + addb #$30 + stb ,u+ + rts + +* * * * * * * * * * * +* make fcs strings printable +PrtStrng lda ,y + anda #$7F + sta ,u+ + lda ,y+ + bpl PrtStrng + rts + +* * * * * * * * * * * +* all done here folks + emod +eom equ * + end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/ddir.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,265 @@ +******************************************************************** +* DDir - Show device table entries +* +* $Id: ddir.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 2 Reworked AD + + nam DDir + ttl program module + +* Disassembled 94/11/05 14:18:05 by Alan DeKok +* +* Future revisions: +* Check <D.Init and DevCnt for entries in device polling table +* check 9/D for size of table - go to V$DESC and look for $87CD + + 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 + +MemStrt rmb 2 +DATImg rmb 4 +u0006 rmb 2 +u0008 rmb 1 +u0009 rmb 8 +DevTbl rmb 2 +u0013 rmb 1 +u0014 rmb 80 +u0064 rmb 512 +u0264 rmb 512 +u0464 rmb 712 +size equ . + +name fcs /DDir/ + fcb edition + +L0012 fcc /Device Table at: / +x12Len equ *-L0012 +Header fcc /Device Desc Driver Static File Usr/ + fcb $0D +L004B fcc /Name Port Name Mem Manager Cnt/ + fcb $0D +L0073 fcc /----------- ------------- ------- ---/ +MyCR fcb $0D + +start ldd ,x get parameter bytes + cmpd #$2D3F -? + lbeq Help + + lda #$01 + stu <MemStrt + leax >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 <P$DATImg,x + stx <DATImg save address of system's DAT image + bra L00D3 + +ClnExit clrb +Exit os9 F$Exit + +L00D3 ldu <MemStrt + leau >u0064,u + ldd <DATImg + ldx #D.DevTbl I/O device table + ldy #$0002 size of the pointer + os9 F$CpyMem + lbcs Exit + + ldu <MemStrt + leay <u0014,u + sty <u0006 + ldd <u0064,u get the pointer + std <DevTbl save it + lbsr L0222 + lbsr L01E6 + + lda #$01 + leax >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 <MemStrt + leau >u0064,u + ldx <DevTbl + ldy #$0100 + ldd <DATImg + os9 F$CpyMem copy the device table over + lbcs Exit + ldb #256/DEVSIZ + stb <u0008 total number of entries to get + stu <u0009 save pointer to start of DevTbl + +L0155 bsr L0165 + dec <u0008 + lbeq ClnExit if done them all, exit + + ldx <u0009 get current pointer + leax DEVSIZ,x go to the next one + stx <u0009 save the pointer again + bra L0155 and loop back + +L0165 ldu <MemStrt + leay <u0014,u + sty <u0006 + lda #C$SPAC space + ldb #$05 +L0171 sta ,y+ save 5 spaces + decb + bne L0171 + + ldx <u0009 get the current pointer + ldx V$DESC,x descriptor? + bne L017D if exists, go do it + rts otherwise exit + +L017D pshs u + leau >u0264,u to another buffer + ldd <DATImg system DAT image + ldy #200 get 200 bytes + os9 F$CpyMem + puls u + lbcs Exit + + leax >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 <u0006 + leay -$01,y + sty <u0006 + ldd M$Port+1,x + lbsr L0222 + lbsr L022A + leax >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 <u0009 + ldd V$STAT,x + lbsr L0222 + lbsr L022A + leax >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 <u0009 + lda V$USRS,x use count + lbsr L0228 print it + ldx <u0006 + leax -$01,x + bra L01E8 + +L01E6 ldx <u0006 + +L01E8 lda #C$CR save a CR in memory + sta ,x + ldu <MemStrt + leax <u0014,u to the buffer + ldy #$0050 80 characters max. + lda #$01 + os9 I$WritLn dump the buffer out + lbcs Exit + rts + +L01FF sta <u0013 dump out A bytes at X + clrb + bra L0207 + +L0204 lbsr L0242 +L0207 incb + cmpb <u0013 + bcc L0219 + lda ,x+ + bpl L0204 + anda #$7F + lbsr L0242 dump it out + cmpb <u0013 + bcc L0221 + +L0219 lbsr L022A + incb + cmpb <u0013 + bcs L0219 +L0221 rts + +L0222 pshs b + bsr L022E + puls a +L0228 bsr L022E +L022A lda #C$SPAC output a space + bra L0242 + +L022E tfr a,b + lsra + lsra + lsra + lsra + bsr L0238 + tfr b,a +L0238 anda #$0F get the number + cmpa #$0A >10? + bcs L0240 no, make it a number + adda #$07 if so, make it A-F +L0240 adda #$30 +L0242 pshs x + ldx <u0006 get buffer pointer + sta ,x+ + stx <u0006 + puls pc,x + +Help lda #1 to STDOUT + leax HMsg,pcr + ldy #HLen + OS9 I$Write + clrb + OS9 F$Exit + +HMsg fcc /ddir: NitrOS-9 v1.21 or greater only./ + fdb C$CR,C$LF +HLen equ *-HMsg + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/defsfile Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,2 @@ + use ../defsfile + use scfdefs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/deiniz.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,88 @@ +******************************************************************** +* DeIniz - Deinitialize a device +* +* $Id: deiniz.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 DeIniz + ttl Deinitialize a device + +* Disassembled 98/09/10 22:57:23 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 330 +size equ . + +name fcs /DeIniz/ + fcb edition + +start lda ,x + cmpa #C$CR + beq L0020 + bsr L0041 + bra L0030 +L001E bsr L0041 +L0020 bsr L0034 + bcs L002C + lda ,x + cmpa #C$CR + bne L001E + ldb #E$EOF +L002C cmpb #E$EOF + bne L0030 +L0030 clrb + os9 F$Exit +L0034 clra + leax u0002,u + ldy #80 + os9 I$ReadLn + bcc L0040 +L0040 rts +L0041 lda #C$SPAC +L0043 cmpa ,x+ + beq L0043 + leax -1,x + stx <u0000 + lda #PDELIM + cmpa ,x + bne L0053 + leax 1,x +L0053 clra + os9 I$Attach + bcs L0070 + os9 I$Detach + bcs L0070 + os9 I$Detach + bcs L0070 + lda ,x+ + cmpa #C$COMA + beq L0041 + lda ,-x + cmpa #C$CR + bne L0041 + rts +L0070 pshs b + lda #$02 + ldx <u0000 + ldy #80 + os9 I$WritLn + puls b + os9 F$PErr + rts + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/del.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,95 @@ +******************************************************************** +* Del - File deletion utility +* +* $Id: del.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 Del + ttl File deletion utility + +* Disassembled 98/09/10 22:43: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 5 + + mod eom,name,tylg,atrv,start,size + +InPath rmb 1 + rmb 450 +size equ . + +name fcs /Del/ + fcb edition + +HelpMsg fcb C$LF + fcc "Use: Del [-x] <path> {<path>} [-x]" + fcb C$CR + +start lda ,x + cmpa #C$CR + beq L0093 + lda #1 + sta <InPath + bsr L0054 + leax -1,x +L0043 lda <InPath + os9 I$DeletX + bcs L0051 + lda ,x + cmpa #C$CR + bne L0043 + clrb +L0051 os9 F$Exit +L0054 lda ,x+ + cmpa #C$SPAC + beq L0054 + cmpa #C$COMA + beq L0054 + cmpa #'- + bne L0067 + bsr L0086 + leax 1,x + rts +L0067 pshs x +L0069 lda ,x+ + cmpa #C$SPAC + beq L0069 + cmpa #C$COMA + beq L0069 + cmpa #'- + beq L007E + cmpa #C$CR + bne L0069 +L007B puls x + rts +L007E bsr L0086 + lda #C$CR + sta -2,x + bra L007B +L0086 lda ,x+ + eora #$58 + anda #$DF + bne L0093 + lda #$04 + sta <InPath + rts +L0093 leax >HelpMsg,pcr + ldy #80 + clra + os9 I$WritLn + clrb + bra L0051 + + emod +eom equ * + end +
--- /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 <u0002 + os9 I$Close + bcs L004D + ldx <u0000 + os9 I$Delete + bcs L004D + lda ,x + cmpa #$0D + bne start + clrb + bra L004D +L0042 pshs b + lda <u0002 + os9 I$Close + puls b + orcc #$01 +L004D os9 F$Exit +L0050 stx <u0000 + lda #$03 + os9 I$Open + bcs L005D + sta <u0002 + bra L0089 +L005D ldx <u0000 + lda #$81 + os9 I$Open + bcs L0090 + sta <u0002 +L0068 ldx <u0000 + os9 F$PrsNam + clra + incb + std <u0046 + lda ,y + cmpa #$2F + bne L0089 + lda #$0D + sta ,y+ + lda #$03 + ldx <u0000 + os9 I$ChgDir + bcs L0090 + sty <u0000 + bra L0068 +L0089 leax <-u001C,u + stx <u0044 + clr <u0003 +L0090 rts +L0091 lda <u0002 + ldb #$00 + leax u0004,u + os9 I$GetStt + bcs L00AB + ldx <u0044 + lda <$33,x + anda #$80 + beq L00AA + clrb + orcc #$01 + bra L00AB +L00AA clrb +L00AB rts +L00AC fcb C$LF + fcc "Deleting directory file. " + fcb C$LF + fcc "List directory, delete directory, or quit ? (l/d/q) " +L00FB fcb C$LF + fcc "Continue? (y/n) " +L010C tstb + bne L013E + lda #$01 + leax <L00AC,pcr + ldy #$004F + os9 I$WritLn +L011B bcs L013E + bsr L0179 + bcs L013E + ldb <u0003 + cmpb #$01 + bne L012A + clrb + bra L013E +L012A bsr L0145 +L012C bcs L013E + leax <L00FB,pcr + ldy #$0011 + lda #$01 + os9 I$WritLn + bcs L013E + bsr L0179 +L013E rts +L013F fcc "DIR" + fcb C$CR +L0143 fcc "E " +L0145 pshs u + leau <u004A,u + pshs u + ldb #$02 + leax <L0143,pcr + lbsr L0270 + ldx <u0000 + ldd <u0046 + decb + lbsr L0270 + lda #$0D +L015E sta ,u+ + tfr u,d + subd ,s + tfr d,y + puls u + leax <L013F,pcr + lda #$11 + clrb + os9 F$Fork + puls u + bcs L013E + os9 F$Wait +L0178 rts +L0179 leax <u004A,u + ldy #$0050 + lda #$00 + os9 I$ReadLn + bcs L01B8 +L0187 lda ,x+ + cmpa #$20 + beq L0187 + eora #$59 + anda #$DF + beq L01AD + lda ,-x + eora #$4C + anda #$DF + beq L01A9 + lda ,x + eora #$44 + anda #$DF + beq L01A5 + bra L01B4 +L01A5 ldb #$01 + bra L01AF +L01A9 ldb #$02 + bra L01AF +L01AD ldb #$04 +L01AF stb <u0003 + clrb + bra L01B8 +L01B4 ldb #$01 + orcc #$01 +L01B8 rts +L01B9 fcc "DELDIR" + fcb C$CR +L01C0 fcc ".." + fcb C$CR +L01C3 ldb <u0003 + bitb #$05 + beq L0210 + lda <u0002 + pshs u + ldu #$0040 +L01D0 ldx #$0000 + os9 I$Seek + puls u +L01D8 bsr L0215 + bcs L0209 + ldx <u0000 + lda #$03 + os9 I$ChgDir + bcs L0214 + ldy <u0048 + clrb + lda #$11 + pshs u + leau <u0024,u + leax <L01B9,pcr + os9 F$Fork + puls u + bcs L0214 + os9 F$Wait + bcs L0214 + leax <L01C0,pcr + lda #$03 + os9 I$ChgDir + bcc L01D8 +L0209 cmpb #$D3 + bne L0214 + clrb + bra L0214 +L0210 ldb #$01 + orcc #$01 +L0214 rts +L0215 lda <u0002 + leax <u0024,u + ldy #$0020 + os9 I$Read + bcs L0238 + lda ,x + beq L0215 + os9 F$PrsNam + lda -$01,y + anda #$7F + sta -$01,y + lda #$0D + sta ,y + clra + incb + std <u0048 +L0238 rts +L0239 fcc "ATTR" + fcb C$CR +L023E fcc " -d" + fcb C$CR +L0242 pshs u + leau <u004A,u + pshs u + ldd <u0046 + decb + ldx <u0000 + bsr L0270 + leax <L023E,pcr + ldb #$04 + bsr L0270 + tfr u,d + subd ,s + tfr d,y + puls u + leax <L0239,pcr + clrb + lda #$11 + os9 F$Fork + bcs L026D + os9 F$Wait +L026D puls u + rts +L0270 decb + lda ,x+ + sta ,u+ + tstb + bne L0270 + rts + + emod +eom equ * + end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/dir.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,380 @@ +******************************************************************** +* Dir - Show directory +* +* $Id: dir.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* This dir initially started from the dir command that came with +* the OS-9 Level Two package, then incorporated Glenside's Y2K +* fix. +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 10 Incorporated Glenside Y2K fixes BGP 99/05/11 + + nam Dir + ttl Show directory + + ttl program module + +* Disassembled 99/04/11 16:36:40 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 10 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 2 +u0002 rmb 1 +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 3 +u0010 rmb 3 +u0013 rmb 29 +u0030 rmb 1 +u0031 rmb 1 +u0032 rmb 1 +u0033 rmb 1 +u0034 rmb 2 +u0036 rmb 6 +u003C rmb 2 +u003E rmb 2 +u0040 rmb 530 +size equ . + +name fcs /Dir/ + fcb edition + +L0011 fcb C$LF + fcs " Directory of " +L0020 fcc "." + fcb C$CR +L0022 fcc "@" + fcb C$CR +L0024 fcb C$CR,C$LF + fcc "Owner Last modified Attributes Sector Bytecount Name" + fcb C$CR,C$LF + fcc "----- ---------------- ---------- ------ --------- ----------" + fcb C$CR,C$LF +L00A0 fcb C$CR,C$LF + fcc "Modified on Owner Name" + fcb C$CR,C$LF + fcc " Attr Sector Size" + fcb C$CR,C$LF + fcc "===============================" + fcb C$CR + fcb C$LF + +start leay <u0040,u + sty <u000B + clr <u0004 + clr <u0003 + clr <u000A + lda #$10 + ldb #$30 + std <u0008 + pshs y,x,b,a + lda #$01 + ldb #$26 + os9 I$GetStt + bcc L0120 + cmpb #$D0 + beq L012D + puls y,x,b,a + lbra L0268 +L0120 cmpx #$0040 + bge L012D + inc <u000A + lda #$0A + ldb #$14 + std <u0008 +L012D puls y,x,b,a + lbsr L0370 + lda ,-x + cmpa #$0D + bne L013C + leax >L0020,pcr +L013C stx <u0000 + lda #$81 + ora <u0004 + pshs x,a + os9 I$Open + sta <u0002 + puls x,a + lbcs L0268 + os9 I$ChgDir + lbcs L0268 + pshs x + leay >L0011,pcr + lbsr L02E6 + ldx <u0000 +L0161 lda ,x+ + lbsr L02B7 + cmpx ,s + bcs L0161 + leas $02,s + lbsr L0370 + lbsr L02B5 + lbsr L02B5 + leax u000D,u + os9 F$Time + leax <u0010,u + lbsr L0328 + lbsr L02F5 + tst <u0003 + beq L01B3 + lda #$01 + ora <u0004 + leax >L0022,pcr + os9 I$Open + lbcs L0268 + sta <u0005 + tst <u000A + bne L01A6 + leax >L0024,pcr + ldy #$007C + bra L01AE +L01A6 leax >L00A0,pcr + ldy #$005A +L01AE lda #$01 + os9 I$Write +L01B3 lda <u0002 + ldx #$0000 + pshs u + ldu #$0040 + os9 I$Seek + puls u + lbra L0253 +L01C5 tst <u0013 + lbeq L0253 + tst <u0003 + bne L01E8 + leay <u0013,u + lbsr L02E6 +L01D5 lbsr L02B5 + ldb <u000C + subb #$40 + cmpb <u0009 + bhi L022C +L01E0 subb <u0008 + bhi L01E0 + bne L01D5 + bra L0253 +L01E8 pshs u + lda <u0032 + clrb + tfr d,u + ldx <u0030 + lda <u0005 + os9 I$Seek + puls u + bcs L0268 + leax <u0033,u + ldy #$000D + os9 I$Read + bcs L0268 + tst <u000A + bne L0231 + ldd <u0034 + clr <u0006 + bsr L0274 + lbsr L02B5 + lbsr L030B + lbsr L02B5 + lbsr L02D3 + lbsr L02B5 + lbsr L02B5 + bsr L026E + bsr L0280 + leay <u0013,u + lbsr L02E6 +L022C lbsr L02F5 + bra L0253 +L0231 lbsr L030B + ldd <u0034 + clr <u0006 + bsr L0274 + bsr L02B5 + leay <u0013,u + lbsr L02E6 + lbsr L02F5 + lbsr L02D3 + bsr L02B5 + bsr L02B5 + bsr L026E + bsr L0280 + lbsr L02F5 +L0253 leax <u0013,u + ldy #$0020 + lda <u0002 + os9 I$Read + lbcc L01C5 + cmpb #$D3 + bne L0268 + clrb +L0268 lbsr L02F5 + os9 F$Exit +L026E lda <u0030 + bsr L0298 + ldd <u0031 +L0274 bsr L029A + tfr b,a + bsr L028E + inc <u0006 + bsr L029C + bra L02B5 +L0280 ldd <u003C + bsr L0298 + tfr b,a + bsr L029A + bsr L02B5 + ldd <u003E + bra L0274 +L028E pshs a + lsra + lsra + lsra + lsra + bsr L029E + puls pc,a +L0298 clr <u0006 +L029A bsr L028E +L029C anda #$0F +L029E tsta + beq L02A3 + sta <u0006 +L02A3 tst <u0006 + bne L02AB + lda #$20 + bra L02B7 +L02AB adda #$30 + cmpa #$39 + bls L02B7 + adda #$07 + bra L02B7 +L02B5 lda #$20 +L02B7 pshs x + ldx <u000B + cmpx #$0090 + bcs L02C4 + bsr L02F1 + ldx <u000B +L02C4 sta ,x+ + stx <u000B + puls pc,x +L02CA fcc "dsewrewr" + fcb $FF +L02D3 fcb $D6,$33,$30,$8C,$F2 + lda ,x+ +L02DA lslb + bcs L02DF + lda #$2D +L02DF bsr L02B7 + lda ,x+ + bpl L02DA + rts +L02E6 lda ,y + anda #$7F + bsr L02B7 + lda ,y+ + bpl L02E6 + rts +L02F1 pshs y,x,b,a + bra L02FB +L02F5 pshs y,x,b,a + lda #$0D + bsr L02B7 +L02FB leax <u0040,u + stx <u000B + ldy #$0050 + lda #$01 + os9 I$WritLn + puls pc,y,x,b,a +L030B leax <u0036,u +L030E bsr L0338 + bsr L0324 + bsr L0324 + bsr L02B5 + bsr L034F + tst <u000A + beq L0320 + bsr L034F + bra L02B5 +L0320 bsr L0332 + bra L02B5 +L0324 lda #$2F + bra L0334 +L0328 tst <u000A + bne L0330 + leax u000D,u + bra L030E +L0330 bsr L034F +L0332 lda #$3A +L0334 bsr L02B7 + bra L034F +L0338 lda #$AE + ldb ,x +L033C inca + subb #$64 + bcc L033C + stb ,x + tfr a,b + tst <u000A + bne L034B + bsr L035F +L034B ldb ,x+ + bra L035F +L034F ldb ,x+ + lda #$2F +L0353 inca + subb #$64 + bcc L0353 + cmpa #$30 + beq L035F + lbsr L02B7 +L035F lda #$3A +L0361 deca + addb #$0A + bcc L0361 + lbsr L02B7 + tfr b,a + adda #$30 + lbra L02B7 +L0370 ldd ,x+ + cmpa #$20 + beq L0370 + cmpa #$2C + beq L0370 + eora #$45 + anda #$DF + bne L0388 + cmpb #$30 + bcc L039A + inc <u0003 + bra L0370 +L0388 lda -$01,x + eora #$58 + anda #$DF + bne L039A + cmpb #$30 + bcc L039A + lda #$04 + sta <u0004 + bra L0370 +L039A rts + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/dirm.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,256 @@ +******************************************************************** +* DirM - Show module directory +* +* $Id: dirm.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Changes: +* +* Added internal print buffer, so an I$Write call is not performed for every +* byte printed out. Halves printout time. +* +* Added SS.ScSiz check, and goes to 32-column output if display is 40 columns +* or less. +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* ? Disassembled at 8:18:38 AD 94/11/10 +* 5 Added internal print buffer, so an I$Write AD ??/??/?? +* call is not performed for every byte printed +* out. Halves printout time. Added SS.ScSiz +* check, and goes to 32-column output if display +* is 40 columns or less. + + nam DirM + ttl Show module directory + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 5 + +Bound equ 40 width at which change is made to 32-col printing + + + mod eom,name,tylg,atrv,start,size + +MD.DAT rmb 2 +MD.Crnt rmb 2 +MD.Strt rmb 2 +MD.End rmb 2 +MD.MPDAT rmb 5 +PntCnt rmb 1 + +*Single rmb 1 single entry/line? +Width rmb 1 width of the output device + +PBuffer rmb 31 internal print buffer +Buffer rmb 40 room for a name buffer +MD.Data rmb 2048 size of the module directory + rmb 200 for the stack +size equ . +name equ * + fcs /DirM/ + fcb edition + +H2 fcc / Bk Ofst Size Ty At Link Name/ + fcb $0d +H3 fcc / -- ---- ---- -- -- ---- -----/ +H1 fcb $0d + +* Believe it or not, all this internal crap is still smaller than having +* a different version of the header for 32/80 columns. +Dump ldu #PBuffer output print buffer + lda ,x+ get first character + sta ,u+ move it over + ldb <Width get the width + +D.01 cmpa #C$CR CR? + beq D.Print yup, dump it out + + lda ,x+ grab a character + sta ,u+ save it + cmpa #C$SPAC was it a space? + bne D.01 no, just save it + + cmpb #Bound 40-column screen? + bls D.01 yes, don't add the space + sta ,u+ if a space, save another copy of it + bra D.01 + +D.Print lda #$01 to STDOUT + ldx #PBuffer + ldy #50 max. size of data to print + OS9 I$WritLn dump it out + bcs Exit + rts + +start equ * + stu <MD.DAT u=$0000 always on startup in OS-9 LII + ldd #$0100+SS.ScSiz stdout, get screen size + OS9 I$GetStt + bcs s.01 + tfr x,d + bra s.02 save actual screen size + +s.01 cmpb #E$UnkSvc + bne Exit + ldb #80 default to 80 columns if error +s.02 stb <Width + + leax <H1,pcr print out initial CR + bsr Dump + leax >H2,pcr header of names + bsr Dump + leax <H3,pcr and hyphens + bsr Dump + + ldx #MD.Data + os9 F$GModDr + bcs Exit + stu <MD.Strt save start address of system module dir + + sty <MD.End save end of the module directory + bra L00B5 + +ClnExit clrb +Exit os9 F$Exit + +L00AD ldx <MD.Crnt + leax MD$ESIZE,x go to the next entry + cmpx <MD.End + bcc ClnExit + +L00B5 stx <MD.Crnt + ldu #PBuffer temporary print buffer + ldd MD$MPDAT,x get module DAT image + beq L00AD if zero, skip this entry + pshs d + cmpd <MD.DAT + beq L00CD + std <MD.DAT save the current DAT image + lda #'- start of this block + fcb $8C skip 2 bytes + +L00CD lda #C$SPAC space + sta ,u+ store it in the data buffer +L00D0 puls d restore current DAT image + subd <MD.Strt take out start of the block + ldy #MD.Data point to module directory data + leay d,y to the DAT image within it + tfr y,d + std <MD.MPDAT save pointer to DAT + lda MD$MPtr,x module pointer + lsra + lsra + lsra + lsra turn address into block offset + anda #$0E keep low bits only + inca DAT image is (junk),(block) + lda a,y get the starting block number + bsr L0165 dump it out + ldd MD$MPtr,x get real pointer + anda #$1F get offset inside block + bsr L0159 print it out + ldx MD$MPtr,x and get pointer again + + pshs u save print buffer pointer + ldu #Buffer to a name buffer + ldy #$000A move first 10 bytes of the module? + ldd <MD.MPDAT + os9 F$CpyMem copy it over + puls u restore print buffer ptr + bcs Exit + + ldd <Buffer+M$Size + bsr L0159 print out the size of the module + lda <Buffer+M$Type + bsr L0165 print out the Ty/Lg + lda <Buffer+M$Revs + bsr L0165 print out At/Rv + ldx <MD.Crnt get current module pointer + ldd MD$Link,x link count + bsr L0159 + ldd <Buffer+M$Name + ldx <MD.Crnt + ldx MD$MPtr,x start address of the module + leax d,x point to the name + + pshs u save print buffer ptr + ldu #Buffer to the buffer again + lda <Width + cmpa #Bound + bhi n.01 + leau -6,u discount 6 spaces + +n.01 ldd <MD.MPDAT + ldy #$0028 copy over 40 bytes of the name + os9 F$CpyMem + tfr u,x save copy of the start of the buffer + puls u restore print buffer ptr + lbcs Exit + + ldb #39 maximum number of characters to check +L013F lda ,x+ get a character + bpl L013F if it's OK + anda #$7F force it to be printable + sta -$01,x save it again + lda #C$CR drop a CR after the last character of the name + + sta ,x save it + ldx #PBuffer point to the start of the buffer + ldy #$0040 64 characters + lda #$01 + os9 I$WritLn print out the name + lbra L00AD start all over again + +* Print out a 2-byte hex number in D +L0159 pshs b save low order character + ldb #$03 3 digits to print out + bsr L0171 print out A + puls a restore low byte + bsr L0173 print it, too + bra L0167 and dump out 2 spaces + +* print out a 1-digit hex number in A +L0165 bsr L016F +L0167 lda <Width check the width + cmpa #Bound + bls L016B if 40 columns or smaller, don't print extra space + lda #C$SPAC space + sta ,u+ +L016B lda #C$SPAC and another space + sta ,u+ + rts + +L016F ldb #$01 +L0171 stb <PntCnt +L0173 tfr a,b save a copy of the number in B + lsra + lsra + lsra + lsra move high nibble into the lower nibble + bsr L017D print out lower nibble of A as hex number + tfr b,a restore lower nibble + +L017D anda #$0F make 0-15 + beq L019C if zero, skip printing it out + clr <PntCnt + cmpa #$0A higher than A? + bcs L0189 no, add in ascii zero + adda #$07 yes, add difference between 9 and A +L0189 adda #'0 turn it into an ascii number + +Print sta ,u+ save the character in the buffer + rts + +L019C dec <PntCnt count down of number of characters to print + bmi L0189 if last one, print out a zero + bra L016B otherwise print out a space + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/display.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,191 @@ +******************************************************************** +* Display - Character display utility +* +* $Id: display.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 2 Original Tandy/Microware version +* 3 Added decimal, text features AD + + nam Display + ttl Character display utility + +* Disassembled 94/12/10 12:27:37 by Alan DeKok + + 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 + + org 0 +T.Delim rmb 1 text delimiter +D.Len rmb 1 length of decimal bytes: 0=1 byte, 1=2 bytes +D.Word rmb 2 decimal byte to output + rmb 200 room for the stack +size equ . + +name fcs /Display/ + fcb edition + +Start pshs x save start address of text to output + leay ,x destination buffer=input buffer (always shrinks it) + leau Hex,pcr point to routine to ouput hex characters + +Loop jsr ,u grab a character + bcs S.01 if error, dump it + stb ,x+ save character in internal buffer + bra Loop and get another one + +S.01 tfr x,d get current pointer into D + subd ,s take out start address + tfr d,y length of the data to print + puls x restore start address + + lda #$01 to STDOUT + os9 I$Write dump it out + bcs Exit exit if error + +ClnExit clrb no error +Exit os9 F$Exit and exit + +Do.Hex leau <Hex,pcr point to main hex routine +Hex ldb ,y+ grab a character + cmpb #', comma? + bne Hex.2 nope, do more checks + +Hex.1 ldb ,y+ grab another character +Hex.2 cmpb #C$SPAC space? + beq Hex.1 yup, skip it + + cmpb #'/ slash? + beq Do.Text yes, go output straight text + cmpb #'\ back-slash? + beq Do.Text yes, output straight text + cmpb #'" double-quote? + beq Do.Text yes, output straight text + + cmpb #'. period? + beq Decimal yes, do a one-time output of decimal byte(s) + + leay -1,y + bsr Nibble turn character in B into a nibble + bcs OK.2 + pshs b save high nibble + bsr Nibble get current character + bcs Hex.3 skip move if next character is not a number + lsl ,s move low nibble into high nibble + lsl ,s + lsl ,s - can't do it before now, because hex number + lsl ,s might be 1 digit long + + addb ,s add high nibble to low nibble + stb ,s save it +Hex.3 clrb no error + puls b,pc restore byte to output, and exit + +Nibble ldb ,y get the current character + cmpb #C$CR end of parameters? + beq Error yes, exit + + cmpb #'0 error if B<'0' + blo Error + + cmpb #'9 + bls OK allow '0' to '9' inclusive + + cmpb #'A error if B<'A' + blo Error + + andb #$DF make the character lowercase + cmpb #'F + bhi Error error if B>'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 <Text,pcr + stb <T.Delim save text delimiter +Text ldb ,y+ grab a character + cmpb <T.Delim text delimiter again? + beq T.Check check for some stuff + cmpb #C$CR end of text? + beq Error yes, signal it + bra OK.1 otherwise allow the character + +T.Check lda ,y get the next character after the delimiter + cmpa <T.Delim is it the same, i.e. 2 delimiters in a row? + beq OK.0 yes, skip the second and output the first + bra Do.Hex otherwise go to hex mode again + +Decimal lda ,y get next character + anda #$DF make it uppercase + cmpa #'W force a word? + bne D.One no, do a straight decimal conversion + leay 1,y skip the 'w' character + lda #1 force 2 bytes + fcb $21 skip the 'clra' following + +D.One clra force 1 byte (may expand to 2) + sta <D.Len save length of the decimal character + + clra start off at zero + clrb + std <D.Word sav starting value of the decimal word to output + +D.Read lda ,y+ grab a decimal digit + cmpa #C$CR done the list? + beq D.CR yes, output the characters and then exit + + cmpa #'0 smaller than zero? + bls D.Done0 yes, we're done this decimal digit + cmpa #'9 + bhi Error + suba #'0 convert ascii to number + + pshs a save the character for later + ldd <D.Word get the current word + aslb + rola N*2 + aslb + rola N*4 + aslb + rola N*8 + addd <D.Word N*8+N=N*9 + addd <D.Word N*9+N=N*10 + addb ,s+ add in our latest character + adca #0 make it 16-bit + std <D.Word + bra D.Read go get another character + +D.Done0 leay -1,y point to character we've tried to convert to dec. +D.Done ldd <D.Word get the byte(s) to output + tst <D.Len check length flag + bne D.Two if forcing 2 bytes, output them + tst <D.Word is high byte zero? + beq D.Exit yes, only output low order byte + +D.Two sta ,x+ save high byte in the output buffer +D.Exit clra + rts + +D.CR leau Error,pcr point to error routine: no more characters + bra D.Done output these characters, and the exit + + emod +eom equ * + end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/dmem.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,141 @@ +******************************************************************** +* DMem - Dump memory from system +* +* $Id: dmem.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 2 Written by Kevin Darling + + nam DMem + ttl Dump memory from system + +* Disassembled 98/09/14 19:24:59 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 1 +u0002 rmb 1 +u0003 rmb 2 +u0005 rmb 3 +u0008 rmb 64 +u0048 rmb 1 +u0049 rmb 447 +u0208 rmb 4296 +size equ . + +name fcs /DMem/ + fcb edition + +L0012 clr <u0000 + clr <u0001 +L0016 lda ,x+ + cmpa #C$SPAC + beq L0046 + cmpa #C$CR + beq L0046 + suba #$30 + cmpa #$0A + bcs L002A + anda #$07 + adda #$09 +L002A lsla + lsla + lsla + lsla + sta <u0002 + ldd <u0000 + rol <u0002 + rolb + rola + rol <u0002 + rolb + rola + rol <u0002 + rolb + rola + rol <u0002 + rolb + rola + std <u0000 + bra L0016 +L0046 leax -1,x + ldd <u0000 + rts + +start lbsr L0128 + lbeq L0119 + cmpa #'- + bne L006D + leax 1,x + bsr L0012 + tfr b,a + pshs x + leax >u0008,u + os9 F$GPrDsc + lbcs L00BC + puls x + bra L0073 +L006D bsr L0012 + clr <u0048 + stb <u0049 +L0073 lbsr L0128 + lbeq L0119 + lbsr L0012 + std <u0003 + lbsr L0128 + beq L0092 + lbsr L0012 + cmpd #$1000 + bls L0095 + ldd #$1000 + bra L0095 +L0092 ldd #$0100 +L0095 std <u0005 + leax >u0048,u + tfr x,d + ldy <u0005 + ldx <u0003 + pshs u + leau >u0208,u + os9 F$CpyMem + puls u + bcs L00BC + ldy <u0005 + leax >u0208,u + lda #$01 + os9 I$Write +L00BB clrb +L00BC os9 F$Exit + +HelpTxt fcc "Use: DMem <block> <offset> [<length>] ! dump" + fcb C$LF + fcc " or: DMem -<id> <offset> [<length>] ! 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
--- /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 <u000A + clr <u0000 + pshs y,x,b,a + lda #1 + ldb #SS.ScSiz + os9 I$GetStt get size of window + bcc L0115 + cmpb #E$UnkSvc + beq L0120 + puls y,x,b,a + lbra L01FE +L0115 cmpx #63 + bge L0120 + ldb #31 + stb <u000A + inc <u0000 +L0120 puls y,x,b,a + ldd #$0001 + std <u0001 + bsr L00F0 + beq L0147 + lda #READ. + os9 I$Open + lbcs L01FE + sta <u0001 + bsr L00F0 + beq L0147 + lda #WRITE. + ldb #$0B + os9 I$Create + lbcs L01FE + sta <u0002 +L0147 ldd #$0000 +L014A std <u0003 + tst <u0000 + beq L0156 + bitb #$3F + bne L017D + bra L0159 +L0156 tstb + bne L017D +L0159 leax >L0090,pcr + lbsr L01EF + leax >L0012,pcr + tst <u0000 + beq L016C + leax >L0091,pcr +L016C lbsr L01EF + leax >L0051,pcr + tst <u0000 + beq L017B + leax >L00D1,pcr +L017B bsr L01EF +L017D leax <u001C,u + lda #$20 + ldb <u000A +L0184 sta ,x+ + decb + bne L0184 + leax <u001C,u + stx <u0006 + lda <u0003 + bsr L0201 + lda <u0004 + bsr L0201 + leax <u0022,u + stx <u0006 + leax <u004B,u + stx <u0008 + ldy #$0010 + tst <u0000 + beq L01B6 + leax <u0021,u + stx <u0006 + leax <u0032,u + stx <u0008 + ldy #$0008 +L01B6 leax u000C,u + lda <u0001 + os9 I$Read + bcs L01F9 + tfr y,d + stb <u0005 +L01C3 bsr L0223 + decb + beq L01D5 + bsr L0223 + tst <u0000 + bne L01D2 + lda #$20 + bsr L0219 +L01D2 decb + bne L01C3 +L01D5 lda #$0D + sta <u005B + tst <u0000 + beq L01DF + sta <u003A +L01DF leax <u001C,u + bsr L01EF + bcs L01FE + ldd <u0003 + addb <u0005 + adca #$00 + lbra L014A +L01EF ldy #$0050 + lda <u0002 + os9 I$WritLn + rts +L01F9 cmpb #E$EOF + bne L01FE + clrb +L01FE os9 F$Exit +L0201 pshs a + lsra + lsra + lsra + lsra + bsr L020F + lda ,s + bsr L020F + puls pc,a +L020F anda #$0F + cmpa #$09 + bls L0217 + adda #$07 +L0217 adda #$30 +L0219 pshs x + ldx <u0006 + sta ,x+ + stx <u0006 + puls pc,x +L0223 lda ,x+ + bsr L0201 + pshs x,a + anda #$7F + cmpa #$20 + bcs L0233 + cmpa #$7E + bcs L0235 +L0233 lda #$2E +L0235 ldx <u0008 + sta ,x+ + stx <u0008 + puls pc,x,a + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/echo.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,42 @@ +******************************************************************** +* Echo - Echo text +* +* $Id: echo.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 5 Original Tandy distribution version + + nam Echo + ttl Echo text + +* Disassembled 98/09/10 22:44:14 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 5 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 450 +size equ . + +name fcs /Echo/ + fcb edition + +start tfr d,y + lda #1 + os9 I$WritLn + bcs Exit + clrb +Exit os9 F$Exit + + emod +eom equ * + end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/exbin.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,187 @@ +******************************************************************** +* Exbin - Motorola S-Record utility +* +* $Id: exbin.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 67 Original Tandy distribution version + + nam Exbin + ttl Motorola S-Record utility + +* Disassembled 98/09/15 00:16:49 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $01 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 1 +u0001 rmb 1 +u0002 rmb 2 +u0004 rmb 1 +u0005 rmb 1 +u0006 rmb 2 +u0008 rmb 1 +u0009 rmb 2 +u000B rmb 1 +u000C rmb 1 +u000D rmb 1 +u000E rmb 1 +u000F rmb 1 +u0010 rmb 2 +u0012 rmb 2 +u0014 rmb 2 +u0016 rmb 656 +size equ . + +name fcs /Exbin/ + fcc "Copyright 1982 Motorola, Inc." + fcb $01 + +start stx <u0002 + lda #$01 + os9 I$Open + bcc L003C +L0039 os9 F$Exit +L003C sta <u0000 + stx <u0002 + lda #$02 + ldb #$7F + os9 I$Create + bcs L0039 + sta <u0001 + stx <u0002 + ldd #$0000 + std <u0009 + std <u000B + sta <u000F + ldx #$4E61 + stx <u0010 + ldx #$6D65 + stx <u0012 + ldx #$3D20 + stx <u0014 +L0065 lda <u0000 + leax <u0016,u + ldy #$0100 + os9 I$ReadLn + lbcs L0114 + leax <u0016,u + tfr x,y + tfr x,d + addd #$0100 + std <u0006 +L0081 lda ,x+ + cmpa #$53 + beq L008D + cmpx <u0006 + bne L0081 + bra L0065 +L008D lda ,x+ + suba #$30 + sta <u000E + beq L009E + cmpa #$09 + bne L009B + bra L0065 +L009B deca + bne L0065 +L009E bsr L011F + sta <u0008 + suba #$03 + sta <u000C + sta <u000D + bsr L011B + tst <u000E + beq L00CD + pshs x + ldx <u0009 + lda <u000F + beq L00C0 + cmpx <u0004 + beq L00C6 + leax >L018D,pcr + bra L00DE +L00C0 ldx <u0004 + lda #$01 + sta <u000F +L00C6 ldb <u000C + abx + stx <u0009 + puls x +L00CD bsr L011F + sta ,y+ + dec <u000D + bpl L00CD + lda <u0008 + inca + beq L00EB + leax >L0171,pcr +L00DE lda #$02 + ldy #$00FF + os9 I$WritLn +L00E7 clrb + lbra L0039 +L00EB lda <u000E + bne L0102 + lda #$0D + sta ,-y + lda #$01 + ldy #$00FF + leax <u0010,u + os9 I$WritLn + lbra L0065 +L0102 lda <u0001 + ldy <u000B + leax <u0016,u + os9 I$Write + lbcc L0065 + lbra L0039 +L0114 cmpb #$D3 + beq L00E7 + lbra L0039 +L011B bsr L011F + sta <u0004 +L011F lda ,x+ + bsr L013A + lsla + lsla + lsla + lsla + anda #$F0 + pshs a + lda ,x+ + bsr L013A + adda ,s+ + sta <u0005 + adda <u0008 + sta <u0008 + lda <u0005 + rts +L013A suba #$30 + bmi L0149 + cmpa #$09 + ble L0148 + suba #$07 + cmpa #$0F + bhi L0149 +L0148 rts +L0149 leax >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
--- /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 <u0001 + cmpd #$0000 + beq L00E0 + lda ,x+ + cmpa #C$CR + beq L00E0 + cmpa #PDELIM + beq L00CC +L00BC leax >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 <u0001 + lda #READ. + os9 I$Open + sta <u0003 + bcs L00FF + leax <u005D,u + ldy #$003F + os9 I$Read +L00FF lbcs L01CD + lbsr L0222 + lda #$22 + lbsr L0218 + leay <u007C,u + lbsr L020C + dec <u0002 + leay >L0052,pcr + lbsr L020C + lbsr L0293 + lbsr L0222 + leay >L005F,pcr + lbsr L020C + leax <u005D,u + lbsr L024F + leay >L0068,pcr + lbsr L020C + dec <u0002 + ldd <u0063 + pshs b,a + clr ,-s + leax ,s + lbsr L024F + leas $03,s + leay >L0072,pcr + lbsr L020C + lbsr L0222 + clra + clrb + sta <u0004 + std <u0005 + sta <u000A + std <u000B + sta <u0007 + std <u0008 + lda <u0003 + ldx #$0000 + pshs u + ldu #$0100 + os9 I$Seek + puls u +L016A leax >u009E,u + ldd #$1000 + cmpd <u0061 + bls L0178 + ldd <u0061 +L0178 leay d,x + sty <u009C + tfr d,y + lda <u0003 + os9 I$Read + bcs L01CD +L0186 lda ,x+ + bsr L01D0 + stb ,-s + beq L019C +L018E ldd <u0005 + addd <u0063 + std <u0005 + bcc L0198 + inc <u0004 +L0198 dec ,s + bne L018E +L019C leas $01,s + cmpx <u009C + bcs L0186 + ldd <u0061 + subd #$1000 + std <u0061 + bhi L016A + bsr L01ED + leax u0004,u + lbsr L024F + leay >L0083,pcr + bsr L020C + leax u0007,u + lbsr L024F + leay >L009F,pcr + bsr L020C + bsr L0222 + lda <u0003 + os9 I$Close + bcs L01CD +L01CC clrb +L01CD os9 F$Exit +L01D0 clrb + cmpa #$FF + beq L01ED + bsr L01D7 +L01D7 bsr L01D9 +L01D9 bsr L01DB +L01DB lsla + bcs L01ED + incb + pshs b,a + ldd <u000B + addd <u0063 + std <u000B + bcc L01EB + inc <u000A +L01EB puls pc,b,a +L01ED pshs b,a + ldd <u000A + cmpd <u0007 + bhi L01FE + bne L0204 + ldb <u000C + cmpb <u0009 + bls L0204 +L01FE sta <u0007 + ldd <u000B + std <u0008 +L0204 clr <u000A + clr <u000B + clr <u000C + puls pc,b,a +L020C lda ,y + anda #$7F + bsr L0218 + lda ,y+ + bpl L020C +L0216 lda #$20 +L0218 pshs x + ldx <u0001 + sta ,x+ + stx <u0001 + puls pc,x +L0222 pshs y,x,a + lda #$0D + bsr L0218 + leax u000D,u + stx <u0001 + ldy #$0050 + lda #$01 + os9 I$WritLn + puls pc,y,x,a +L0237 fcb $98 + fdb $9680,$0f42,$4001,$86a0,$0027,$1000,$03e8,$0000 + fdb $6400,$000a,$0000 + fcb $01 +L024F lda #$0A + pshs y,x,b,a + leay <L0237,pcr + clr <u0000 + ldb ,x + ldx $01,x +L025C lda #$FF +L025E inca + exg d,x + subd $01,y + exg d,x + sbcb ,y + bcc L025E + bsr L02B9 + exg d,x + addd $01,y + exg d,x + adcb ,y + leay $03,y + dec ,s + beq L0291 + lda ,s + cmpa #$01 + bne L0281 + sta <u0000 +L0281 bita #$03 + bne L025C + dec ,s + tst <u0000 + beq L025C + lda #$2C + bsr L0218 + bra L025C +L0291 puls pc,y,x,b,a +L0293 leax <u0077,u + bsr L02C3 + bsr L029A +L029A lda #$2F + lbsr L0218 + clr <u0000 + ldb ,x+ + lda #$FF +L02A5 inca + subb #$64 + bcc L02A5 + bsr L02B9 +L02AC lda #$0A + sta <u0000 +L02B0 deca + addb #$0A + bcc L02B0 + bsr L02B9 + tfr b,a +L02B9 tsta + beq L02BE + sta <u0000 +L02BE tst <u0000 + bne L02D6 + rts +L02C3 ldb ,x+ + lda #$AE +L02C7 inca + subb #$64 + bcc L02C7 + pshs b + tfr a,b + bsr L02AC + puls b + bra L02AC +L02D6 adda #$30 + lbra L0218 + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CoCoOS9/level2v3/CMDS/gfx.asm Sat Jul 14 15:16:13 2018 +0900 @@ -0,0 +1,284 @@ +******************************************************************** +* GFX - CoCo 2 graphics subroutine module +* +* $Id: gfx.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 GFX + ttl CoCo 2 graphics subroutine module + +* Disassembled 98/09/25 21:47:16 by Disasm v1.6 (C) 1988 by RML + + ifp1 + use defsfile + endc + +tylg set Sbrtn+Objct +atrv set ReEnt+rev +rev set $01 +edition set 1 + + mod eom,name,tylg,atrv,start,size +u0000 rmb 0 +size equ . + +name fcs /GFX/ + fcb edition + +FuncTbl fdb Alpha-FuncTbl + fcc "Alpha" + fcb $FF + fdb Circle-FuncTbl + fcc "Circle" + fcb $FF + fdb Clear-FuncTbl + fcc "Clear" + fcb $FF + fdb CColor-FuncTbl + fcc "Color" + fcb $FF + fdb GColr-FuncTbl + fcc "GColr" + fcb $FF + fdb GLoc-FuncTbl + fcc "GLoc" + fcb $FF + fdb JoyStk-FuncTbl + fcc "JoyStk" + fcb $FF + fdb Line-FuncTbl + fcc "Line" + fcb $FF + fdb Mode-FuncTbl + fcc "Mode" + fcb $FF + fdb Move-FuncTbl + fcc "Move" + fcb $FF + fdb Point-FuncTbl + fcc "Point" + fcb $FF + fdb Quit-FuncTbl + fcc "Quit" + fcb $FF + fdb $0000 + +stkdepth set 9 + +start leas -stkdepth,s + ldd 2+stkdepth,s get parameter count + beq BadFunc + tsta param count greater than 255? + bne BadFunc yep, branch to error + leau >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 +
--- /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 <L002B,pcr point to call vector table + ldb $01,s get call # + ldd b,x get offset + leax d,x point to routine + puls b,a purge stack + jmp ,x execute routine + +****************************** +* +* GrfDrv funtcion vector table +* + +L002B fdb $0060 + fdb $00b9 + fdb $0143 + fdb $0331 + fdb $0335 + fdb $03cf + fdb $0485 + fdb $04b2 + fdb $06ce + fdb $054e + fdb $0629 + fdb $0604 + fdb $0575 + fdb $05bd + fdb $0613 + fdb $05d4 + fdb $0631 + fdb $0653 + fdb $05f7 + fdb $06c1 + fdb $06c6 + fdb $06ca + fdb $07d6 + fdb $091f + fdb $0a15 + fdb $0a4d + fdb $0a7f + fdb $0b9b + fdb $0dfa + fdb $0e3b + fdb $102a + fdb $1031 + fdb $1361 + fdb $103d + fdb $13df + fdb $13c6 + fdb $1544 + fdb $1550 + fdb $1674 + fdb $1779 + fdb $17c1 + fdb $1831 + fdb $17D0 + fdb $1bf1 + fdb $167a + fdb $17bc + fdb $182c + fdb $150b + +Init tst >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 <Wt.Siz,x point to next one + leay -$01,y done? + bne L009D no, keep going + +* Initialize screen tables + + leay <16,y get # of screen tables +L00A9 clr St.SBlk,x initialize table entry block # + leax <St.Siz,x move to next one + leay -$01,y done? + bne L00A9 no keep going + leax <$18,x get end of var pointer + stx <$003B save it + clra + clrb + std <$0030 init current screen table pointer + std <$002E init current window table pointer + stb <$0032 init next GP buffer block start # + stb <$0035 + std <$0039 + std <$003D + std <$003F + incb + std <$00B3 + ldb #$20 + std <$00B5 + exg a,b + std <$00B7 + lda #$7E get opcode for JMP instruction + ldx #$414F get address of window switch vector + sta <$00B9 save it for easier access + stx <$00BA + ldx #$4154 get address of GP buffer MMU load + sta <$00BC + stx <$00BD +L00E2 clrb clear errors + rts return + +****************************** +* +* Terminatione routine +* + +L00E4 clr <$0038 clear init flag + clr <$007D clear any buffer block # + ldb <$0032 any GP buffers used? + beq L00F3 no, exit + ldx <$0033 get GP buffer offset + lbsr L0963 delete them + bcc L00E4 keep going till done +L00F3 rts + +****************************** +* +* Swap back to System +* + +L00F4 pshs cc save IRQ status + orcc #IntMasks disable IRQ's + ldx >$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 <L01CF,pcr + anda #$01 + ldb -$0B,y + cmpb a,x + bhi L01CB + addb -$09,y + cmpb a,x + bhi L01CB + lda [<-$10,y] + anda #$30 + ldb #$10 + mul + ldb -$0A,y + leax <L01D1,pcr + cmpb a,x + bhi L01CB + addb -$08,y + cmpb a,x + bhi L01CB + clrb + rts +L01CB comb + ldb #$BD + rts +L01CF bvc L0221 +L01D1 fcb $18 + daa + rora + rora +L01D5 bsr L01F4 + bcs L01F3 + stx -$10,y + ldb <$0060 + stb ,x + bsr L0208 + bcs L01F3 + ldb <$005A + stb $05,x + lbsr L06D2 + stb $06,x + lbsr L02A0 + lbsr L0640 +L01F2 clrb +L01F3 rts +L01F4 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 <L0262,pcr + andb #$0F + ldb b,y + lbsr L0163 + bcs L0258 + ldy #$8000 + pshs y,b + lbsr L0145 + ldb #$FF +L023F stb ,y + bsr L025A + bcs L023F + puls y,b +L0247 stb $01,x + sty $02,x + lda <$0060 + anda #$0F + leay <L0268,pcr + lda a,y + sta $04,x + clrb +L0258 puls pc,y +L025A 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 <L02E0,pcr + ldx a,x + ldd <$0097 +L02DA std ,y++ + leax -$01,x + bne L02DA +L02E0 puls pc,y,x + tfr s,d + tfr s,d + fcb $3E > + 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 <L0616,pcr + ldb $0A,y + cmpb #$05 + bhi L0612 + lslb + ldd b,x + leax d,x + stx <$14,y + bra L062D +L0612 comb + ldb #$BB + rts +L0616 daa + anda #$19 + sbca #$19 + adca #$19 + jmp >$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 <L06B4,pcr + ldb <$0060 + ldb b,x + rts +L06AC bsr L06A4 + leax b,x + anda ,x+ + ldb a,x +L06B4 rts + eim #$08,<$0008 + tst <$0001 + neg <$00FF + com <$0000 + fcb $55 U + ora [>$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 <L078D,pcr + ldb ,y + andb #$0F + lslb + abx + lda >$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 <L07A9,pcr + ldb b,x +L07A7 puls pc,x +L07A9 + + fcb $03 + fdb $0534,$107d,$1009 + fdb $2605,$308c,$04e6,$8535,$9000,$0c02,$0e07,$0905 + fdb $101c,$2c0d,$1d0b,$1b0a,$2b22,$1112,$2103,$0113 + fdb $321e,$2d1f,$2e0f,$3c2f,$3d17,$0815,$0627,$1626 + fdb $3619,$2a1a,$3a18,$2928,$3814 + fdb $0423,$3325,$3524 + fdb $3420,$3b31,$3e37,$393f + fcb $30 + +L07E9 clrb + lsra + rorb + lsra + rorb +L07EE lsra + rorb + std <$0082 + clr <$0084 + tfr x,d + suba #$80 + addd <$0083 + std <$0083 + bcc L0800 + inc <$0082 +L0800 rts +L0801 ldd <$0080 + addd #$001F +L0806 andb #$E0 + std <$0080 + ldb <$0057 + cmpb #$FF + beq L0818 + tst <$0032 + beq L0818 + bsr L0851 + bcc L0848 +L0818 ldd <$0080 + cmpd <$00B7 + bhi L0829 + bsr L0891 + bcs L0829 + lda #$01 + sta $0F,x + bra L082E +L0829 lbsr L08C1 + bcs L0847 +L082E stb <$007D + stx <$007E + lbsr L090D + ldd <$0057 + std $03,x + ldd <$0080 + std $05,x + clra + clrb + std $07,x + std $09,x + std $0C,x + stb $0E,x +L0847 rts +L0848 comb + ldb #$C2 + rts +L084C leax <L0860,pcr + bra L0854 +L0851 leax <L086A,pcr +L0854 stx <$00A1 + bsr L088A + ldb <$0032 + beq L0848 + ldx <$0033 + bra L0882 +L0860 cmpb <$11,y + bne L0878 + cmpx <$12,y + bra L0876 +L086A lda <$0057 + cmpa $03,x + bne L0878 + lda <$0058 + beq L0888 + cmpa $04,x +L0876 beq L0888 +L0878 stb <$007D + stx <$007E + ldb ,x + beq L0848 + ldx $01,x +L0882 jsr <$00BC + jmp [>$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 <L09FA,pcr + stx <$00A1 + ldx $01,s + bsr L09D5 + jsr <$00BC + lbsr L091D + bra L09B1 +L09A0 ldx #$4A23 + stx <$00A1 + ldx $01,s + bsr L09D5 +L09A9 clra + tfr d,x + ldb <$009F + lbsr L016A +L09B1 puls pc,y,x,b +L09B3 pshs x,b + ldb <$0032 + beq L09CF + cmpa <$0032 + beq L09D2 + ldx <$0033 +L09BF jsr <$00BC + cmpa ,x + beq L09D2 + tst ,x + beq L09CF + ldb ,x + ldx $01,x + bra L09BF +L09CF clrb + puls pc,x,b +L09D2 comb + puls pc,x,b +L09D5 pshs u,x,b,a +L09D7 lbsr L088A + ldb <$0035 + beq L0A3D + ldx <$0036 + bra L0A33 + cmpy $05,x + bhi L0A27 + stb $01,s + stx $02,s + clrb + puls pc,u,x,b,a +L09EE tfr u,d + addd $05,u + addd <$00B5 + stx ,--s + cmpd ,s++ + rts +L09FA cmpb $01,s + bne L0A27 + ldu $02,s + ldb ,x + stb ,u + ldd $01,x + std $01,u + exg x,u + bsr L09EE + beq L0A14 + exg x,u + bsr L09EE + bne L0A27 +L0A14 stu $02,s + ldd $05,u + addd $05,x + addd <$00B5 + std $05,u +L0A1E lbsr L092D + bra L09D7 + cmpb ,s + beq L0A1E +L0A27 ldb <$008A + stb <$007D + stx <$007E + ldb ,x + beq L0A3D + ldx $01,x +L0A33 ldu $04,s + jsr <$00BC + ldu $04,s + jmp [>$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 <L0C78,pcr + lda <$0048 + coma + anda b,x + inca + cmpa $0C,y + bne L0C6C + bsr L0C6F + sta <$0000 + ldd $0D,y + bsr L0C6F + stb <$0001 +L0C61 bsr L0C9D + ldb <$0063 + subb <$0050 + stb <$0097 + clrb + puls pc,x +L0C6C comb + puls pc,x +L0C6F leax <L0C7C,pcr + ldb b,x + abx + lsla + ldd a,x +L0C78 rts + asr <$0003 + com <$0001 + com <$0013 + sync + fcb $1B + oim #$80,<$0003 + subb #$07 + subb $0F,x + subb >$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 <L0D6C,pcr + ldb $0E,y + ldb b,x + abx + ldb ,x + leay b,x + sty <$00A3 + anda $01,x + sta <$0008 + ldb $02,x + stb <$0005 + ldb <$0006 + addb #$02 + ldb b,x + leay b,x + sty <$00A1 + sty <$00A5 + puls pc,y +L0D63 inc <$007D + ldb <$007D + jsr <$00BC + ldy <$00B7 +L0D6C rts + fcb $05 + fdb $1010,$635c,$5d5e,$5f60,$6162,$5603,$0458 + fdb $5254,$564d,$0f02,$514d +L0D88 lbsr L0CA4 + pshs y +L0D8D stx <$0072 + ldd <$00AB + std <$0047 + ldd <$009B + std <$009D + lda <$0050 + sta <$0004 + ldb <$0006 + stb <$0097 + ldd <$00A5 + std <$00A1 + ldb <$0074 +L0DA5 ldy ,s + cmpy #$4000 + bcs L0DB4 + stb <$0099 + bsr L0D63 + ldb <$0099 +L0DB4 lda ,y+ + sty ,s + ldy <$0002 + pshs y + leay <L0DD4,pcr + cmpy <$00A1 + puls y + beq L0DD4 + lsla + jmp [>$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 <L0F29,pcr + bra L0F05 +L0F01 addd <$00B5 + leax d,x +L0F05 ldb <$0060 + cmpb #$01 + bne L0F1B + ldb <$006F + cmpb #$08 + bne L0F1B + ldb <$000E + bitb #$10 + bne L0F1B + bsr L0F5C + bra L0F27 +L0F1B leay >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 <L0FFB,pcr + stx <$0010 + ldx ,s + ldb <$000E + bitb #$10 + beq L0FD0 + ldb <$0071 + decb + clra +L0FAD ora b,x + decb + bpl L0FAD + tsta + bne L0FB9 + lsr <$006F + bra L0FD0 +L0FB9 ldb #$FF +L0FBB incb + lsla + bcc L0FBB + ldx #$504C + ldb b,x + leax b,x + stx <$0010 + ldb #$01 +L0FCA incb + lsla + bcs L0FCA + stb <$006F +L0FD0 puls x + ldb -$03,y + stb <$000F + ldy -$05,y + exg x,y + lda <$0071 + deca + sta <$0099 + stx <$000C + lbsr L1E9C + ldx <$000C +L0FE7 lda ,y+ + ldb <$000E + bitb #$20 + beq L0FF2 + lsra + ora -$01,y +L0FF2 jmp [<$10,u] + lsla + lsla + lsla + lsla + lsla + lsla +L0FFB sta <$000B +L0FFD lda <$006F + sta <$0097 + ldb <$000F + stx <$000C +L1005 pshs b + jmp [>$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 <L0FFD,pcr + ora >-$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 L12