5.2.1 * Manager Trap - Trap #1
sms.info |
MT.INF |
1 / 0 |
|
|
System information |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
|
|
D1 |
calling jobs ID |
|
|
|
D2 |
ASCII Version of System ROM |
|
|
|
A0 |
system variables base address |
NOERR
sms.crjob |
MT.CJOB |
1 / 1 |
|
|
Creating the job structure, remaining in-active |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
owner job ID |
D1 |
Job ID |
|
D2 |
size of code area |
|
|
|
D3 |
size of data space |
|
|
|
|
|
A0 |
job memory base address |
|
A1 |
Zero or abs. start address, till QDOS 1.03 always zero |
ERR.OM -3
ERR.NJ -2 too many jobs or D1 not a job
The jobs stack ptr A7 points to the lower of two zero longwords; no other
initialization. Any job can be the owner.
sms.injb |
MT.JINF |
1 / 2 |
|
|
Fetch a jobs status. |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Job ID |
D1 |
next job |
|
D2 |
last job in chain / 0 |
D2 |
owner job |
|
|
|
D3 |
MSB -ve: suspended
LSB priority |
|
|
|
A0 |
start address |
|
|
|
A1 |
smashed |
ERR.NJ -2
D1 can start with any valid job ID. Consecutive calls if started with D1:=D2:=0
will scan the entire jobs tree of the system. The last job will wrap back
to D1:=0.
sms.rmjb |
MT.RJOB |
1 / 4 |
|
|
Removing an inactive Job. Not necessarily "atomic" |
sms.frjb |
MT.FRJOB |
1 / 5 |
|
|
Forcedly removing a Job. Not necessarily "atomic" |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Job ID |
D1 |
smashed |
|
|
|
D2 |
smashed |
|
D3 |
error code |
D3 |
smashed |
|
|
|
A0 - A3 |
smashed |
ERR.NJ -2
ERR.NC -1 Job still active (RJOB)
FRJOB will remove the specified and all its child jobs, still active jobs
inclusive. The error code in D3 will be passed to a job waiting for termination
of this one, which then will proceed executing (SBasic:: ERNUM after EXEC_W).
The 1st (standard) SBasic job cannot be removed.
sms.frtp |
MT.FREE |
1 / 6 |
|
|
Find the biggest free space in tpa |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
|
|
D1 |
size of free space |
|
|
|
D2, D3 |
smashed |
|
|
|
A0 - A3 |
smashed |
NOERR
sms.exv |
MT.TRAPV |
1 / 7 |
|
|
activate a job specific trap redirection table (exceptions
& #5 - #15) |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Job ID |
|
|
|
A0 |
Ptr to table |
A0 |
Job base |
|
|
|
A1 |
smashed |
NOERR
New jobs will inherit the table of their originator, regardless of the
actual owner.
sms.ssjb |
MT.SUSJB |
1 / 8 |
|
|
Suspend a Job. Not "atomic" |
sms.usjb |
MT.RELJB |
1 / 9 |
|
|
Release a Job. Not "atomic" |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Job ID |
D1 |
Job ID |
|
D3.W |
time (ticks * 20ms) |
|
|
|
|
|
A0 |
job control block |
|
A1 |
Ptr to Flag byte or zero |
|
|
ERR.NJ -2
MT.SUSJB: The flag byte, if A1 was non zero, will be reset when the job
was released, after the time-out period. All jobs are rescheduled.
MT.RELJB: D3, A1 are don't care values.
sms.acjb |
MT.ACTIV |
1 / 10 |
|
|
Activate a Job. Not "atomic" |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
D0 |
error code of activated job |
|
D1 |
Job ID |
D1 |
Job ID |
|
D2.B |
Priority 0 - 127 |
|
|
|
D3.W |
time-out -1 or 0 |
|
|
|
|
|
A0 |
base of jcb |
|
|
|
A3 |
smashed if D3 was =/= 0 |
ERR.NJ -2
ERR.NC -1 Job already active
D3 = 0 for a free running independent job (SBasic: EX, EXEC),
D3 = -1 current job suspended until termination of the new one (EW,
EXEC_W).
sms.spjb |
MT.PRIOR |
1 / 11 |
|
|
Change job priority, not "atomic" |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Job ID |
D1 |
Job ID |
|
D2.B |
Priority 0 - 127 |
|
|
|
|
|
A0 |
base of jcb |
ERR.NJ -2
{15}, SQ: A0 smashed (not verified, probably false information).
sms.alhp |
MT.ALLOC |
1 / 12 |
|
|
Allocate heap memory, rel. A6, the only one "atomic"
allocation |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
requested length |
D1 |
allocated length |
|
|
|
D2 |
smashed |
|
|
|
D3 |
smashed |
|
A0 |
Ptr to Ptr to memory area |
A0 |
block start address |
|
|
|
A1 - A3 |
smashed |
|
A6 |
Reference |
|
|
ERR.OM -3
sms.rehp |
MT.LNKFR |
1 / 13 |
|
|
De-allocate heap memory, rel. A6, the only one
"atomic" de-allocation |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
length to de-allocate |
D1 - D3 |
smashed |
|
A0 |
memory base address |
A0 |
smashed |
|
A1 |
Ptr to Ptr to memory area |
A1 - A3 |
smashed |
|
A6 |
Reference |
|
|
NOERR
sms.arpa |
MT.ALRES |
1 / 14 |
|
|
Resident memory allocation |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
requested length |
|
|
|
|
|
A0 |
Base address |
ERR.OM -3
ERR.NC -2 transient programs (jobs) already present
{not smsq} |
MT.RERES |
1 / 15 |
|
|
Resident memory de-allocation, MINERVA only |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
|
|
D1 - D3 |
smashed |
|
|
|
A0 - A3 |
smashed |
ERR.NC -2 transient programs (jobs) already present
{MGG} NOERR and non functional.
{15}: {SQ} not specified.
sms.dmod |
MT.DMODE |
1 / 16 |
|
|
Video and display mode |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1.B |
-1 read only |
D1.B |
mode |
|
|
0 four colours
|
|
|
|
8 eight colours
|
|
|
D2.B |
-1 read only |
D2 |
|
|
|
0 Monitor
|
|
|
|
1 TV mode
|
|
|
|
|
A3 |
smashed |
|
|
|
A4 |
JS, SQ: smashed |
NOERR
SQ: current job specific {15}.
MINERVA additional features
{3}:
D1 Bit |
set |
Unset |
0 |
"other" screen visible.. |
..invisible |
1 |
ditto, current screen
|
|
2 |
"other" MODE 4 |
"other" MODE 8 |
3 |
ditto., current screen
|
|
4 |
display in screen 0 |
..screen 1 |
5 |
default is screen 0 |
..screen 1 |
6 |
D1 as Byte |
D1 as Word (16-Bit) |
7 |
complement of Bit 6
|
|
8...15 |
don't care |
additional modifiers valid |
|
|
|
8...13 |
Bits 0..5 absolute |
..toggle |
14 |
|
MODE valid in "other" screen |
15 |
|
MODE valid in default screen |
D1.B = 0 or = 8 as standard, for default screen (0).
D1 special return bits:
Bit |
0 |
1 |
screen |
Name |
0 |
visible |
invisible |
"other" |
|
1 |
" |
" |
default |
|
2 |
MODE 4 |
MODE 8 |
"other" |
|
3 |
" |
" |
default |
MC..M256 |
4 |
screen 0 |
screen 1 |
"other" |
|
5 |
" |
" |
default |
|
6 |
-/- |
-/- |
-/- |
|
7 |
single |
double |
available |
MC..SCRN |
sms.hdop |
MT.IPCOM |
1 / 17 |
|
|
execute an IPC command. re {3.7.5} |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
|
|
D1.B |
answer bits |
|
|
|
D5 |
smashed |
|
|
|
D7 |
smashed |
|
A3 |
Ptr to command table |
|
|
NOERR
sms.comm |
MT.BAUD |
1 / 18 |
|
|
set Baud rate |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1.W |
Baud rate (re manual) |
D1.L |
smashed |
NOERR
sms.rrtc |
MT.RCLCK |
1 / 19 |
|
|
read the clock |
sms.srtc |
MT.SCLCK |
1 / 20 |
|
|
set the clock |
sms.artc |
MT.ACLCK |
1 / 21 |
|
|
advance the clock |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
time (increment) in seconds |
D1 |
actual time (seconds) |
|
|
|
A0 |
smashed |
NOERR
sms.ampa |
MT.ALBAS |
1 / 22 |
|
|
expand SBasic program memory |
sms.rmpa |
MT.REBAS |
1 / 23 |
|
|
shrink SBasic program memory |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
length request |
D1 |
length done |
|
|
|
D2, D3 |
smashed |
|
|
|
A0 - A3 |
smashed |
|
A6 |
Reference address |
A6 |
new Reference |
|
A7 |
User-Stackptr |
A7 |
new Stackptr |
ERR.OM -3 (MT.ALBAS)
NOERR (MT.REBAS)
Deallocation will be effective not before the next NEW or CLEAR, reliably.
SQ: may both work in an unpredictable manner, if at all.
sms.achp |
MT.ALCHP |
1 / 24 |
|
|
memory allocation for a Job im Common Heap |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
requested length |
D1 |
allocated length |
|
D2 |
owner job ID |
D2, D3 |
smashed |
|
|
|
A0 |
base address of Blocks |
|
A1 |
any even value |
A1 - A3 |
smashed |
ERR.OM -3
ERR.NJ -2
All memory area cleared and freely useable.
A1 even-ness requirement not documented but, found in some QL-systems.
sms.rchp |
MT.RECHP |
1 / 25 |
|
|
Common heap memory de-allocation |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
|
|
D1 - D3 |
smashed |
|
A0 |
base address |
A0 - A3 |
smashed |
NOERR
equivalent calls to inserting the system routines to the QDOS Linked
Lists, and to unlinking; re {3.3}, {3.5},
{4.2}, {4.4.}
sms.lexi |
MT.LXINT |
1 / 26 |
|
|
link an external Interrupt handler |
sms.rexi |
MT.RXINT |
1 / 27 |
|
|
ditto. unlink |
sms.lpol |
MT.LPOLL |
1 / 28 |
|
|
link a Polled (50 Hz) Interrupt handler |
sms.rpol |
MT.RPOLL |
1 / 29 |
|
|
ditto. unlink. |
sms.lshd |
MT.LSCHD |
1 / 30 |
|
|
link a scheduled interrupt handler. |
sms.rshd |
MT.RSCHD |
1 / 31 |
|
|
ditto. unlink. |
sms.liod |
MT.LIOD |
1 / 32 |
|
|
link a simple Device Handler |
sms.riod |
MT.RIOD |
1 / 33 |
|
|
ditto. unlink |
sms.lfsd |
MT.LDD |
1 / 34 |
|
|
link a directory Device Handler |
sms.rfsd |
MT.RDD |
1 / 35 |
|
|
ditto. unlink |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
A0 |
link address |
|
|
|
A1 |
(even numbered !) |
A1 |
smashed |
NOERR
A0 points to link field, which be filled in by the system.
4(A0) points to the previously(!) assigned call address.
sms.trns |
MT.TRA |
1 / 36 |
|
|
insert TRA tables (MT.CNTRY) {3.8} |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Zero or Ptr to
character translation table |
D1 |
smashed |
|
D2 |
Zero or Ptr to
table of system messages |
D2 |
smashed |
|
|
|
D3 |
smashed |
|
|
|
A0 - A3 |
smashed |
NOERR
No Name |
|
1 / 37 |
|
|
reserved by Sinclair, no known QDOS usage. |
SQ only:
sms.xtop |
SMS.XTOP |
1 / 37 |
|
|
freely definable Manager Trap, User Mode |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
called routine receives: |
|
|
|
|
|
A5 |
Ptr to storage of D7, A5, A6 |
|
|
|
A6 |
base address of system variables |
User Mode, only, to be terminated by RTS.
Executes in Supervisor Mode, forcedly(!) returns to User Mode.
The following Trap #1 calls are available with the Thing
extension only {4.6}, in SMS2 and SMSQ/E
{15}, access from QDOS and SMSQ by TH.ENTRY.
The registers D1 - D3 and A1 - A3, and sometimes A4, might not be preserved
when using the Thing emulation (different sources of information tell it
differently).
Any calls can return:
ERR.NF -7 Thing not found.
sms.lthg |
MT.LTHG |
1 / 38 |
|
|
link a Thing, TG {4.6} |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
A0 |
link address |
|
|
|
|
|
A1 |
smashed |
{15} tells that A1 will be preserved.
ERR.EX -8 Thing already exists
sms.rthg |
MT.RTHG |
1 / 39 |
|
|
unlink Thing if unused |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
A0 |
link address |
|
|
|
|
|
A1 |
smashed |
ERR.IU -9
sms.uthg |
SMS.UTHG |
1 / 40 |
|
|
use Thing TG {4.6} |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Job ID |
D1 |
Job ID |
|
D2 |
additional data |
D2 |
return data |
|
D3.W |
time to wait |
D3 |
Version |
|
A0 |
Ptr to Thing name |
|
|
|
|
|
A1 |
address of Thing |
|
A2 |
Parameter |
A2 |
return data |
{15}: A1 will be smashed.
ERR.xx all values from the USE Routine
sms.fthg |
SMS.FTHG |
1 / 41 |
|
|
Thing release TG {4.6} |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
user job ID |
|
|
|
D2 |
additional. Data |
D2 |
return data |
|
D3 |
ditto. |
|
|
|
A0 |
Ptr to Name |
|
|
|
A1 |
additional. Data |
|
|
|
A2 |
ditto. |
|
|
ERR.xx all values from the FREE Routine
sms.zthg |
SMS.ZTHG |
1 / 42 |
|
|
forcedly Thing unlink. User Mode only |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
A0 |
Ptr to name |
|
|
Thing removal will also remove any jobs that currently use the thing
concerned.
Not returm from this trap if the calling job was removed also.
Thing linkage memory will be released, automatically.
sms.nthg |
SMS.NTHG |
1 / 43 |
|
|
sequentially select next Thing |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
A0 |
Ptr to Name or Zero |
|
|
|
|
|
A1 |
next Link block or Zero |
A0 := 0 at start can be used to scanning the entire Thing list,
A1 := 0 will be returned at the lists end.
sms.sthg |
SMS.STHG |
1 / 44 |
|
sms.nthu |
SMS.NTHU |
1 / 44 |
lt {15} |
|
find next user of a Thing |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
|
|
D2 |
owner of usage block |
|
A0 |
Name of Thing |
|
|
|
A1 |
Ptr to usage block or Zero |
A1 |
next usage block / Zero |
ERR.NJ -2 usage block not found
The size of usage block might change. or a user may disappear while scanning,
thus the returned data should be verified before being used elsewhere.
The following Traps are available with
SQ, only:
For in depth information re {15};
with the exception of (1/47) none of them were checked.
ERR.BP will be returned by any QDOS systems if those traps are not defined.
sms.iopr |
SMS.IOPR |
1 / 46 |
|
|
set i/o priority |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D2.W |
priority |
|
|
NOERR
sms.cach |
SMS.CACH |
1 / 47 |
|
|
Processor Cache set |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
-1: read only |
D1 |
old state |
|
|
1: on, 0: off |
|
|
NOERR
This trap can be substituted with the system variables (bytes) at $c8(sb) and $ca(sb).
The reading mode, D1=-1, was proposed by the author and reportedly (i.e. not verified) is implemented.
sms.lldm |
SMS.LLDM |
1 / 48 |
|
|
insert "language dependent Module" |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
D1 |
|
D1 |
|
|
A1 |
Ptr to Module |
A1 |
|
All modules of the List (A1) be linked into the language dependent
modules list.
sms.lenq |
SMS.LENQ |
1 / 49 |
|
|
find language code |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
if =/= 0, ret code |
D1 |
telephone country code |
|
D2 |
if =/= 0, ret label |
D2 |
national motor car label |
NOERR
Passing an invalid parameter will be responded to with the corresponding
default value; D2 being filled up with trailing blanks, as necessary.
sms.lset |
SMS.LSET |
1 / 50 |
|
|
set language code |
|
|
|
|
|
Data as SMS.LENQ
sms.pset |
SMS.PSET |
1 / 51 |
|
|
set/activate printer output translation |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
translation code |
D1 |
smashed |
|
|
0: as TRA 0 |
|
|
|
|
1: as TRA 1 |
|
|
|
|
address: TRA address |
|
|
|
additionally |
|
|
|
|
|
2: IBM type TRA |
|
|
|
|
3: GEM type TRA |
|
|
|
|
code.W | $ffff.W: language module |
|
|
|
|
code.W | 0001.W: activate |
|
|
sms.mptr |
SMS.MPTR |
1 / 52 |
|
|
find address of a system message |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
D1 |
|
D1 |
|
|
A1 |
message code (negative) |
A1 |
Ptr to Text |
NOERR
sms.fprm |
SMS.FPRM |
1 / 53 |
|
|
find language module |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
0 or language code |
|
|
|
D2 |
0 or motorcar label |
|
|
|
D3 |
Group | Module Type |
|
|
NOERR
This trap is described as to finding the language module conformant to
the passed parameters, while mentioning nothing about any return values.
It is probably meant to activate a certain module as the currently "preferred
module"(?).
sms.schp |
SMS.SCHP |
1 / 56 |
|
|
partially deallocate reserved memory |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
new size |
D1 |
remaining size |
|
D2 |
0 or motor car label |
|
|
|
D3 |
Group | Module Type |
|
|
|
A0 |
base address |
A0 |
unchanged base address |
ERR.NJ if the owner job doesn't exist (any more).
sms.sevt |
SMS.SEVT |
1 / 58 |
|
|
send an "event" to a Job |
sms.wevt |
SMS.WEVT |
1 / 59 |
|
|
wait for an "event" |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
destination job ID |
D1 |
allocated size |
|
D2 |
"events" |
D2 |
triggering "event" |
|
D3 |
time to wait |
|
|
SMS.SEVT:
D2 remains assigned, D3 not evaluated.
ERR.NJ if the owner job doesn't exist (any more).
SMS.WEVT:
NOERR
5.2.2 ** I/O Allocation Trap #2
ioa.open |
IO.OPEN |
2 / 1 |
|
|
open a Channel |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
Job ID |
D1 |
actual Job ID |
|
D3 |
Open type (re below.) |
D3 |
smashed |
|
|
|
D2 |
MGG: smashed |
|
A0 |
Ptr to channel name |
A0 |
channel ID |
|
|
|
A1 |
smashed |
No channel will be left open if an error occurs.
|
-6 |
ERR.NO |
open failed, too many channels |
|
-2 |
ERR.NJ |
|
|
-3 |
ERR.OM |
|
|
-7 |
ERR.NF |
name not found |
|
-8 |
ERR.EX |
file already exists |
|
-9 |
ERR.IU |
file or device in use |
|
-12 |
ERR.BN |
file or device name unusable |
OPEN type: |
|
|
|
|
0 |
OPEN |
old file or Device I/O |
|
1 |
OPEN_IN |
old file shared access |
|
2 |
OPEN_NEW |
new file I/O, TK MI |
|
3 |
OPEN_OVER |
new file, overwriting old, LV |
|
4 |
OPEN_DIR |
modify type of empty file to Directory, LV SM |
ioa.clos |
IO.CLOSE |
2 / 2 |
|
|
closing a Channel |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
A0 |
channel ID |
A0, A1 |
smashed |
NOERR
CLOSE always assumed successful.
ioa.frmt |
IO.FORMT |
2 / 3 |
|
|
Formatting a sectored storage medium |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
|
|
D1.W |
count of useable sectors |
|
|
|
D2.W |
count of all sectors |
|
A0 |
Ptr to Name |
A0, A1 |
smashed |
ERR.OM -3
ERR.FF -14 error on formatting
ERR.NF -7
ERR.IU -9
Channels open for direct access (TK2) are NOT protected to being formatted!
ioa.delf |
IO.DELET |
2 / 4 |
|
|
delete a File |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
some valid job ID |
D1, D3 |
smashed |
|
A0 |
Ptr to Filename |
A0-A2 |
smashed |
ERR.NO -6 too many channels open
ERR.OM -3
ERR.NF -7
ERR.BN -12
SQ only:
ioa.sown |
IOA.SOWN |
2 / 5 |
|
|
assign new channel owner |
|
|
|
|
|
|
IN: |
|
OUT: |
|
|
|
|
|
|
|
D1 |
job ID of new owner |
D1 |
smashed |
|
A0 |
channel ID |
|
|
ERR.NJ owner job not valid
ERR.NO channel ID not valid