# HG changeset patch # User boisy # Date 1044034639 0 # Node ID 7cecd837bcab8210f9d53732d188b6103900de67 # Parent 8a0993b04c8a32454eb199c43295d11477c9b95e Added new commands as part of standard CMDS distribution diff -r 8a0993b04c8a -r 7cecd837bcab level1/cmds/cputype.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level1/cmds/cputype.asm Fri Jan 31 17:37:19 2003 +0000 @@ -0,0 +1,91 @@ +******************************************************************** +* CPUType - Identify 6809 or 6309 +* +* $Id$ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Started ADK ??/??/?? + + nam CPUType + ttl Identify 6809 or 6309 + + ifp1 + use defsfile + endc + +tylg set Prgrm+Objct +atrv set Reent+Rev +rev set 1 +edition set 1 + + org 0 + rmb $0100 for the stack +size equ . + + mod eom,name,tylg,atrv,start,size + +name fcs /CPUType/ + fcb edition + +Start ldd #$FFFF make sure it's non-zero +* clrd executes as a pseudo-NOP ($10), and a CLRA + fdb $104F + tstb + bne is.6809 + leax c.6309,pc + bra save.1 + +c.6309 fcc /CPU: 6309, / +c.6809 fcc /CPU: 6809, / + +is.6809 leax c.6809,pc +save.1 ldy #11 + lda #1 to STDOUT + OS9 I$Write dump it out + +* if it's a 6809, we don't need to do the next part, as we KNOW it's +* running in 6809 emulation mode! + +* this is harder.... are we in native mode? + pshs cc,dp,x,y,u save all registers but D +* pshsw a NOP on a 6809 + fdb $1038 + + leay native,pc native mode PC + leax emulate,pc emulation mode PC + pshs x,y save them + pshs cc,d,dp,x,y,u and the rest of the registers, too. + orcc #Entire set the entire bit in CC + rti + +emulate leas 2,s emulation mode: kill native mode PC + clrb we're in emulation mode + fcb $8C skip 2 bytes +native ldb #1 in native mode + puls u restore W +* tfr u,w a PULSW is an RTS on a 6809 + fdb $1F36 + puls cc,dp,x,y,u restore all of our other registers + + leax m.6809,pc default to 6809 + tstb are we in native mode? + beq print no + leax m.6309,pc get the 6309 message + +print ldy #$0100 a lot + lda #1 to STDOUT + OS9 I$WritLn + clrb no errors + OS9 F$Exit + +m.6809 fcc /running in 6809 mode./ + fcb C$CR + +m.6309 fcc /running in 6309 native mode./ + fcb C$CR + + emod +eom equ * + end + diff -r 8a0993b04c8a -r 7cecd837bcab level1/cmds/devs.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level1/cmds/devs.asm Fri Jan 31 17:37:19 2003 +0000 @@ -0,0 +1,363 @@ +******************************************************************** +* devs - Show device table entries +* +* $Id$ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 2 Original version +* 3 Reworked AD +* 4 Renamed to devs ala OS-9/68K, reworked BGP 03/01/07 + + nam devs + ttl Show device table entries + + 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 + +MaxEnts set 64 maximmum entries we display + + org 0 +memstrt rmb 2 +outptr rmb 2 +counter rmb 1 +narrow rmb 1 +curdte rmb 2 +ddevtbl rmb 2 device table pointer +devcount rmb 1 +descptr rmb 2 +numbytes rmb 1 +lnbuff rmb 80 + IFGT Level-1 +datimg rmb 4 +devtbcpy rmb MaxEnts*DEVSIZ +descrip rmb 256 +syspdesc rmb P$Size + ENDC +stack rmb 200 +size equ . + +name fcs /devs/ + fcb edition + +Header1 fcc /Device Table at: / +x12Len equ *-Header1 +NHeader fcc /Dv Desc Drvr Stat File Usr/ + fcb C$CR +NHeaderL equ *-NHeader +NHeader2 fcc /Nm Port Name Mem Mgr Cnt/ + fcb C$CR +NHeader2L equ *-NHeader2 +NUndln fcc /------- ----------- ---- ---/ + fcb C$CR +NUndlnL equ *-NUndln +Header fcc /Device Desc Driver Static File Usr/ + fcb C$CR +HeaderL equ *-Header +Header2 fcc /Name Port Name Mem Manager Cnt/ + fcb C$CR +Header2L equ *-Header2 +Undln fcc /----------- ------------- ------- ---/ +MyCR fcb C$CR +UndlnL equ *-Undln +Init fcs /Init/ + +start ldd ,x get parameter bytes + cmpd #$2D3F -? + lbeq Help + lda #MaxEnts get maximum entries we support + sta MyCR,pcr + ldy #$0001 + os9 I$WritLn output a CR + lbcs Exit + leax >Header1,pcr dump out header + ldy #x12Len + os9 I$Write + lbcs Exit + IFGT Level-1 + lda #$01 + leax >syspdesc,u + os9 F$GPrDsc get system process descriptor + bcs Exit + leax D.DevTbl + std MyCR,pcr dump out another CR + ldy #$0001 + os9 I$WritLn + lbcs Exit + + leax >Header,pcr + ldy #HeaderL + tst NHeader,pcr + ldy #NHeaderL +branch1 os9 I$WritLn + lbcs Exit + + leax >Header2,pcr + ldy #Header2L + tst NHeader2,pcr + ldy #NHeader2L +branch2 os9 I$WritLn + lbcs Exit + leax >Undln,pcr + ldy #UndlnL + tst NUndln,pcr + ldy #NUndlnL +branch3 os9 I$WritLn + lbcs Exit + + IFGT Level-1 + ldu devtbcpy,u + ldx descrip,u to another buffer + ldd descrip,u point to the start of the buffer + ELSE + stx descrip,u + ELSE + ldx descrip,u +* ELSE +* ldx descrip,u + ELSE + ldx 10? + bcs L0240 no, make it a number + adda #$07 if so, make it A-F +L0240 adda #$30 +* Entry: A = char to put in buffer +Put2Buf pshs x save X + ldx [options] +* dmode - [options] +* (allows dmode use on a saved desc) +* (-filename will use data dir for default) +* dmode -? will give bit definitions +* If no options given, just returns desc info. +* All numbers must be in HEX. +* dmode +* dmode /h0 cyl=0200 sas=8 ilv=4 +* dmode /d0 +* dmode -? +* dmode -/d1/modules/d2.dd cyl=0028 + + ifp1 + use defsfile use defsfile + use rbfdefs + endc + + mod size,name,$11,$81,entry,msiz + + org 0 +desc rmb $40 dev desc copy +dsize rmb 2 desc size +path rmb 1 file path +parmptr rmb 2 next name dataptr +module rmb 2 desc address +dataptr rmb 2 current option ptr +buffptr rmb 2 buffer address +txtptr rmb 2 option name ptr +hexin rmb 2 2 byte hex number +hexcnt rmb 1 number of option bytes +buffer rmb 10 output buffer +stack rmb 200 +params rmb 150 +msiz equ . + +************************************************ +name fcs "Dmode" + fcb 8 version + +helpmsg + fcb C$CR,C$LF + fcc "drv Drive Number 0...n" + fcb C$CR,C$LF + fcc "stp Step Rate 0=30, 1=20, 2=12, 3=6ms" + fcb C$CR,C$LF + fcb C$CR,C$LF + fcc 'typ Device Type bit0- 0=5" 1=8"' + fcb C$CR,C$LF + fcc " $20 bit5- 0=non 1=coco" + fcb C$CR,C$LF + fcc " $40 bit6- 0=std 1=non" + fcb C$CR,C$LF + fcc " $80 bit7- 0=flop 1=hard" + fcb C$CR,C$LF + fcb C$CR,C$LF + fcc "dns Density bit0- 0=SD 1=DD" + fcb C$CR,C$LF + fcc " bit1- 0=48 1=96 tpi" + fcb C$CR,C$LF + fcb C$CR,C$LF + fcc "cyl Cylinders (tracks) (in hex)" + fcb C$CR,C$LF + fcc "sid Sides (heads) (in hex)" + fcb C$CR,C$LF + fcc "vfy Verify (0=yes)" + fcb C$CR,C$LF + fcc "sct Sectors/Track (in hex)" + fcb C$CR,C$LF + fcc "tos Sectors/Track on track 0 (in hex)" + fcb C$CR,C$LF + fcc "ilv Interleave (in hex)" + fcb C$CR,C$LF + fcc "sas Minimum segment allocation (in hex)" + fcb C$CR,C$LF +helplen equ *-helpmsg + +errmsg + fcb C$CR,C$LF + fcc "Use Dmode / [options...]" + fcb C$CR,C$LF + fcc " or Dmode - [options...]" + fcb C$CR,C$LF + fcc " or Dmode -? for options help" + fcb C$CR,C$LF + fcb C$CR,C$LF + fcc " NOTE: specify options in hex." +cr fcb C$CR,C$LF +msglen equ *-errmsg + +synmsg + fcb C$CR,C$LF + fcc "Syntax Error: " +synlen equ *-synmsg + + +muchhelp + leax helpmsg,pc + ldy #helplen + bra helpprnt + +rbfmsg + fcb C$CR,C$LF + fcc "NOT an RBF descriptor!" + fcb C$CR,C$LF +rbflen equ *-rbfmsg + +notrbf + leax rbfmsg,pc + ldy #rbflen + lda #2 + os9 I$Write + +help + leax errmsg,pc + ldy #msglen + +helpprnt + lda #2 + os9 I$Write + lbra okayend2 + +************************************************ +entry + ldd #0 + std module zero mod flag + sta path zero file flag + ldd ,x+ check for device name + cmpa #'- file option? + bne link + cmpb #'? help option? + beq muchhelp + +* Use Filename to Get Desc: + lda #UPDAT. open path to desc file + os9 I$Open + bcs error + stx parmptr + sta path save path number + + ldy #$40 max size + leax desc,u desc buff + os9 I$Read get it + bcc use10 + cmpb #E$EOF + bne error + +use10 + sty dsize save desc size + bra gotit + +link + cmpa #PDELIM else must be / + bne help + pshs u + lda #Devic + os9 F$Link link to descriptor + bcs error + stx parmptr update after name + tfr u,x + puls u + stx module + ldd M$Size,x get desc size + std dsize + leay desc,u + +mloop + lda ,x+ + sta ,y+ + decb + bne mloop + +gotit + leax desc,u + lda $12,x test device type + cmpa #1 RBF? + bne notrbf + + leax $13,x point to drive # + stx dataptr save mod option ptr + + ldx parmptr point to input parms + +skip + lda ,x+ + cmpa #$20 skip blanks + beq skip + + leax -1,x + cmpa #$0D no options? + lbeq info ..yes, give info + lbra findtxt else find options + +okayend + lbsr outcr +okayend2 + clrb okay +error + pshs b,cc + ldu module + beq bye + os9 F$UnLink +bye + puls b,cc + os9 F$Exit end dmode. + +table + fcc " drv" option name + fcb IT.DRV,1 option offset & byte count + fcc " stp" + fcb IT.STP,1 + fcc " typ" + fcb IT.TYP,1 + fcc " dns" + fcb IT.DNS,1 + fcc " cyl" + fcb IT.CYL,2 + fcc " sid" + fcb IT.SID,1 + fcc " vfy" + fcb IT.VFY,1 + fcc " sct" + fcb IT.SCT,2 + fcc " tos" + fcb IT.T0S,2 + fcc " ilv" + fcb IT.ILV,1 + fcc " sas" + fcb IT.SAS,1 + fcc " t0s" extra so it parses, but doesn't print! + fcb IT.T0S,2 + fcb $80 end of table + +info equ * Output Current Desc Info: + ldb #11 eleven entries (we won't print #12) + pshs b + leax table,pc point to text table + stx txtptr +ilup + bsr outtext print label and = + lbsr outnum print value + ldx txtptr + leax 6,x + stx txtptr + dec ,s + lbeq okayend ..end of info + ldb ,s + cmpb #5 after 6th option + bne ilup + bsr outcr + bra ilup ..loop + +outcr equ * Print a : + leax cr,pc + ldy #2 byte count + +output equ * Print generic + lda #1 std out + os9 I$Write + bcc okay + leas 2,s purge return + lbra error error +okay rts + + +* ----------------------- +equal fcc "=$" +outtext equ * Print Option Name: + ldx txtptr + ldy #4 + bsr output print option name + leax equal,pc + ldy #2 + bsr output sorry, must be a bsr + rts return + +* ----------------------- +outnum equ * Print Hex Option Values: + ldx txtptr + ldb 5,x get # of digits + stb hexcnt +numlup + bsr outhex + dec hexcnt + bne numlup + rts + +outhex equ * Print One Byte: + ldx dataptr + lda ,x+ + stx dataptr + pshs a + lsra + lsra + lsra + lsra + bsr outone + puls a + anda #$0F + +outone equ * Print 1/2 Byte Hex Char: + cmpa #10 + bcs number + adda #$11-10 make alpha +number + adda #$30 make ASCII + sta buffer + leax buffer,u + ldy #1 + lbra output + +skipspc equ * Skip Spaces: + lda ,x+ + cmpa #C$SPAC + beq skipspc + rts + +************************************************ +* X=parmptr + +findtxt equ * Find and Set Options: + +flup10 + bsr skipspc get next input param + stx parmptr save for syntax error use + cmpa #C$CR end? + lbeq verify ..yes, update desc CRC + + ora #$20 force lower case first char + leay table-6,pc ready option table ptr + pshs d,u + ldd ,x++ get next two chars + ora #$20 force lower case + orb #$20 -ditto- + tfr d,u place two chars in U + puls d restore A&B (u is still pushed) + +flup20 + leay 6,y next option entry + tst ,y last entry? + lbmi syntax ..yes, bad option + cmpa 1,y + bne flup20 same name? + cmpu 2,y + bne flup20 ..no, loop + +* Found Option + puls u + sty txtptr + lda ,x+ must be followed by "=" + cmpa #'= + lbne syntax + + bsr setnum set that option + bra flup10 + +* ------------- +setnum equ * Get Hex Input and Set Option: + ldb 5,y get # of bytes + stb hexcnt + clr hexin zero hex input bytes + clr hexin+1 + +setloop + lda ,x+ get next # + cmpa #'$ optional hex $? + beq setloop yes, ignore + cmpa #C$SPAC end of number? + beq setnum2 ..yes, set option, rts + cmpa #C$CR end of line? + beq setnum1 + bsr hexcnvt else, get next num + bra setloop ..loop + +setnum1 + leax -1,x reset so can find +setnum2 + ldb 4,y get option offset + leay desc,u point to desc + leay b,y point to option + ldd hexin pick up hex input + dec hexcnt + beq setone + std ,y set two byte option + rts +setone + tsta + lbne syntax + stb ,y set one byte option + rts + +hexcnvt equ * Convert ASCII Hex-->Byte: + suba #$30 make number from ASCII + lbmi syntax + cmpa #10 is it number? + bcs num + anda #$5F make uppercase + suba #$11-$0a make hex $A-$F + cmpa #$0A + lbcs syntax + cmpa #$10 not hex char? + lbcc syntax +num + ldb #16 fancy asl *4 + mul + pshs b save top 4 bits + ldd hexin + rol ,s + rolb + rola + rol ,s + rolb + rola + rol ,s + rolb + rola + rol ,s + rolb + rola + std hexin + puls b,pc drop temp, rts. + +verify equ * Update Descriptor CRC: + pshs u save data ptr + leau desc,u + tfr u,x X is mod address + + ldy M$Size,x Y is mod size + leay -3,y beginning of chksum + tfr y,d Y is byte count + leau d,u set U to chksum + + lda #$FF init chksum + sta ,u + sta 1,u + sta 2,u + pshs u + os9 F$CRC calc new crc + puls u + com ,u+ fix it up right + com ,u+ + com ,u + + lda path was it file? + beq memmod ..no, in memory + ldx #0 + tfr x,u + os9 I$Seek go back to file begin + lbcs error + puls u + leax desc,u + ldy dsize + os9 I$Write update desc file + lbra okayend + +memmod + puls u + leax desc,u + ldb dsize+1 + ldy module + +move + lda ,x+ + sta ,y+ + decb + bne move + + lbra okayend2 + + +syntax equ * + leax synmsg,pc + ldy #synlen + lda #2 + os9 I$Write + + ldx parmptr + leax -1,x + pshs x + ldy #0 + +slup + leay 1,y + lda ,x+ + cmpa #C$CR + beq synsay + cmpa #C$SPAC + bne slup + +synsay + puls x + lda #2 + os9 I$Write output err + lbra okayend + + emod +size equ * + end diff -r 8a0993b04c8a -r 7cecd837bcab level1/cmds/irqs.asm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level1/cmds/irqs.asm Fri Jan 31 17:37:19 2003 +0000 @@ -0,0 +1,368 @@ +******************************************************************** +* irqs - Show interrupt polling table +* +* $Id$ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ +* 1 Created KKD +* 2 Modified GH +* 3 Streamlined and fixed problems BGP 03/01/07 + + nam irqs + ttl Show interrupt polling table + + ifp1 + use defsfile + endc + +rev set $01 +edition set 3 + +MaxDEnts set 32 max device entries we will display +MaxPEnts set 32 max polling entries we will display + + mod emod,name,prgrm+objct,reent+rev,start,endmem + + org 0 +usaver rmb 2 +narrow rmb 1 +polcount rmb 1 number of polling entries in polling table +devcount rmb 1 number of device entries in device table +datptr rmb 2 pointer to DAT image in system proc descriptor +notuse rmb 2 +outptr rmb 2 points to next available char in buffer +counter rmb 1 +devptr rmb 2 +tblptr rmb 2 +dpvars rmb 9 +rptbuf rmb 80 +ddevtbl rmb 2 copy of D.DevTbl in globals +dpoltbl rmb 2 copy of D.PolTbl in globals + IFGT Level-1 +poltable rmb 32*POLSIZ +devtable rmb 32*DEVSIZ +modulep rmb 256 +syspdesc rmb P$Size + ENDC +sstack rmb 200 +endmem equ . + +name fcs "irqs" + fcb edition + +PollHdr fcc "Polling Table at: " +PollHdrL equ *-PollHdr +Device fcc " Device Table at: " +DeviceL equ *-Device +NTopline fcc " Device Drvr IRQ Flip" + fcb C$CR +NToplineL equ *-NTopline +NLine2 fcc "Port Mem Name Vect Mask Pr" + fcb C$CR +NLine2L equ *-NLine2 +NLine3 fcc "---- ---- ----------- ---- --" + fcb C$CR +NLine3L equ *-NLine3 +Topline fcc " Device Driver IRQ Flip " + fcb C$CR +ToplineL equ *-Topline +Line2 fcc "Port Mem Name Vector &Mask Pty" + fcb C$CR +Line2L equ *-Line2 +Line3 fcc "---- ---- ------------ ----- ---" +crtn fcb C$CR +Line3L equ *-Line3 +Init fcs /Init/ + +start stu crtn,pcr + ldy #$0001 + os9 I$WritLn write a carriage return + bcs errexit + leax >PollHdr,pc + ldy #PollHdrL + os9 I$Write write polling table header + bcs errexit + IFGT Level-1 + lda #$01 process ID #1 - system process + leax syspdesc,u point to buffer + os9 F$GPrDsc get a copy of it + bcs errexit + leax P$DatImg,x point to DAT image + stx D.DevTbl + std D.PolTbl + std Device,pcr + ldy #DeviceL + lda #1 + os9 I$Write + leax rptbuf,u + stx crtn,pcr stick another \n on it + ldy #$0001 + os9 I$WritLn + bcs errexit + leax >Topline,pcr + ldy #ToplineL + tst NTopline,pcr + ldy #NToplineL +branch1 os9 I$WritLn + bcs errexit + leax >Line2,pcr + ldy #Line2L + tst NLine2,pcr + ldy #NLine2L +branch2 os9 I$WritLn + bcs errexit + leax >Line3,pcr + ldy #Line3L + tst NLine3,pcr + ldy #NLine3L +branch3 os9 I$WritLn + lbcs errexit + IFGT Level-1 +* Copy polling table + lda ascii + ldd Q$STAT,x + lbsr OutHex convert 2 bytes memsiz->ascii + lbsr OutSpace extra space in line + bsr z01CA now do name + ldd Q$SERV,x get irq vector + lbsr OutHex convert it to ascii + lbsr OutSpace extra space + lda Q$FLIP,x get flip + lbsr z0247 convert 1 byte + tst || - || -?] [option] [option] [...]" + fcb C$LF,C$LF + fcc "Purpose: To report or alter current option settings of SCF device" + fcb C$LF + fcc " descriptors in memory or on disk in single module files." + fcb C$LF,C$LF + fcc "Options: nam, mgr, ddr, hpn, hpa, upc, bso, dlo, eko, alf, nul, pau," + fcb C$LF + fcc " pag, bsp, del, eor, eof, rpr, dup, psc, int, qut, bse, ovf," + fcb C$LF + fcc " par, bau, xon, xof, col, row, xtp, wnd, val, sty, cpx, cpy," + fcb C$LF + fcc " fgc, bgc, bdc" + fcb C$LF,C$LF + fcc "Examples: exmode /t2" + fcb C$LF + fcc " Prints the current option settings of the /T2 descriptor" + fcb C$LF + fcc " in memory." + fcb C$LF + fcc " exmode -modules/t4.dd nam=T2 bau=6 hpa=ff6c eof=1B" + fcb C$LF + fcc " Changes the module name in the MODULES/T4.dd file to T2," + fcb C$LF + fcc " sets the baud rate code to 6, the hardware port address" + fcb C$LF + fcc " to $FF6C, and the end of file character to $1B." + fcb C$LF + fcc " exmode -?" + fcb C$LF + fcc " Prints more complete information on all of the options." + fcb C$CR +UseLen equ *-UseMsg + +HelpMsg + fcb C$LF + fcc "The NAM option accepts only a legal OS-9 module name with a maximum of" + fcb C$LF + fcc "4 characters. It is up to the user to ensure that there is adequate" + fcb C$LF + fcc "room for the module name, and if required to rename the disk file to" + fcb C$LF + fcc "suit the new module name. The MGR and DDR options can't be changed." + fcb C$LF + fcc "All other options require hexadecimal numbers (0 through FFFF). XTP is" + fcb C$LF + fcc "for certain ACIA descriptors only. WND, VAL, STY, CPX, CPY, FGC, BGC," + fcb C$LF + fcc "and BDC are for window descriptors only." + fcb C$LF,C$LF + fcc "nam Device Name mgr File Manager Name ddr Device Driver Name" + fcb C$LF + fcc "hpn H'ware Page Number hpa H'ware Port Address upc Case Lock Flag" + fcb C$LF + fcc "bso Backspace Method dlo Delete Line Method eko Screen Echo Flag" + fcb C$LF + fcc "alf Auto Linefeed Flag nul End Of Line Nulls pau Page Pause Flag" + fcb C$LF + fcc "pag Page Length bsp Backspace Character del Delete Line Char" + fcb C$LF + fcc "eor End Of Record Char eof End Of File Char rpr Reprint Line Char" + fcb C$LF + fcc "dup Duplicate Line Char psc Pause Character int Interrupt Character" + fcb C$LF + fcc "qut Quit Character bse Backspace Echo Char ovf Overflow Character" + fcb C$LF + fcc "par Type (Parity) Code bau Baud Rate Code xon XON Character" + fcb C$LF + fcc "xof XOFF Character col Display Columns row Display Rows" + fcb C$LF + fcc "xtp Extended Type Code wnd Window Number val Valid Window Flag" + fcb C$LF + fcc "sty Window Screen Type cpx X Corner Position cpy Y Corner Position" + fcb C$LF + fcc "fgc Foreground Colour bgc Background Colour bdc Border Colour" + fcb C$CR +HelpLen equ *-HelpMsg + +Equal fcc "=" + +TypeMsg + fcb C$LF + fcc "Not an SCF descriptor!" +CR fcb C$CR +TypeLen equ *-TypeMsg + +Sizemsg + fcb C$LF + fcc "Module size out of range!" + fcb C$CR +Sizelen equ *-Sizemsg + +SynMsg + fcb C$LF + fcc "Syntax error: " +SynLen equ *-SynMsg + +**************** +* miscellaneous error and help routines + +MuchHelp + leax HelpMsg,pc + ldy #HelpLen + bra Helpprnt + +BadSize + leax Sizemsg,pc + ldy #Sizelen + bra AddHelp + +BadType + leax TypeMsg,pc + ldy #TypeLen +AddHelp + lda #2 + os9 I$WritLn +Help + leax UseMsg,pc + ldy #UseLen +Helpprnt + lda #2 + os9 I$WritLn + lbra OkayEnd2 + +**************** +Entry + ldd #0 + std + bne Help + pshs u + lda #Devic + os9 F$Link link to module + bcs Help + stx delimiter char? + bne Syntax no, go report error + +ChkLen + cmpb Byte: + suba #$30 make number from ASCII + bmi Syntax + cmpa #10 is it number? + bcs Num + anda #$5F make uppercase + suba #$11-$0A make hex $A-$F + cmpa #$0A + bcs Syntax + cmpa #$10 not hex char? + bcc Syntax + +Num + ldb #16 fancy asl *4 + mul + pshs b save top 4 bits + ldd + +SetNum2 + ldb 4,y get option offset + leay ModBuff,u point to module + leay b,y point to option + ldd : +OutCR + leax CR,pc + ldy #1 + lda #1 + os9 I$WritLn + rts + +**************** +* Output Current Desc Info: +Info + bsr OutCR do a + ldb #TablOpts number of table entries + pshs b save counter + leax OptTable,pc point to text table + stx after every 8th option + lbra InfoLoop ..loop + +* -------------- +* Print 1/2 Byte Hex Char: +OutOne + cmpa #10 + bcs Number + adda #$11-10 make alpha + +Number + adda #$30 make ASCII + sta