Commit 5eebac9d authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Clean up pass

* Use Command macro to make the command name table
* Rename ModuleBase to Module_BaseAddr (for Command macro)
* Split messages into CmdHelp+Messages files
* Use international_help switch passed in from makefile to decide which to build; remove "NewOS" and "N310OS" equivalents
* Use Hdr:OsBytes to name OS_Byte value in R0
* ASCII_UpperCase macro
* Remove some unused headers
* {TRUE} and {FALSE} from ObjAsm
Not tagged.
parent 0d95ebdc
SUBT Strings for Help messages. => &.Arthur.NetPrint.HelpTexts
[ NetPrint_Inter_Help <> 0
[ international_help
HelpSetPS = "HNPRSPS",0
BadSetPSSyn = "SNPRSPS",0
SetPS_Help = "HNPRSPS",0
SetPS_Syntax = "SNPRSPS",0
HelpPS = "HNPRPS",0
BadPSSyn = "SNPRPS",0
PS_Help = "HNPRPS",0
PS_Syntax = "SNPRPS",0
HelpListPS = "HNPRLPS",0
BadListPSSyn = "SNPRLPS",0
ListPS_Help = "HNPRLPS",0
ListPS_Syntax = "SNPRLPS",0
HelpForConfigurePS = "HNPRCPS",0
SyntaxOfConfigurePS = "SNPRCPS",0
ConfigurePS_Help = "HNPRCPS",0
ConfigurePS_Syntax = "SNPRCPS",0
SyntaxOnlyOfConfigurePS = "ConfPS", 0
|
HelpSetPS
SetPS_Help
= "*"
= TokenEscapeChar,Token0
= " changes the current printer server name or number. "
......@@ -26,40 +26,40 @@ HelpSetPS
= "to the initialised state and will use configured state "
= "if the next open (or save) does not explicitly quote "
= "either a name or a number", 13
BadSetPSSyn
SetPS_Syntax
= "Syntax: *"
= TokenEscapeChar,Token0
= " [<printer server name>|<station number>]", 0
HelpPS
PS_Help
= "*"
= TokenEscapeChar,Token0
= " selects new default printer server for the next "
= "use of the printer server. If no argument is supplied "
= "the current printer server name and/or number are "
= "printed out, along with the status of that server.", 13
BadPSSyn
PS_Syntax
= "Syntax: *"
= TokenEscapeChar,Token0
= " [<printer server name>|<station number>]", 0
HelpListPS
ListPS_Help
= "*"
= TokenEscapeChar,Token0
= " shows the names of all the currently available printer "
= "servers. If the optional argument is supplied then the "
= "status of each server will also be displayed.", 13
BadListPSSyn
ListPS_Syntax
= "Syntax: *"
= TokenEscapeChar,Token0
= " [-full]", 0
HelpForConfigurePS
ConfigurePS_Help
= "*Configure PS sets the default name or number for the "
= "printer server. This name or number will be used if "
= "the first open (or save) does not explicitly quote "
= "either a name or a number", 13
SyntaxOfConfigurePS
ConfigurePS_Syntax
= "Syntax: *Configure "
[ :LNOT: UseMsgTrans
SyntaxOnlyOfConfigurePS
......
......@@ -14,16 +14,9 @@
#
# Makefile for NetPrint
#
# ***********************************
# *** C h a n g e L i s t ***
# ***********************************
# Date Name Description
# ---- ---- -----------
# 20-Dec-02 KJB Created.
#
COMPONENT = NetPrint
ROM_SOURCE = NewOS
COMPONENT = NetPrint
ROM_SOURCE = Module.s
TOKHELPSRC = ${TOKENSOURCE}
HELPSRC = HelpTexts
......
TTL ==> &.Arthur.NetPrint.N310OS
GBLL OldOs
OldOs SETL {FALSE}
GBLL UseMsgTrans
UseMsgTrans SETL {TRUE}
GBLL UseInterHelp
UseInterHelp SETL {FALSE}
GBLS OsString
OsString SETS " (3.10)"
LNK s.Module
TTL ==> &.Arthur.NetPrint.NewOS
GBLL OldOs
OldOs SETL {FALSE}
GBLL UseMsgTrans
UseMsgTrans SETL {TRUE}
GBLL UseInterHelp
UseInterHelp SETL {TRUE}
GBLS OsString
OsString SETS ""
LNK s.Module
No preview for this file type
......@@ -15,42 +15,17 @@
TTL ==> &.Arthur.NetPrint.Commands
Commands
= "SetPS",0
Command "SetPS", 1, 0, NetPrint_Inter_Help
Command "PS", 1, 0, NetPrint_Inter_Help
Command "ListPS", 1, 0, NetPrint_Inter_Help
Command "PS", 1, 1, NetPrint_Inter_Help :OR: Status_Keyword_Flag, ConfigurePS
DCD 0 ; Table terminator
ALIGN
& SetPScode - ModuleBase
InfoWord 1, 0, NetPrint_Inter_Help
& BadSetPSSyn - ModuleBase
& HelpSetPS - ModuleBase
= "PS",0
ALIGN
& PScode - ModuleBase
InfoWord 1, 0, NetPrint_Inter_Help
& BadPSSyn - ModuleBase
& HelpPS - ModuleBase
= "ListPS",0
ALIGN
& ListPScode - ModuleBase
InfoWord 1, 0, NetPrint_Inter_Help
& BadListPSSyn - ModuleBase
& HelpListPS - ModuleBase
GET TokHelpSrc.s
= "PS",0
ALIGN
& ConfigurePS - ModuleBase
InfoWord 1, 1, Status_Keyword_Flag :OR: NetPrint_Inter_Help
& SyntaxOfConfigurePS - ModuleBase
& HelpForConfigurePS - ModuleBase
& 0 ; Table terminator
ALIGN
GET TokHelpSrc.s
SetPScode ROUT
SetPS_Code ROUT
; R0 points to parameter after command
; Trash R1 to R6
LDR wp, [ r12 ]
......@@ -80,7 +55,7 @@ ExitGSTransName
STRVS r0, [ sp, #0 ]
Pull "r0-r2, pc"
PScode ROUT
PS_Code ROUT
; R0 points to parameter after command
; Trash R1 to R6
LDR wp, [ r12 ]
......@@ -134,7 +109,7 @@ PrintStr
= 0
ALIGN
ListPScode ROUT
ListPS_Code ROUT
LDR wp, [ r12 ]
TEQ r1, #0 ; The number of parameters
BNE Examine
......@@ -472,7 +447,7 @@ ErrorBufferOverflow
LTORG
ConfigurePS ROUT
ConfigurePS_Code ROUT
Push lr
LDR wp, [ r12 ]
CMP r0, #1
......@@ -554,14 +529,14 @@ Token_PSFullHeader
SWIVC XOS_NewLine
B %95
02 ; Print the current seting of *Con. PS
02 ; Print the current setting of *Con. PS
ADR r1, TemporaryBuffer
MOV r3, #30
BL AddString
= "Printer server ", 0
ALIGN
MOV r4, r1
MOVVC r0, #ReadCMOS
MOVVC r0, #OsByte_ReadCMOS
MOVVC r1, #NetPSIDCMOS
SWIVC XOS_Byte
BVS %95
......@@ -623,7 +598,7 @@ Token_PSFullHeader
SWI XEconet_ReadStationNumber ; R3.R2
BVS %95
MOV r4, r2 ; Save the station number
MOV r0, #ReadCMOS
MOV r0, #OsByte_ReadCMOS
MOV r1, #NetPSIDCMOS
SWI XOS_Byte
BVS %95
......@@ -656,7 +631,7 @@ ErrorUnableToDefault
]
68
MOV r0, #WriteCMOS
MOV r0, #OsByte_WriteCMOS
MOV r1, #NetPSIDCMOS
MOVS r2, r4
SWIPL XOS_Byte
......@@ -678,7 +653,7 @@ ErrorUnableToDefault
CMP r2, #7
BGT %90
MOV r4, r1
MOV r0, #WriteCMOS
MOV r0, #OsByte_WriteCMOS
MOV r1, #NetPSIDCMOS
MOV r2, #0
SWI XOS_Byte
......
......@@ -15,21 +15,21 @@
SUBT ==> &.Arthur.NetPrint.FileSystem
InfoBlock
DCD ModuleTitle - ModuleBase
DCD ModuleTitle - Module_BaseAddr
DCD 0 ; No initialise string
DCD OpenStream - ModuleBase
DCD GetByte - ModuleBase
DCD PutByte - ModuleBase
DCD Args - ModuleBase
DCD CloseStream - ModuleBase
DCD WholeFile - ModuleBase
DCD OpenStream - Module_BaseAddr
DCD GetByte - Module_BaseAddr
DCD PutByte - Module_BaseAddr
DCD Args - Module_BaseAddr
DCD CloseStream - Module_BaseAddr
DCD WholeFile - Module_BaseAddr
[ OldOs
DCD fsinfo_special + fsinfo_nullnameok + fsnumber_netprint
|
DCD fsinfo_special + fsinfo_nullnameok + fsinfo_alwaysopen + fsinfo_extrainfo + fsnumber_netprint
]
DCD FunctionEntry - ModuleBase
DCD PutBytes - ModuleBase
DCD FunctionEntry - Module_BaseAddr
DCD PutBytes - Module_BaseAddr
[ :LNOT: OldOs
DCD fsextra_FSDoesCat+fsextra_FSDoesEx
]
......@@ -120,7 +120,7 @@ ErrorNetPrintInternalError
]
FunctionEntry
[ False
[ {FALSE}
DLINE "NetPrint - OsFunction"
DREG r0, "Function code = &"
DREG r1, "Address of args / First argument = &"
......@@ -536,8 +536,8 @@ PollR9R10
; OSS: User pressed Escape. Acknowledge it and return an error to FileSwitch.
BL AbandonR9R10 ; Ignore errors
MOV r0, #126
SWI XOS_Byte ; Acknowledge the Escape condition
MOV r0, #OsByte_AcknowledgeEscape
SWI XOS_Byte
BVS RemoveRecord ; Tidy up and return error
MOV r0, #Status_Escape
......@@ -550,7 +550,6 @@ PollR9R10
NotEscapeR9R10
WritePSRc USR_mode,r3 ; Enable all interrupts and go to user mode
NOP
SWI XOS_ReadMonotonicTime
MOVVC r3, #0 ; Record no error state
MOVVS r3, r0 ; Record error
......
......@@ -256,7 +256,7 @@ ValidationLoop
TEQ r11, #1 ; Is the name null
BNE ExitNameValidation
SUB r10, r10, #1 ; Restore pointer
MOV r0, #ReadCMOS
MOV r0, #OsByte_ReadCMOS
MOV r1, #NetPSIDCMOS
SWI XOS_Byte
BVS ExitNameValidation
......@@ -313,9 +313,7 @@ BindName ROUT
ADD r1, r4, #PSNameSize ; End address
getpara
LDRB r2, [ r0 ], #1 ; Get character from buffer
CMP r2, #"a" ; Map "a"-"z" to "A"-"Z"
RSBGES r14, r2, #"z" ; Inverse compare
SUBGE r2, r2, #"a"-"A" ; Do the actual change
ASCII_UpperCase r2, r14
CMP r2, #" "
MOVCC r2, #" " ; Convert character to space if control
padout
......@@ -369,7 +367,6 @@ PollRx
TEQ r0, #Status_Received
BEQ ExamineReply
WritePSRc USR_mode,r3,,r4 ; Enable all interrupts and go to user mode
NOP
SWI XOS_ReadMonotonicTime
MOVVC r3, #0 ; Record no error state
MOVVS r3, r0 ; Record error
......@@ -656,7 +653,6 @@ ListServersLoop
DREG r9, "Number of entries returned = &"
]
WritePSRc USR_mode,r7,,r8 ; Enable all interrupts and go to user mode
NOP
SWI XOS_ReadMonotonicTime
MOVVC r7, #0 ; Record no error state
MOVVS r7, r0 ; Record error
......
......@@ -17,16 +17,16 @@
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Machine.<Machine>
GET Hdr:CMOS
GET Hdr:ModHand
GET Hdr:Services
GET Hdr:Econet
GET Hdr:LowFSi
GET Hdr:LowFSI
GET Hdr:FSNumbers
GET Hdr:HighFSI
GET Hdr:Debug
GET Hdr:NewErrors
GET Hdr:OsBytes
GET Hdr:Tokens
GET Hdr:MsgTrans
GET Hdr:Hourglass
......@@ -34,12 +34,19 @@
GET Hdr:Symbols
GET Hdr:Proc
GET Hdr:HostFS
GET Hdr:CPU.Arch
GET VersionASM
GET VersionASM
GBLL ReleaseVersion
ReleaseVersion SETL True
GBLL OldOs
OldOs SETL {FALSE}
GBLL UseMsgTrans
UseMsgTrans SETL {TRUE}
GBLL ReleaseVersion
ReleaseVersion SETL {TRUE}
[ :LNOT: :DEF: international_help
GBLL international_help
international_help SETL {TRUE} ; Default to RISC OS 3.60+ internationalisation
]
; OSS 5.51 Added to new Acorn sources to permit building of RISC OS 2 NetPrint once more.
......@@ -57,7 +64,7 @@ Error$name
; OSS 5.51 If building for RISC OS 3.1 or RISC OS 2 then don't want international help.
[ UseInterHelp
[ international_help
NetPrint_Inter_Help * International_Help
|
NetPrint_Inter_Help * 0
......@@ -65,24 +72,24 @@ NetPrint_Inter_Help * 0
AREA |NetPrint$$Code|,CODE,READONLY,PIC
ModuleBase ROUT
Module_BaseAddr ROUT
DCD 0 ; Start
DCD InitCode - ModuleBase ; Initialisation
DCD DieCode - ModuleBase ; Die
DCD Service - ModuleBase ; Service
DCD ModuleTitle - ModuleBase ; Title
DCD Help - ModuleBase ; Help String
DCD Commands - ModuleBase ; Combined Help/* command table
DCD Module_SWISystemBase + ( NetPrintSWI * Module_SWIChunkSize )
DCD SWICode - ModuleBase ; Offset of code to handle SWIs
DCD SWINames - ModuleBase ; Offset of a table of SWI names
DCD InitCode - Module_BaseAddr ; Initialisation
DCD DieCode - Module_BaseAddr ; Die
DCD Service - Module_BaseAddr ; Service
DCD ModuleTitle - Module_BaseAddr ; Title
DCD Help - Module_BaseAddr ; Help String
DCD Commands - Module_BaseAddr ; Combined Help/* command table
DCD NetPrintSWI_Base
DCD SWICode - Module_BaseAddr ; Offset of code to handle SWIs
DCD SWINames - Module_BaseAddr ; Offset of a table of SWI names
DCD 0 ; Terminate
[ NetPrint_Inter_Help <> 0
DCD MessageFileName - ModuleBase
[ international_help
DCD MessageFileName - Module_BaseAddr
|
DCD 0
]
DCD ModuleFlags - ModuleBase
DCD ModuleFlags - Module_BaseAddr
PSNameSize * 6 ; A constant
......@@ -94,10 +101,10 @@ ModuleName SETS "NetPrint"
GBLL Debug
GBLL OSSDebug
GBLL DuplicateDebug
Debug SETL ( :LNOT: ReleaseVersion ) :LAND: False
OSSDebug SETL ( :LNOT: ReleaseVersion ) :LAND: False
DuplicateDebug SETL ( :LNOT: ReleaseVersion ) :LAND: False
Host_Debug SETL (Debug :LOR: OSSDebug :LOR: DuplicateDebug) :LAND: False
Debug SETL ( :LNOT: ReleaseVersion ) :LAND: {FALSE}
OSSDebug SETL ( :LNOT: ReleaseVersion ) :LAND: {FALSE}
DuplicateDebug SETL ( :LNOT: ReleaseVersion ) :LAND: {FALSE}
Host_Debug SETL (Debug :LOR: OSSDebug :LOR: DuplicateDebug) :LAND: {FALSE}
; ****************************
......@@ -246,7 +253,7 @@ InitLoop
TEQ r1, r4
BNE InitLoop
MOV r0, #ReadCMOS ; Now read in the configured state
MOV r0, #OsByte_ReadCMOS ; Now read in the configured state
MOV r1, #NetPSIDCMOS
SWI XOS_Byte
Pull pc, VS ; Return error
......@@ -271,8 +278,8 @@ StartAsAFilingSystem
DLINE "Space initialised, CMOS read"
]
MOV r0, #FSControl_AddFS
ADR r1, ModuleBase
LDR r2, =( InfoBlock - ModuleBase )
ADR r1, Module_BaseAddr
LDR r2, =( InfoBlock - Module_BaseAddr )
MOV r3, wp ; Address of our private workspace
SWI XOS_FSControl
Pull pc ; Return, maybe with error
......@@ -306,12 +313,13 @@ ErrorNoEconet
ServiceTable
DCD 0
DCD ServiceMain - ModuleBase
DCD ServiceMain - Module_BaseAddr
ASSERT Service_ReAllocatePorts > Service_FSRedeclare
DCD Service_FSRedeclare
DCD Service_ReAllocatePorts
DCD 0
DCD ServiceTable - ModuleBase
DCD ServiceTable - Module_BaseAddr
Service ROUT
MOV r0, r0
TEQ r1, #Service_FSRedeclare
......@@ -333,8 +341,8 @@ DoReAllocatePorts
DoReDeclare
Push "r0-r3, lr"
MOV r0, #FSControl_AddFS
ADR r1, ModuleBase
LDR r2, =( InfoBlock - ModuleBase )
ADR r1, Module_BaseAddr
LDR r2, =( InfoBlock - Module_BaseAddr )
LDR r3, [ r12 ] ; The address of my private workspace
SWI XOS_FSControl ; No way to return the error
Pull "r0-r3, pc"
......@@ -368,7 +376,7 @@ DieCode ROUT
ReadConfiguredName
; => R10 points at destination for name
Push "r0-r2, r10, lr"
MOV r0, #ReadCMOS
MOV r0, #OsByte_ReadCMOS
MOV r1, #NetPSIDCMOS + 1
SWI XOS_Byte
BVS ExitReadName
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment