back : next : content =
(Just characters displaying browsers, "Lynx" etc, might not show the tables properly)
(Lynx u.a. Browser, die nur Schriftzeichen darstellen, geben u.U. die Tabllen verzogen wieder)

 

5 *** System Calls

The tables to follow contain the minimum information that is required. Most of the calls have something in common which will be explained here, and NOT REPEATED any more.
 

 

5.1 **

5.1.1

Commonly used abbreviations:
RI.. reference to the virtual arithmetik processor
Hash the "#" character
MI (any version of) MINERVA
TG the "Thing Sytem"
SBasic the "SuperBASIC" of the Sinclair QL Personal Computer
SMS SMS2, SMSQ, SMSQ/E, and Atari-E software
SQ any versions of SMSQ, SMSQ/E, and probably of SMS2 
 
Register Values
are all 32-Bit unsigned entities, if not mentioned otherwise.

Register A1
Depending on the particular ROM version A1 should (always) be set to an even value, regardless of its use being specified, at least where it can be returned changed, somehow: Some system routines which are common to several trap calls use that register to reading data, whether they will be used or not, and thus could end up in an address error, otherwise.

Address rel(A6)
This notice belongs to the SBasic related routines, where many addresses are relative to the base register A6 of the job. An effective address must not be calculated by adding A6 to the reference, as any SBasic job may be moved at any time, not pre-determinably. The only exception would be in the "supervisor mode", where the job scheduler, and thus all multi-tasking(!), is halted.

Register A6
Usually some system reference which should not be altered.

Registers not mentioned in the tables are don't care values on input, and remain unchanged on output.

Additional information will be given if appropriate, e.g. the meaning of an error code being non-standard, or on special conventions of usage.
 

Sample QDOS-trap table:
 
{smsq-name} {QDOS-NAME} {Trap/Opcode}  
  Short description, remarks on usage.
  IN:   OUT:  
  D1 Input values D1 Output values
 

NOERR if no error code returned,
ERR.BP, etc, D0 error codes, otherwise
 
Sample QDOS-vector table:
 
{smsq-name} {QDOS-NAME} {Type} {decimal $sedecimal address} 
  Short description, remarks on usage.
  IN:   OUT:  
  D1 Input values D1 Output values
 
 


 
Standard Message coding (JS):
 
 
SMS CODE QDOS-Name Text 
err.nc -1 ERR.NC not complete
err.ijob -2 ERR.NJ invalid  job
err.imem -3 ERR.OM out of memory
rr.ornge -4 ERR.OR out of range
err.bffl -5 ERR.BO buffer full
err.ichn -6 ERR.NO channel not open
err.fdnf -7 ERR.NF not found
err.itnf -7
err.fex -8 ERR.EX altready exists
err.fdiu -9 ERR.IU  in use
err.eof -10 ERR.EF end of file
err.drfl -11 ERR.DF drive full
err.inam -12 ERR.BN bad name
err.trns -13 ERR.TE Xmit (transmission) error
err.prty -13
err.fmtf -14 ERR.FF format failed
err.ipar -15 ERR.BP bad parameter
err.mchk -16  ERR.FE bad or changed medium
err.iexp -17 ERR.XP error in expression
err.ovfl -18  ERR.OV (arithmetic) overflow
err.nimp -19 ERR.NI  not implemented
err.rdo -20 ERR.RO read only
err.isyn -21 ERR.BL bad line
 
System Messages {JS}    
-22 At line
err.rwf -22 SQ only {15} r/w error 
-23  sectors
-24 F1...monitor 
F2...TV
-25  © 1983 Sinclair Research Ltd
-26 during WHEN Processing
-27 PROC/FN cleared
 
Systemmeldungen {MGG}    
-22 "in Zeile"
-23 "Sektoren"
-24 "F1... F2...
-25 "Sinclair ...
-26 "Verarbeitung läuft"
-27 "Proc/Fn gelöscht"
 
NOERR if no message code specified.
 



 

5.1.2.1 *  QDOS-Traps

 

Common:
 
IN:

