Mercurial > hg > Members > kono > nitros9-code
changeset 1678:40322608e006
tmode is now made from xmode, dsave modified to handle new tmode parameter
author | boisy |
---|---|
date | Thu, 29 Jul 2004 19:04:12 +0000 |
parents | b1fd64ea8eee |
children | 131de360641b |
files | level1/cmds/dsave.asm level1/cmds/makefile level1/cmds/tmode.asm level1/cmds/xmode.asm |
diffstat | 4 files changed, 217 insertions(+), 494 deletions(-) [+] |
line wrap: on
line diff
--- a/level1/cmds/dsave.asm Wed Jul 28 15:12:14 2004 +0000 +++ b/level1/cmds/dsave.asm Thu Jul 29 19:04:12 2004 +0000 @@ -112,9 +112,9 @@ TMode fcc "tmode" fcb C$CR -TPause fcc ".1 pause" +TPause fcc ".1 pau=1" fcb C$CR -TNoPause fcc ".1 -pause" +TNoPause fcc ".1 pau=0" fcb C$CR Load fcc "load"
--- a/level1/cmds/makefile Wed Jul 28 15:12:14 2004 +0000 +++ b/level1/cmds/makefile Thu Jul 29 19:04:12 2004 +0000 @@ -20,6 +20,12 @@ pwd: pd.asm $(AS) $(AFLAGS) $< $(ASOUT)$@ -aPWD=1 +xmode: xmode.asm + $(AS) $(AFLAGS) $< $(ASOUT)$@ -aXMODE=1 + +tmode: xmode.asm + $(AS) $(AFLAGS) $< $(ASOUT)$@ -aTMODE=1 + pxd: pd.asm $(AS) $(AFLAGS) $< $(ASOUT)$@ -aPXD=1
--- a/level1/cmds/tmode.asm Wed Jul 28 15:12:14 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,464 +0,0 @@ -******************************************************************** -* Tmode - Change terminal parameters -* -* $Id$ -* -* Edt/Rev YYYY/MM/DD Modified by -* Comment -* ------------------------------------------------------------------ -* 12 ????/??/?? -* From Tandy OS-9 Level Two VR 02.00.01. - - nam Tmode - ttl Change terminal parameters - -* Disassembled 98/09/11 18:35:13 by Disasm v1.6 (C) 1988 by RML - - ifp1 - use defsfile - endc - -tylg set Prgrm+Objct -atrv set ReEnt+rev -rev set $00 -edition set 12 - - mod eom,name,tylg,atrv,start,size - - org 0 -u0000 rmb 1 -u0001 rmb 1 -u0002 rmb 1 -u0003 rmb 2 -u0005 rmb 1 -u0006 rmb 1 -u0007 rmb 32 -u0027 rmb 10 -u0031 rmb 526 -size equ . - -name fcs /Tmode/ - fcb edition - - fdb $0017 Number of options in table -OptTable fcb $FF $FF = boolean, $00 = value - fcb $01 default value - fcb PD.UPC-PD.OPT offset into path descriptor - fcb $01 - fcs "upc" - - fcb $FF - fcb $01 - fcb PD.BSO-PD.OPT - fcb $01 - fcs "bsb" - - fcb $FF - fcb $00 - fcb PD.DLO-PD.OPT - fcb $00 - fcs "bsl" - - fcb $FF - fcb $01 - fcb PD.EKO-PD.OPT - fcb $01 - fcs "echo" - - fcb $FF - fcb $01 - fcb PD.ALF-PD.OPT - fcb $01 - fcs "lf" - - fcb $00 - fcb $00 - fcb PD.NUL-PD.OPT - fcb $00 - fcs "null" - - fcb $FF - fcb $01 - fcb PD.PAU-PD.OPT - fcb $01 - fcs "pause" - - fcb $00 - fcb $18 - fcb PD.PAG-PD.OPT - fcb $00 - fcs "pag" - - fcb $01 - fcb $08 - fcb PD.BSP-PD.OPT - fcb $00 - fcs "bsp" - - fcb $01 - fcb $18 - fcb PD.DEL-PD.OPT - fcb $00 - fcs "del" - - fcb $01 - fcb $0D - fcb PD.EOR-PD.OPT - fcb $00 - fcs "eor" - - fcb $01 - fcb $1B - fcb PD.EOF-PD.OPT - fcb $00 - fcs "eof" - - fcb $01 - fcb $04 - fcb PD.RPR-PD.OPT - fcb $00 - fcs "reprint" - - fcb $01 - fcb $01 - fcb PD.DUP-PD.OPT - fcb $00 - fcs "dup" - - fcb $01 - fcb $17 - fcb PD.PSC-PD.OPT - fcb $00 - fcs "psc" - - fcb $01 - fcb $03 - fcb PD.INT-PD.OPT - fcb $00 - fcs "abort" - - fcb $01 - fcb $05 - fcb PD.QUT-PD.OPT - fcb $00 - fcs "quit" - - fcb $01 - fcb $08 - fcb PD.BSE-PD.OPT - fcb $00 - fcs "bse" - - fcb $01 - fcb $07 - fcb PD.OVF-PD.OPT - fcb $00 - fcs "bell" - - fcb $01 - fcb $15 - fcb PD.PAR-PD.OPT - fcb $00 - fcs "type" - - fcb $01 - fcb $02 - fcb PD.BAU-PD.OPT - fcb $00 - fcs "baud" - - fcb $01 - fcb $11 - fcb PD.XON-PD.OPT - fcb $00 - fcs "xon" - - fcb $01 - fcb $13 - fcb PD.XOFF-PD.OPT - fcb $00 - fcs "xoff" - -start lda #$32 - sta <u0002 - pshs y,x,b,a - lda #$01 - ldb #SS.ScSiz - os9 I$GetStt - bcc L00DB - cmpb #E$UnkSvc - beq L00E4 - puls y,x,b,a - bra L0120 -L00DB cmpx #55 - bge L00E4 - lda #$16 - sta <u0002 -L00E4 puls y,x,b,a - leay ,x - bsr L0123 - clra - cmpb #C$PERD - bne L00FB - leay 1,y - lda ,y+ - suba #$30 - cmpa #$10 - lbcc L0181 -L00FB sta <u0000 - ldb #SS.Opt - leax u0007,u - os9 I$GetStt - bcs L0120 - bsr L0123 - cmpb #C$CR - lbeq L01F0 -L010E bsr L0134 - bcs L0181 - cmpb #C$CR - bne L010E - lda <u0000 - ldb #SS.Opt - os9 I$SetStt - bcs L0120 - clrb -L0120 os9 F$Exit -L0123 ldb ,y+ - cmpb #C$COMA - bne L012B -L0129 ldb ,y+ -L012B cmpb #C$SPAC - beq L0129 - leay -$01,y - andcc #^Carry - rts -L0134 clr <u0001 - lda ,y - cmpa #'- - bne L0140 - inc <u0001 - leay $01,y -L0140 sty <u0003 - leax >OptTable,pcr - lbsr L02D1 - bcs L0181 - lda ,x - bpl L015C -L0150 ldb $01,x -L0152 lda $02,x - eorb <u0001 - leax u0007,u - stb a,x - bra L0123 -L015C tst <u0001 - bne L0181 - ldb ,y - cmpb #'= - bne L0150 - leay $01,y - tsta - bne L01AA - clrb -L016C lda ,y - suba #$30 - cmpa #$09 - bhi L01C1 - pshs a - leay $01,y - lda #$0A - mul - addb ,s+ - adca #$00 - beq L016C -L0181 leax <L0192,pcr - ldy #$000E - bsr L01A4 - ldx <u0003 - bsr L01A0 - clrb - os9 F$Exit - -L0192 fcc "SYNTAX Error: " - -L01A0 ldy #80 -L01A4 lda #$01 - os9 I$WritLn - rts -L01AA bsr L01D1 - bcs L0181 - pshs b - bsr L01D1 - puls a - bcc L01B9 - clrb - exg a,b -L01B9 lsla - lsla - lsla - lsla - pshs a - addb ,s+ -L01C1 lda ,y - cmpa #C$SPAC - beq L0152 - cmpa #C$CR - beq L0152 - cmpa #C$COMA - beq L0152 - bra L0181 -L01D1 ldb ,y - subb #$30 - cmpb #$09 - bls L01E9 - cmpb #$31 - bcs L01DF - subb #$20 -L01DF subb #$07 - cmpb #$0F - bhi L01EE - cmpb #$0A - bcs L01EE -L01E9 andcc #^Carry - leay $01,y - rts -L01EE comb - rts -L01F0 clr <u0005 - lda #'/ - lbsr L02AF - leax <u0031,u - lda <u0000 - ldb #SS.DevNm - os9 I$GetStt - bsr L024A - lda #C$CR - lbsr L02AF - leax >OptTable,pcr - leay u0007,u - clrb -L020F lda b,y - bsr L0221 - incb - cmpb #C$SPAC - bcs L020F - lda #C$CR - lbsr L02AF - clrb - os9 F$Exit -L0221 pshs u,y,x,b,a - ldy -$02,x -L0226 cmpb $02,x - beq L0236 - leax $04,x -L022C lda ,x+ - bpl L022C - leay -$01,y - bne L0226 - puls pc,u,y,x,b,a -L0236 bsr L02AD - tst ,x - bpl L025E - lda ,s - cmpa $03,x - beq L0246 - lda #'- - bsr L02AF -L0246 bsr L024E - puls pc,u,y,x,b,a -L024A pshs x - bra L0252 -L024E pshs x - leax $04,x -L0252 lda ,x - anda #$7F - bsr L02AF - lda ,x+ - bpl L0252 - puls pc,x -L025E bsr L024E - lda #'= - bsr L02AF - tst ,x - bne L0291 - ldb ,s - lda #'/ - clr <u0006 -L026E inca - subb #$64 - bcc L026E - bsr L0286 - lda #$3A -L0277 deca - addb #$0A - bcc L0277 - bsr L0286 - tfr b,a - adda #$30 - bsr L02AF - puls pc,u,y,x,b,a -L0286 inc <u0006 - cmpa #$30 - bne L02AF - dec <u0006 - bne L02AF - rts -L0291 lda ,s - anda #$F0 - lsra - lsra - lsra - lsra - bsr L02A3 - lda ,s - anda #$0F - bsr L02A3 - puls pc,u,y,x,b,a -L02A3 adda #$30 - cmpa #$39 - bls L02AF - adda #$07 - bra L02AF -L02AD lda #C$SPAC -L02AF pshs y,x,b,a - leax <u0027,u - ldb <u0005 - sta b,x - cmpa #C$CR - beq L02C9 - incb - cmpb <u0002 - bcs L02CD - cmpa #C$SPAC - bne L02CD - lda #C$CR - sta b,x -L02C9 lbsr L01A0 - clrb -L02CD stb <u0005 - puls pc,y,x,b,a -L02D1 pshs u,y,x - ldu -$02,x -L02D5 ldy $02,s - stx ,s - leax $04,x -L02DC lda ,x+ - eora ,y+ - anda #$DF - lsla - bne L02ED - bcc L02DC - sty $02,s - clra - puls pc,u,y,x -L02ED leax -$01,x -L02EF lda ,x+ - bpl L02EF - leau -u0001,u - cmpu #$0000 - bne L02D5 - coma - puls pc,u,y,x - - emod -eom equ * - end
--- a/level1/cmds/xmode.asm Wed Jul 28 15:12:14 2004 +0000 +++ b/level1/cmds/xmode.asm Thu Jul 29 19:04:12 2004 +0000 @@ -1,5 +1,5 @@ ******************************************************************** -* XMode - Extended SCF device descriptor utility +* XMode/TMode - SCF device/path descriptor utility * * $Id$ * @@ -8,9 +8,12 @@ * ------------------------------------------------------------------ * 1 1989/06/21 Bruce Isted * Released to public domain. +* +* 2 2004/07/29 Boisy G. Pitre +* Revamped to also assemble as tmode - nam XMode - ttl Extended SCF device descriptor utility + nam XMode/TMode + ttl SCF device/path descriptor utility DOHELP set 0 @@ -18,8 +21,8 @@ use defsfile endc -BuffSize equ 10 max. CHAR string length -Edtn equ 1 +BuffSize equ 34 max. CHAR string length +Edtn equ 2 MaxSize equ $80 maximum module size NameSize equ 4 maximum module name length rev equ 0 @@ -28,11 +31,13 @@ Count rmb 1 number of option bytes DataPtr rmb 2 current option ptr HexIn rmb 2 2 byte hex number + IFNE XMODE ModAddr rmb 2 module address ModSize rmb 2 module size OptEnd rmb 2 option table end offset + ENDC +PathNmbr rmb 1 file path ParmPtr rmb 2 next name DataPtr -PathNmbr rmb 1 file path TxtPtr rmb 2 option name ptr Buffer rmb BuffSize miscellaneous output buffer ModBuff rmb MaxSize module work copy buffer @@ -41,10 +46,17 @@ mod Size,Name,Prgrm+Objct,ReEnt+rev,Entry,MemSize -Name fcs "XMode" +Name equ * + IFNE XMODE + fcc "X" + ELSE + fcc "T" + ENDC + fcs "Mode" fcb Edtn edition number OptTable + IFNE XMODE fcc " nam" option name fcb Sign+M$Name,NameSize offset to string offset & max. byte count to change fcc " mgr" @@ -55,52 +67,146 @@ fcb M$Port,1 option offset & byte count fcc " hpa" fcb M$Port+1,2 + ENDC fcc " upc" + IFNE XMODE fcb IT.UPC,1 + ELSE + fcb PD.UPC-PD.OPT,1 + ENDC fcc " bso" + IFNE XMODE fcb IT.BSO,1 + ELSE + fcb PD.BSO-PD.OPT,1 + ENDC fcc " dlo" + IFNE XMODE fcb IT.DLO,1 + ELSE + fcb PD.DLO-PD.OPT,1 + ENDC fcc " eko" + IFNE XMODE fcb IT.EKO,1 + ELSE + fcb PD.EKO-PD.OPT,1 + ENDC fcc " alf" + IFNE XMODE fcb IT.ALF,1 + ELSE + fcb PD.ALF-PD.OPT,1 + ENDC fcc " nul" + IFNE XMODE fcb IT.NUL,1 + ELSE + fcb PD.NUL-PD.OPT,1 + ENDC fcc " pau" + IFNE XMODE fcb IT.PAU,1 + ELSE + fcb PD.PAU-PD.OPT,1 + ENDC fcc " pag" + IFNE XMODE fcb IT.PAG,1 + ELSE + fcb PD.PAG-PD.OPT,1 + ENDC fcc " bsp" + IFNE XMODE fcb IT.BSP,1 + ELSE + fcb PD.BSP-PD.OPT,1 + ENDC fcc " del" + IFNE XMODE fcb IT.DEL,1 + ELSE + fcb PD.DEL-PD.OPT,1 + ENDC fcc " eor" + IFNE XMODE fcb IT.EOR,1 + ELSE + fcb PD.EOR-PD.OPT,1 + ENDC fcc " eof" + IFNE XMODE fcb IT.EOF,1 + ELSE + fcb PD.EOF-PD.OPT,1 + ENDC fcc " rpr" + IFNE XMODE fcb IT.RPR,1 + ELSE + fcb PD.RPR-PD.OPT,1 + ENDC fcc " dup" + IFNE XMODE fcb IT.DUP,1 + ELSE + fcb PD.DUP-PD.OPT,1 + ENDC fcc " psc" + IFNE XMODE fcb IT.PSC,1 + ELSE + fcb PD.PSC-PD.OPT,1 + ENDC fcc " int" + IFNE XMODE fcb IT.INT,1 + ELSE + fcb PD.INT-PD.OPT,1 + ENDC fcc " qut" + IFNE XMODE fcb IT.QUT,1 + ELSE + fcb PD.QUT-PD.OPT,1 + ENDC fcc " bse" + IFNE XMODE fcb IT.BSE,1 + ELSE + fcb PD.BSE-PD.OPT,1 + ENDC fcc " ovf" + IFNE XMODE fcb IT.OVF,1 + ELSE + fcb PD.OVF-PD.OPT,1 + ENDC fcc " par" + IFNE XMODE fcb IT.PAR,1 + ELSE + fcb PD.PAR-PD.OPT,1 + ENDC fcc " bau" + IFNE XMODE fcb IT.BAU,1 + ELSE + fcb PD.BAU-PD.OPT,1 + ENDC fcc " xon" + IFNE XMODE fcb IT.XON,1 + ELSE + fcb PD.XON-PD.OPT,1 + ENDC fcc " xof" - fcb IT.XOFF,1 + IFNE XMODE + fcb IT.XOFF,1 + ELSE + fcb PD.XOFF-PD.OPT,1 + ENDC + IFNE XMODE fcc " col" fcb IT.COL,1 fcc " row" @@ -125,13 +231,14 @@ fcc " bdc" fcb IT.BDC,1 ENDC + ENDC TablOpts equ (*-OptTable)/6 number of table entries fcb $80 end of option table IFNE DOHELP UseMsg fcb C$LF - fcc "Usage: EXMode [/<device> || -<pathlist> || -?] [option] [option] [...]" + fcc "Usage: XMode [/<device> || -<pathlist> || -?] [option] [option] [...]" fcb C$LF,C$LF fcc "Purpose: To report or alter current option settings of SCF device" fcb C$LF @@ -145,13 +252,13 @@ fcb C$LF fcc " fgc, bgc, bdc" fcb C$LF,C$LF - fcc "Examples: exmode /t2" + fcc "Examples: xmode /t2" fcb C$LF fcc " Prints the current option settings of the /T2 descriptor" fcb C$LF fcc " in memory." fcb C$LF - fcc " exmode -modules/t4.dd nam=T2 bau=6 hpa=ff6c eof=1B" + fcc " xmode -modules/t4.dd nam=T2 bau=6 hpa=ff6c eof=1B" fcb C$LF fcc " Changes the module name in the MODULES/T4.dd file to T2," fcb C$LF @@ -159,7 +266,7 @@ fcb C$LF fcc " to $FF6C, and the end of file character to $1B." fcb C$LF - fcc " exmode -?" + fcc " xmode -?" fcb C$LF fcc " Prints more complete information on all of the options." fcb C$CR @@ -213,19 +320,23 @@ Equal fcc "=" TypeMsg - fcb C$LF - fcc "Not an SCF descriptor!" + fcc "Not an SCF " + IFNE XMODE + fcc "descriptor!" + ELSE + fcc "path!" + ENDC CR fcb C$CR TypeLen equ *-TypeMsg + IFNE XMODE Sizemsg - fcb C$LF fcc "Module size out of range!" fcb C$CR Sizelen equ *-Sizemsg + ENDC SynMsg - fcb C$LF fcc "Syntax error: " SynLen equ *-SynMsg @@ -239,20 +350,20 @@ bra Helpprnt ENDC + IFNE XMODE BadSize leax Sizemsg,pc ldy #Sizelen bra AddHelp + ENDC BadType leax TypeMsg,pc ldy #TypeLen AddHelp - IFNE DOHelp lda #2 os9 I$WritLn - ENDC Help IFNE DOHelp leax UseMsg,pc @@ -265,16 +376,32 @@ **************** Entry + IFNE XMODE ldd #0 std <ModAddr zero mod flag sta <PathNmbr zero file flag + ENDC ldd ,x+ check for device name + IFNE XMODE cmpa #'- file option? bne Link + ELSE + stx <ParmPtr + clr <PathNmbr + cmpa #'. dot? (for path specification) + bne Process if not, process as option + subb #$30 + lbmi Syntax + cmpb #$02 + lbgt Syntax + stb <PathNmbr + leax 2,x point passed char after '.' + ENDC IFNE DOHELP cmpb #'? help option? beq MuchHelp ENDC + IFNE XMODE * Use Filename to Get Desc: lda #UPDAT. open path to module file os9 I$Open @@ -294,7 +421,6 @@ bhi BadSize no, go return error... std <ModSize bra GotIt - Link cmpa #'/ else must be /<devicename> bne Help @@ -337,6 +463,22 @@ cmpa #C$CR no options? lbeq Info ..yes, give info leax -1,x + ELSE +Process + leax -1,x + stx <ParmPtr save for syntax error use + leax ModBuff,u + lda <PathNmbr + clrb + os9 I$GetStt + tst ,x + lbne BadType + ldx <ParmPtr + lbsr SkipSpac go skip leading spaces... + cmpa #C$CR no options? + lbeq Info ..yes, give info + leax -1,x + ENDC **************** * X=ParmPtr @@ -378,6 +520,7 @@ beq Syntax 0 bytes, not allowed to change this option stb <Count ldb 4,y get option offset or offset to option offset + IFNE XMODE bpl NumOpt option offset, go set hexadecimal option * Get CHAR input and set option: andb #^Sign clear sign bit of offset to string offset @@ -411,6 +554,9 @@ ora #Sign set sign bit sta -1,y save last char lbra FindLp10 go do next... + ELSE + lbra NumOpt option offset, go set hexadecimal option + ENDC * Syntax Error: Syntax @@ -439,9 +585,11 @@ * Get Hex Input and Set Option: NumOpt + IFNE XMODE clra [D] = option offset within module cmpd <OptEnd is it OK? bhs Syntax no, go report error... + ENDC clr <HexIn zero hex input bytes clr <HexIn+1 @@ -516,6 +664,7 @@ * -------------- * Update Module CRC: Verify + IFNE XMODE pshs u save data ptr leau ModBuff,u tfr u,x X is mod address @@ -543,8 +692,15 @@ leax ModBuff,u ldy <ModSize os9 I$Write update module file + ELSE + leax ModBuff,u + lda <PathNmbr + clrb + os9 I$SetStt + ENDC bra OkayEnd + IFNE XMODE MemMod ldu ,s get data area pointer leax ModBuff,u @@ -558,14 +714,15 @@ bne PutModLp puls u recover data area pointer bra OkayEnd2 + ENDC OkayEnd - bsr OutCR +* bsr OutCR OkayEnd2 clrb okay - Error + IFNE XMODE pshs b,cc ldu <ModAddr beq Bye @@ -573,6 +730,7 @@ Bye puls b,cc + ENDC os9 F$Exit we're done... * -------------- @@ -587,12 +745,29 @@ **************** * Output Current Desc Info: Info - bsr OutCR do a <CR> - ldb #TablOpts number of table entries - pshs b save counter + IFNE TMODE + lda <PathNmbr + leax Buffer,u + ldb #PDELIM + stb ,x+ + ldb #SS.DevNm + os9 I$GetStt +go@ ldb ,x+ + bpl go@ + andb #$7F + stb -1,x + ldb #C$CR + stb ,x + leax Buffer,u + ldy #80 + lda #$01 + os9 I$WritLn + ENDC + leax OptTable,pc point to text table stx <TxtPtr + clr ,-s InfoLoop ldx <TxtPtr ldy #4 @@ -602,6 +777,7 @@ lbsr OutPut print = ldx <TxtPtr ldb 4,x get offset to HEX option; if minus, offset to option offset + IFNE XMODE bpl PrintHex go do simple offset to HEX option andb #^Sign clear sign bit clra [D] = offset to string offset within module @@ -630,6 +806,7 @@ leax Buffer,u point [X] to CHAR string copy bsr OutPut print CHAR string bra MovePtr skip HEX output routine + ENDC * Print Hex Option Values: PrintHex @@ -637,9 +814,11 @@ ldb 5,x get # of digits stb <Count ldb 4,x get option offset in module + IFNE XMODE clra [D] = option offset within module cmpd <OptEnd is option offset OK? bhs MovePtr no, skip this option... + ENDC leax ModBuff,u point [X] to module work copy abx point [X] to option stx <DataPtr @@ -665,9 +844,11 @@ ldx <TxtPtr leax 6,x stx <TxtPtr - dec ,s + ldb ,s+ + incb + cmpb #TablOpts lbeq OkayEnd done... - ldb ,s + pshs b bitb #$07 # of options remaining evenly divisible by eight? lbne InfoLoop no, go print next option on same line lbsr OutCR <CR> after every 8th option @@ -687,8 +868,8 @@ ldy #1 OutPut - lda #1 std out - os9 I$Write + lda #$01 + os9 I$Write lbcs Error rts