Commit 9099b4b9 authored by Timothy E Baldwin's avatar Timothy E Baldwin Committed by ROOL
Browse files

Remove SysCommsModule pseudo-module

Historically many commands of BBC Micro heritage were not included
in UitilyModules, but were separated out into a separate pseudo-module,
SysCommsModule, to allow for them to be terminated by any non-letter
for compatibility with the BBC Micro.

However with the introduction of `Oscli_HashedCommands` in August 1999
(and earlier in Ursula branch) this was broken except for *FX, *KEY,
*OPT and *TV, which are handled by a special case making SysCommsModule
redundant.

SysCommsModule is an obsitcle to making the kernel assemble to relocatable
AOF as it requires Module_BaseAddr to have 2 different values and therefore
be a absolute varaible instead of a section relative symbol.

This commit does not change behaviour with `Oscli_HashedCommands` enabled
which is the default, except for listing the command under UtilityModule
in *Help output. Which `Oscli_HashedCommands` disable this change removes
the special behaviour.

Version 6.53. Tagged as 'Kernel-6_53'
parent 7924aae2
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "6.52"
Module_Version SETA 652
Module_MajorVersion SETS "6.53"
Module_Version SETA 653
Module_MinorVersion SETS ""
Module_Date SETS "13 Feb 2021"
Module_ApplicationDate SETS "13-Feb-21"
Module_Date SETS "15 Feb 2021"
Module_ApplicationDate SETS "15-Feb-21"
Module_ComponentName SETS "Kernel"
Module_FullVersion SETS "6.52"
Module_HelpVersion SETS "6.52 (13 Feb 2021)"
Module_FullVersion SETS "6.53"
Module_HelpVersion SETS "6.53 (15 Feb 2021)"
END
/* (6.52)
/* (6.53)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 6.52
#define Module_MajorVersion_CMHG 6.53
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 Feb 2021
#define Module_Date_CMHG 15 Feb 2021
#define Module_MajorVersion "6.52"
#define Module_Version 652
#define Module_MajorVersion "6.53"
#define Module_Version 653
#define Module_MinorVersion ""
#define Module_Date "13 Feb 2021"
#define Module_Date "15 Feb 2021"
#define Module_ApplicationDate "13-Feb-21"
#define Module_ApplicationDate "15-Feb-21"
#define Module_ComponentName "Kernel"
#define Module_FullVersion "6.52"
#define Module_HelpVersion "6.52 (13 Feb 2021)"
#define Module_LibraryVersionInfo "6:52"
#define Module_FullVersion "6.53"
#define Module_HelpVersion "6.53 (15 Feb 2021)"
#define Module_LibraryVersionInfo "6:53"
......@@ -92,7 +92,6 @@
GET s.ARMops
GET s.NewIRQs
GET s.Oscli
GET s.SysComms
GET s.HeapMan
GET s.ModHand
$GetUnsqueeze
......@@ -106,6 +105,7 @@
GET s.LibKern
GET s.Utility
GET s.MoreComms
GET s.SysComms
GET s.Convrsions
GET s.MoreSWIs
GET s.ExtraSWIs
......
......@@ -192,14 +192,6 @@ access SETA access :OR: CMA_Partially_PrivR
]
MEND
; one that builds a module command table entry:
; set Module_BaseAddr to module base before use.
GBLA Module_BaseAddr
Module_BaseAddr SETA 0
;
a1 RN 0
a2 RN 1
a3 RN 2
......
......@@ -537,29 +537,11 @@ oqa_quicksilvertime_noalias
MOV r2,#0 ; Must be zero for oscli_hlist_loop. Not entirely sure why!
]
CMP r1,#0
BEQ oscli_sysabbrevation
BEQ oscli_abbreviation
BL SysCommsHashedLookup
B oscli_syslook_done
oscli_sysabbrevation
]
ADRL R1, SysCommsModule
MOV R2, #SCHCTab-SysCommsModule
SEC ; carry set means sys module
BL ModCommsLookUp
oscli_syslook_done
BCS OscliExit
[ Oscli_HashedCommands
;now try UtilityModule, if non-abbreviated command
Push "R2"
LDR r2,=ZeroPage
LDR r1,[r2,#Oscli_CmdHashSum]
CMP r1,#0
Pull "R2",EQ
BEQ oscli_modabbreviation
BL UtilCommsHashedLookup
ADDCS stack, stack, #4 ;discard R2
BCS OscliExit
;now try list of modules on hash value
LDR r2,=ZeroPage
LDR r1,[r2,#Oscli_CmdHashSum]
......@@ -594,7 +576,7 @@ oscli_hlist_loop
Pull "r3,r4"
ADD stack,stack,#4
B OscliExit
oscli_modabbreviation
oscli_abbreviation
] ;Oscli_HashedCommands
; now try looking round the modules.
......@@ -760,7 +742,7 @@ Oscli_cmd_hashsum ROUT
MOV r1,#0
Pull "r0,r2-r3,PC"
;
;special entry of ModCommsLookUp, for hashed lookup of commands in SysCommsModule
;special entry of ModCommsLookUp, for hashed lookup of fudged commands
;entry: R0 -> command, r1 = hash value of command
;
SysCommsHashedLookup ROUT
......@@ -785,35 +767,20 @@ schl_nofudgesofar
CMP R4, #4
BLS schl_fudgeloop
schl_nofudge
ADRL R2, SysCoHashedCmdTab
ADRL R2, UtilHashedCmdTab
AND R4, R1,#Oscli_CHashValMask ;hash value, masked for command hashing
LDR R2, [R2, R4, LSL #2] ;command list for this hash value
ADRL R1, SysCommsModule
CMP R2, #1 ;set carry if valid table entry
BCS ModCommsLookUp_AltEntry ;note: carry set to indicate sys module
Pull "R0, R2-R10, pc" ;bail if null hash table entry (with carry clear to indicate failure)
ADRL R1, UtilityMod
TEQ R2, #0,2 ;check R2 and clear carry
BNE ModCommsLookUp_AltEntry
Pull "R0, R2-R10, pc" ;bail if null hash table entry
schl_fudge
ADRL R1, SysCommsModule
ADRL R1, UtilityMod
ADRL R2, SHC_fudgeulike
SUB R2, R2, R1 ;fudge command list (offset)
SEC ;carry set means sys module
B ModCommsLookUp_AltEntry
;
;special entry of ModCommsLookUp, for hashed lookup of commands in UtilityMod
;entry: R0 -> command, r1 = hash value of command
;
UtilCommsHashedLookup ROUT
Push "R0, R2-R10, lr"
ADRL R2, UtilHashedCmdTab
AND R4, R1,#Oscli_CHashValMask ;hash value, masked for command hashing
LDR R2, [R2, R4, LSL #2] ;command list for this hash value
ADRL R1, UtilityMod
TEQ R2, #0,2 ;check R2 and clear carry
BNE ModCommsLookUp_AltEntry
Pull "R0, R2-R10, pc" ;bail if null hash table entry
;
] ;Oscli_HashedCommands
;***************************************************************************
......
......@@ -22,28 +22,6 @@ UtilRegs SETS "r7-r10" ; Sam will preserve r0-r6 on module star entry
AnyNoParms * &FF0000 ; Between 0 and 255 parameters: all flags clear
SysCommsModule ROUT
Module_BaseAddr SETA SysCommsModule
& 0 ; No Start entry
& 0 ; Not initialised
& 0
& 0
& 0
& SysTitle-SysCommsModule
& SCHCTab-SysCommsModule
& 0
& 0
& 0
& 0
[ International_Help <> 0
& MessageFileName-SysCommsModule
|
& 0
]
SysTitle
= "$SystemName", 9
[ :LEN: "$SystemName" < 8
......@@ -51,167 +29,9 @@ SysTitle
]
= "$VersionNo", 0
[ Oscli_HashedCommands
;
;***WARNING*** if commands are added or changed, SysCoHashedCmdTab MUST be updated correspondingly
;
]
SCHCTab ; Alphabetically ordered so it's easier to find stuff
Command Append, 1, 1, International_Help
Command Build, 1, 1, International_Help
Command Close, 0, 0, International_Help
Command Create, 4, 1, International_Help
Command Delete, 1, 1, International_Help
Command Dump, 3, 1, International_Help
Command Exec, 1, 0, International_Help
Command FX, 5, 1, International_Help ; 1-3 parms, but up to 2 commas may be there
Command GO, 255, 0, International_Help
HelpText
Command Help, 255, 0, International_Help
Command Key, 255, 1, International_Help
Command Load, 2, 1, International_Help ; Fudge order for compatibility (*L.)
Command List, 3, 1, International_Help
Command Opt, 2, 0, International_Help
Command Print, 1, 1, International_Help
Command Quit, 0, 0, International_Help
Command Remove, 1, 1, International_Help
Command Save, 6, 2, International_Help ; *SAVE Fn St + Le Ex Lo (compatibility)
Command Shadow, 1, 0, International_Help
Command Spool, 1, 0, International_Help
Command SpoolOn, 1, 0, International_Help
Command TV, 3, 0, International_Help
Command Type, 3, 1, International_Help ; -file fred -tabexpand
= 0
[ Oscli_HashedCommands
;
; - Hashing table is 32 wide
; - Hashing function is:
;
; hash = (sum of all chars of command, each upper-cased) & 0x1f
;
; - Order of commands in each hashed list is alphabetical
; Table MUST be reorganised if hashing function changed, or command set altered
;
ALIGN
SysCoHashedCmdTab
;
; ! 0,"SysCoHashedCmdTab at ":CC::STR:(SysCoHashedCmdTab)
;
;First, 1 word per table entry, giving offset to hashed list on each hash value
;
DCD SHC_hash00 - SysCommsModule
DCD 0 ;null list on this hash value
DCD SHC_hash02 - SysCommsModule
DCD SHC_hash03 - SysCommsModule
DCD 0
DCD SHC_hash05 - SysCommsModule
DCD SHC_hash06 - SysCommsModule
DCD 0
DCD 0
DCD SHC_hash09 - SysCommsModule
DCD SHC_hash0A - SysCommsModule
DCD 0
DCD 0
DCD SHC_hash0D - SysCommsModule
DCD SHC_hash0E - SysCommsModule
DCD SHC_hash0F - SysCommsModule
DCD SHC_hash10 - SysCommsModule
DCD 0
DCD 0
DCD SHC_hash13 - SysCommsModule
DCD SHC_hash14 - SysCommsModule
DCD 0
DCD SHC_hash16 - SysCommsModule
DCD 0
DCD SHC_hash18 - SysCommsModule
DCD 0
DCD 0
DCD 0
DCD SHC_hash1C - SysCommsModule
DCD 0
DCD SHC_hash1E - SysCommsModule
DCD 0
;
; Now the hashed lists
;
SHC_hash00
Command Load, 2, 1, International_Help ; Fudge order for compatibility (*L.)
= 0
ALIGN
SHC_hash02
Command Type, 3, 1, International_Help ; -file fred -tabexpand
= 0
ALIGN
SHC_hash03
Command Quit, 0, 0, International_Help
= 0
ALIGN
SHC_hash05
Command Exec, 1, 0, International_Help
= 0
ALIGN
SHC_hash06
Command Shadow, 1, 0, International_Help
= 0
ALIGN
SHC_hash09
Command Help, 255, 0, International_Help
Command Key, 255, 1, International_Help
= 0
ALIGN
SHC_hash0A
Command SpoolOn, 1, 0, International_Help
Command TV, 3, 0, International_Help
= 0
ALIGN
SHC_hash0D
Command Print, 1, 1, International_Help
Command Spool, 1, 0, International_Help
= 0
ALIGN
SHC_hash0E
Command Remove, 1, 1, International_Help
= 0
ALIGN
SHC_hash0F
Command Save, 6, 2, International_Help ; *SAVE Fn St + Le Ex Lo (compatibility)
= 0
ALIGN
SHC_hash10
Command Build, 1, 1, International_Help
= 0
ALIGN
SHC_hash13
Command Delete, 1, 1, International_Help
Command Opt, 2, 0, International_Help
= 0
ALIGN
SHC_hash14
Command Create, 4, 1, International_Help
= 0
ALIGN
SHC_hash16
Command Close, 0, 0, International_Help
Command Dump, 3, 1, International_Help
Command GO, 255, 0, International_Help
= 0
ALIGN
SHC_hash18
Command Append, 1, 1, International_Help
= 0
ALIGN
SHC_hash1C
Command List, 3, 1, International_Help
= 0
ALIGN
SHC_hash1E
Command FX, 5, 1, International_Help ; 1-3 parms, but up to 2 commas may be there
= 0
ALIGN
;now a small table to fudge around need for old syntax for *fx etc (ie.
;allow zero spaces between command and first, numeric, parameter)
;
......@@ -264,12 +84,7 @@ Help_Code ROUT ; got R0 ptr to commtail, R1 no parameters
MOV r7, #0 ; anyhelpdoneyet flag
DoHelpOnNextKeyWord
; now look at syscomms module.
addr r1, SysCommsModule
BL ShowHelpInModule
BVS %FT67
; now try looking round the modules.
; try looking round the modules.
LDR R2, =ZeroPage+Module_List
11 LDR R2, [R2]
CMP R2, #0
......
......@@ -21,6 +21,7 @@ SysModules_Info ROUT ; start of ROM modules chain
& EndOfKernel-SysModules_Info
UtilityMod
Module_BaseAddr
& StartSuper-UtilityMod
& 0 ; no initialisation
& Util_Die-UtilityMod
......@@ -46,8 +47,6 @@ Util_SWITab
= 0
ALIGN
Module_BaseAddr SETA UtilityMod
[ ChocolateService
;service table
;
......@@ -206,6 +205,31 @@ UtilHelpStr = "MOS Utilities", 9, "$VersionNo", 0
;
]
UtilHelpTab
Command Append, 1, 1, International_Help
Command Build, 1, 1, International_Help
Command Close, 0, 0, International_Help
Command Create, 4, 1, International_Help
Command Delete, 1, 1, International_Help
Command Dump, 3, 1, International_Help
Command Exec, 1, 0, International_Help
Command FX, 5, 1, International_Help ; 1-3 parms, but up to 2 commas may be there
Command GO, 255, 0, International_Help
HelpText
Command Help, 255, 0, International_Help
Command Key, 255, 1, International_Help
Command Load, 2, 1, International_Help ; Fudge order for compatibility (*L.)
Command List, 3, 1, International_Help
Command Opt, 2, 0, International_Help
Command Print, 1, 1, International_Help
Command Quit, 0, 0, International_Help
Command Remove, 1, 1, International_Help
Command Save, 6, 2, International_Help ; *SAVE Fn St + Le Ex Lo (compatibility)
Command Shadow, 1, 0, International_Help
Command Spool, 1, 0, International_Help
Command SpoolOn, 1, 0, International_Help
Command TV, 3, 0, International_Help
Command Type, 3, 1, International_Help ; -file fred -tabexpand
Command Break, 0, 0, International_Help ; just help
Command Cache, 1, 0, International_Help
Command ChangeDynamicArea,255, 0, International_Help
......@@ -260,12 +284,12 @@ UtilHashedCmdTab
;
;First, 1 word per table entry, giving offset to hashed list on each hash value
;
DCD 0 ;null list on this hash value
DCD UHC_hash00 - UtilityMod
DCD UHC_hash01 - UtilityMod
DCD UHC_hash02 - UtilityMod
DCD 0
DCD UHC_hash03 - UtilityMod
DCD UHC_hash04 - UtilityMod
DCD 0
DCD UHC_hash05 - UtilityMod
DCD UHC_hash06 - UtilityMod
DCD UHC_hash07 - UtilityMod
DCD UHC_hash08 - UtilityMod
......@@ -273,36 +297,45 @@ UtilHashedCmdTab
DCD UHC_hash0A - UtilityMod
DCD UHC_hash0B - UtilityMod
DCD UHC_hash0C - UtilityMod
DCD 0
DCD 0
DCD UHC_hash0D - UtilityMod
DCD UHC_hash0E - UtilityMod
DCD UHC_hash0F - UtilityMod
DCD 0
DCD UHC_hash10 - UtilityMod
DCD UHC_hash11 - UtilityMod
DCD 0
DCD 0
DCD UHC_hash13 - UtilityMod
DCD UHC_hash14 - UtilityMod
DCD 0
DCD UHC_hash16 - UtilityMod
DCD 0
DCD 0
DCD 0
DCD UHC_hash18 - UtilityMod
DCD UHC_hash19 - UtilityMod
DCD 0
DCD UHC_hash1B - UtilityMod
DCD 0
DCD UHC_hash1C - UtilityMod
DCD 0
DCD UHC_hash1E - UtilityMod
DCD UHC_hash1F - UtilityMod
;
; Now the hashed lists
;
UHC_hash00
Command Load, 2, 1, International_Help ; Fudge order for compatibility (*L.)
= 0
ALIGN
UHC_hash01
Command Show, 1, 0, International_Help
= 0
ALIGN
UHC_hash02
Command Type, 3, 1, International_Help ; -file fred -tabexpand
Command Configure, 255, 0, Help_Is_Code_Flag :OR: International_Help
= 0
ALIGN
UHC_hash03
Command Quit, 0, 0, International_Help
= 0
ALIGN
UHC_hash04
Command ChangeDynamicArea,255, 0, International_Help
Command RMFaster, 1, 1, International_Help
......@@ -310,7 +343,12 @@ UHC_hash04
Command Ignore, 1, 0, International_Help
= 0
ALIGN
UHC_hash05
Command Exec, 1, 0, International_Help
= 0
ALIGN
UHC_hash06
Command Shadow, 1, 0, International_Help
Command RMClear, 0, 0, International_Help
= 0
ALIGN
......@@ -323,10 +361,14 @@ UHC_hash08
= 0
ALIGN
UHC_hash09
Command Help, 255, 0, International_Help
Command Key, 255, 1, International_Help
Command GOS, 0, 0, International_Help
= 0
ALIGN
UHC_hash0A
Command SpoolOn, 1, 0, International_Help
Command TV, 3, 0, International_Help
Command RMReInit, 255, 1, International_Help
Command Error, 255, 1, International_Help
= 0
......@@ -339,23 +381,53 @@ UHC_hash0C
Command Set, 255, 2, International_Help
= 0
ALIGN
UHC_hash0D
Command Print, 1, 1, International_Help
Command Spool, 1, 0, International_Help
= 0
ALIGN
UHC_hash0E
Command Remove, 1, 1, International_Help
= 0
ALIGN
UHC_hash0F
Command Save, 6, 2, International_Help ; *SAVE Fn St + Le Ex Lo (compatibility)
Command IF, 255, 2, International_Help
Command Unset, 1, 1, International_Help
Command Time, 0, 0, International_Help
= 0
ALIGN
UHC_hash10
Command Build, 1, 1, International_Help
= 0
ALIGN
UHC_hash11
Command RMEnsure, 255, 2, International_Help
= 0
ALIGN
UHC_hash13
Command Delete, 1, 1, International_Help
Command Opt, 2, 0, International_Help
= 0
ALIGN
UHC_hash14
Command Create, 4, 1, International_Help
Command SetEval, 255, 2, International_Help
Command RMRun, 255, 1, International_Help
Command RMInsert, 2, 1, International_Help
Command Cache, 1, 0, International_Help
= 0
ALIGN
UHC_hash16
Command Close, 0, 0, International_Help
Command Dump, 3, 1, International_Help
Command GO, 255, 0, International_Help
= 0
ALIGN
UHC_hash18
Command Append, 1, 1, International_Help
= 0
ALIGN
UHC_hash19
Command Modules, 0, 0, Help_Is_Code_Flag :OR: International_Help
Command RMTidy, 0, 0, International_Help
......@@ -365,7 +437,12 @@ UHC_hash1B
Command Unplug, 2, 0, International_Help
= 0
ALIGN
UHC_hash1C
Command List, 3, 1, International_Help
= 0
ALIGN
UHC_hash1E
Command FX, 5, 1, International_Help ; 1-3 parms, but up to 2 commas may be there
Command SetMacro, 255, 2, International_Help
= 0
ALIGN
......@@ -393,6 +470,8 @@ Break_Syntax * Module_BaseAddr
PowerOn_Code * Module_BaseAddr
PowerOn_Syntax * Module_BaseAddr
LTORG
RMFaster_Code
Push "lr"
MOV R1, R0
......@@ -836,9 +915,6 @@ KeyHelpCommon ; also used by *Configure
Pull "r1,r3" ; restore r1 and get buffer pointer
Pull "pc", VS ; if error, exit
MOV r0, #0
ADRL R2, SysCommsModule
BL OneModuleK
BVS %FT10
LDR R6, =ZeroPage+Module_List
12 LDR R6, [R6]
CMP R6, #0
......
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