D0 op-code
D1 job-ID, -1 can be specified for the current job.
D2 data
D3 data; timeout.w for all trap #3 calls
A0 address, ptr or channel-ID (for all trap #3 calls)
A1 ptr, address
A2 ptr, address
 
OUT:
D0 -ve error code, or 0
D1 job-ID (Manager traps)
D2 usually unchanged
D3 usually unchanged, return values on some Manager traps
A0 data, unchanged channel ID after trap #3 calls
A1 address, updated ptr
A2 sometimes an address
 
ERR.BP -15
can be returned by any call, and will be, if the trap operation was not known.
 
ERR.NO -6 channel not open
can be returned by any routine working on a channel.
 
 

5.1.2.2 *  Pointer-Traps

This is a group of additional trap #3 operations which extend the CON-/SCR-handler.
 
 Abbreviations used throughout this part of the book:
OL Outline
PE Pointer Environment
PIF Pointer Interface
PRW Primary Window
SCW Secondary Window 
SW Sub-Window, a window within the "outline" area
{value} | {value} "upper" and "lower" half of a longword
Screen... data w.r.t. the physical screen sizes 
width a 16-bit number, +ve and non-zero
heigth, size dto.
Pointer a small picture on screen pointing to the cursor position
Ptr an address of an address
Point a pair of co-ordinates of 16-bit numbers
Origin the top left "point"
value a 16-bit 2's complement signed binary number
 
 

5.1.3 *  QDOS-Vectors

 
The QDOS vectors are "word" sized, (signed) 16-bit pointers read from a table at low memory.
Those that are fetched from addresses $0124 and higher require to be offset by $4000.
 
sm : Supervisor Routines
To be executed in the processors "supervisor mode", only, and not from within an interrupt service.
A6 should point to the base of system variables.
st : Simplified Trap Calls
"User mode", only.
gu : General Utilities
No restrictions.
bu : SBasic Utilities
No restrictions, addresses always rel(A6).
SQ: will only execute if "SBAS" found at -4(A6).
bp : SBasic Parameter
- as bu -
ar : Arithmetics
- as bu -
SQ: without the silly "SBAS" restriction -
md : Microdrives
Supervisor only, interrupts off.
SQ: MDV routines not accessible.
 
D0 and the corresponding processor flags will usually be set on return, if not mentioned otherwise.
 
 

5.2 ** QDOS-Traps

Qdos-Names and OP-Codes:
 
FS.CHECK 064 $40    IOP..REH 001 $01    MT.JINF 002 $02    sd.dot 056 $38
FS.DATE 076 $4C    IOP..REW -01 $FF    MT.LDD 034 $22    SD.ELIPS 051 $33
FS.FLUSH 065 $41    IOP..SCN 031 $1F    MT.LIOD 032 $20    SD.EXTOP 009 $09
FS.HEADR 071 $47    IOP..SDR 017 $11    MT.LNKFR 013 $0D    SD.FILL 046 $2E
FS.HEADS 070 $46    IOP..SET 000 $00    MT.LPOLL 028 $1C    SD.FLOOD 053 $35
FS.LOAD 072 $48    IOP..SLR 018 $12    MT.LSCHD 030 $1E    SD.FOUNT 037 $25
FS.MDINF 069 $45    IOP..SSC 019 $13    MT.LXINT 026 $1A    SD.GCUR 054 $36
FS.MKDR 077 $4D    IOP.FILM 120 $78    MT.NIX 037 $25    sd.lin 057 $39
FS.POSAB 066 $42    IOP.FLIM 108 $6C    MT.PRIOR 011 $0B    SD.LINE 049 $31
FS.POSRE 067 $43    IOP.LBLB 116 $74    MT.RCLCK 019 $13    SD.NCOL 020 $14
FS.POSV 068 $44    IOP.OUTL 122 $7A    MT.RDD 035 $23    SD.NL 018 $12
FS.RENAME 074 $4A    IOP.PICK 124 $7C    MT.REBAS 023 $17    SD.NROW 022 $16
FS.SAVE 073 $49    IOP.RPTR 112 $70    MT.RECHP 025 $19    SD.PAN 027 $1B
FS.TRUNC 075 $4B    IOP.RPXL 113 $71    MT.RELJB 009 $09    SD.PANLN 030 $1E
FS.VERS 078 $4E    IOP.RSPW 110 $6E    MT.RERES 015 $0F    SD.PANRT 031 $1F
FS.XINF 079 $4F    IOP.SLNK 111 $6F    MT.RIOD 033 $21    SD.PCOL 019 $13
IO.CLOSE 002 $02    IOP.SPRY 119 $77    MT.RJOB 004 $04    SD.PIXP 023 $17
IO.DELET 004 $04    IOP.SPTR 123 $7B    MT.RPOLL 029 $1D    SD.POINT 048 $30
IO.DIR 004 $04    IOP.SVPW 109 $6D    MT.RSCHD 031 $1F    SD.POS 016 $10
IO.EDLIN 004 $04    IOP.SWDF 126 $7E    MT.RXINT 027 $1B    SD.PROW 021 $15
IO.FBYTE 001 $01    IOP.WBLB 115 $73    MT.SCLCK 020 $14    SD.PXENQ 010 $0A
IO.FLINE 002 $02    IOP.WRST 127 $7F    MT.SUSJB 008 $08    SD.RECOL 038 $26
IO.FORMT 003 $03    IOP.WSPT 118 $76    MT.TRA 036 $24    sd.rop 055 $37
IO.FSTRG 003 $03    MT.ACLCK 021 $15    MT.TRAPV 007 $07    SD.SCALE 052 $34
IO.NEW 002 $02    MT.ACTIV 010 $0A    SD.ARC 050 $32    SD.SCRBT 026 $1A
IO.OLD 000 $00    MT.ALBAS 022 $16    SD.BLOK 046 $2E    SD.SCROL 024 $18
IO.OPEN 001 $01    MT.ALCHP 024 $18    SD.BORDR 012 $0C    SD.SCRTP 025 $19
IO.OVERW 003 $03    MT.ALLOC 012 $0C    SD.CHENQ 011 $0B    SD.SETFL 042 $2A
IO.PEND 000 $00    MT.ALRES 014 $0E    SD.CLEAR 032 $20    SD.SETIN 041 $29
IO.SBYTE 005 $05    MT.BAUD 018 $12    SD.CLRBT 034 $22    SD.SETMD 044 $2C
IO.SHARE 001 $01    MT.CJOB 001 $01    SD.CLRLN 035 $23    SD.SETPA 039 $27
IO.SSTRG 007 $07    MT.CNTRY 036 $24    SD.CLRRT 036 $24    SD.SETST 040 $28
IOP..ABS 000 $00    MT.DMODE 016 $10    SD.CLRTP 033 $21    SD.SETSZ 045 $2D
IOP..BOT -01 $FF    MT.FREE 006 $06    SD.CURE 014 $0E    SD.SETUL 043 $2B
IOP..GCL 016 $10    MT.FRJOB 005 $05    SD.CURS 015 $0F    SD.TAB 017 $11
IOP..MOV 001 $01    MT.INF 000 $00    SD.DONL 047 $2F    SD.WDEF 013 $0D
IOP..NLK -02 $FE    MT.IPCOM 017 $11    SD.DOT 048 $30    SMS.NTHU 044 $2C
 
Names beginning "MT..." are of Trap #1.
IO.OPEN. IO.CLOSE, IO.FORMT, IO.DELET are of Trap #2,
the rest belongs to Trap #3.
 
 
 

SMS-Names and OP-Codes:
 
ioa.clos 002 $02    iog.fill 053 $35    iopp.nlk -02 $FE    iow.xtop 009 $09
ioa.delf 004 $04    iog.line 049 $31    iops.abs 000 $00    sms.achp 024 $18
ioa.frmt 003 $03    iog.scal 052 $34    iops.reh 001 $01    sms.acjb 010 $0A
ioa.kdir 004 $04    iog.sgcr 054 $36    iops.rew -01 $FF    sms.alhp 012 $0C
ioa.kexc 000 $00    ioi.blkl 100 $64    iow.blok 046 $2E    sms.ampa 022 $16
ioa.knew 002 $02    ioi_allc 030 $1E    iow.chrq 011 $0B    sms.arpa 014 $0E
ioa.kovr 003 $03    ioi_dnam 022 $16    iow.clra 032 $20    sms.artc 021 $15
ioa.krnm 005 $05    ioi_dnum 028 $1C    iow.clrb 034 $22    sms.comm 018 $12
ioa.kshr 001 $01    ioi_free 036 $24    iow.clrl 035 $23    sms.crjb 001 $01
ioa.open 001 $01    ioi_hdrl 040 $28    iow.clrr 036 $24    sms.dmod 016 $10
iob.elin 004 $04    ioi_name 000 $00    iow.clrt 033 $21    sms.exv 007 $07
iob.fbyt 001 $01    ioi_rdon 029 $1D    iow.dcur 015 $0F    sms.frjb 005 $05
iob.flin 002 $02    ioi_totl 032 $20    iow.defb 012 $0C    sms.frtp 006 $06
iob.fmul 003 $03    ioi_xxxx 044 $2C    iow.defw 013 $0D    sms.fthg 041 $29
iob.sbyt 005 $05    iop..gcl 016 $10    iow.donl 047 $2F    sms.hdop 017 $11
iob.smul 007 $07    iop..scn 031 $1F    iow.ecur 014 $0E    sms.info 000 $00
iob.test 000 $00    iop..sdr 017 $11    iow.font 037 $25    sms.injb 002 $02
iof.chek 064 $40    iop..slr 018 $12    iow.ncol 020 $14    sms.lexi 026 $1A
iof.date 076 $4C    iop..ssc 019 $13    iow.newl 018 $12    sms.lfsd 034 $22
iof.flsh 065 $41    iop.film 120 $78    iow.nrow 022 $16    sms.liod 032 $20
iof.load 072 $48    iop.flim 108 $6C    iow.pana 027 $1B    sms.lpol 028 $1C
iof.minf 069 $45    iop.lblb 116 $74    iow.panl 030 $1E    sms.lshd 030 $1E
iof.mkdr 077 $4D    iop.outl 122 $7A    iow.panr 031 $1F    sms.lthg 038 $26
iof.posa 066 $42    iop.pick 124 $7C    iow.pcol 019 $13    sms.rchp 025 $19
iof.posr 067 $43    iop.pinf 112 $70    iow.pixq 010 $0A    sms.rehp 013 $0D
iof.posv 068 $44    iop.rptr 113 $71    iow.prow 021 $15    sms.rexi 027 $1B
iof.rhdr 071 $47    iop.rpxl 114 $72    iow.rclr 038 $26    sms.rfsd 035 $23
iof.rnam 074 $4A    iop.rspw 110 $6E    iow.scol 017 $11    sms.riod 033 $21
iof.save 073 $49    iop.slnk 111 $6F    iow.scra 024 $18    sms.rmjb 004 $04
iof.shdr 070 $46    iop.spry 119 $77    iow.scrb 026 $1A    sms.rmpa 023 $17
iof.trnc 075 $4B    iop.sptr 123 $7B    iow.scrt 025 $19    sms.rpol 029 $1D
iof.vers 078 $4E    iop.svpw 109 $6D    iow.scur 016 $10    sms.rrtc 019 $13
iof.xinf 079 $4F    iop.swdf 125 $7D    iow.sfla 042 $2A    sms.rshd 031 $1F
iofd.bak 002 $02    iop.wblb 115 $73    iow.sink 041 $29    sms.rthg 039 $27
iofd.cur 000 $00    iop.wrst 127 $7F    iow.sova 044 $2C    sms.spjb 011 $0B
iofd.get -01 $FF    iop.wsav 126 $7E    iow.spap 039 $27    sms.srtc 020 $14
iofd.upd 000 $00    iop.wspt 118 $76    iow.spix 023 $17    sms.ssjb 008 $08
iog.arc 050 $32    iopo.mov 001 $01    iow.ssiz 045 $2D    sms.usjb 009 $09
iog.dot 048 $30    iopo.set 000 $00    iow.sstr 040 $28    sms.uthg 040 $28
iog.elip 051 $33    iopp.bot -01 $FF    iow.sula 043 $2B    sms.zthg 042 $2A
 
Names beginning "sms..." are of Trap #1.
"ioa..." names are of Trap #2,
the rest belongs to Trap #3.

 
 


  top : back : next : content 

(count)