* simser * STX/SRX-Erweiterung f‡r den Sinclair QL * .hpr * 1.3.1997 * H.-Peter Recktenwald, Tel: +49 30 8520413, email: phpr@berlin.snafu.de SIMple SER-extension Copyright (C) 1997 by H.-Peter Recktenwald, Berlin. - English desription below - SIMSER ist eine einfache SER-Erg€nzung um f‡r denselben SER-Anschluœ gleichzeitig verwendbare getrennte Kan€le f‡r Sendung und Empfang. Sie dient auœerdem im QL dem sicheren Umgang mit den Schnittstellen bei Nutzung desselben QDOS-Kanals aus verschiedenen Jobs, wo es sonst u.U. zu unl„sbarer gegenseitiger Verriegelung kommen kann. Weiter soll sie Compatibilit€t zwischen dem Schwarzen QL (sowie dem SMSQ der QXL) und SMSQ/E schaffen helfen. Von den Sonderheiten der SMSQ/E-Definition wird die M„glichkeit der f‡r ausw€hlbare Kan€le vom aktuellen TRA-Zustand unabh€ngigen Zeichenumsetzungsfreigabe auch im QL unterst‡tzt. Die Erweiterung ist frei zur beliebigen Verwendung und Weitergabe, so dies kostenlos geschieht und Code wie Text, bei eigener Bearbeitung ggf. zus€tzlich, unver€ndert und kostenlos mitgegeben werden. Ausf‡hrliche Beschreibung in "SIMSER_TXT". * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * SIMSER is an extension to the SER devices of the QL (and SMSQ of the QXL) facilitating one-directional serial channels which can be used simultaneously in pairs of opposite directions, each, to the same port. It further was made to circumvent certain QDOS specific peculiarities and to achieve a sufficient degree of compatibility to the more elaborate SMSQ/E version. The new definition comes to effect with port numbers 1 and 2, only, supporting non-standard ports (numbers above 2, up to 8) unmodified. The ports 1 and 2 can be opened as SER bi-directional SRX receiving STX sending with the standard QL parameters, plus D or T, supporting (the single) one useful and properly working extra feature of the SMSQ/E versions: D always working with no TRA character translation T always working with character translation, as set by the TRA command (or by the QDOS-Trap MT.TRA), and not changing until the channel is closed. Channels opened with one of the above parameters will always translate, or not, corresponding to the parameter passed, independent of the actual global setting. Channels opened with no translation parameter depend on the current state, as known from the usual QL standard SERial channels. Passing a different translation table to the system (by QDOS-Trap or by the TRA command) does not change the tables of currently open channels of the "T"-specification (additionally, not an SMSQ/E feature). Until now this will not work with pre-JS-roms due to system limitations. An additional integer parameter can be passed to extend the channel definition table for user defined data structures: _number a number in the range of 1 to 32767 will be taken as an eighth of the channel definition table extending length, resulting in up to 255K bytes, which should be sufficient space for any additional buffering and data storage and can be used via the QDOS-trap - re below. Any other parameters, valid for the SMSQ/E versions, will be accepted error free but, just discarded with no influence at all. STX1HT_1024 opens a transmitter to port no. 1, handshake enabled, always character translating, with an additional amount of 8K bytes cdt memory space. Any type of channels will further be protected against multiple access occuring at the same time from different jobs to the same channel, where the standard QL channels could lock eachother, unrecoverably. Another effect of this protection is inhibiting the (quite inadeqate!) forced "dynamic" multiple channels buffering in the SMSomething systems. Additional QDOS-traps, supported for STX-type channels: IOB.SUML (SMSQ/E) redirected to always TRA-disabled IO.SSTRG. SD.EXTOP user defined handler routine. SD.TAB , sending the single byte 9. SD.NL , 10 SD.PCOL , 8 SD.NCOL , 32 SD.NROW , 13 SD.CLEAR , 12 Basic: CLS SD.CLRTP , 12 CLS 1 SD.CLRBT , 12 CLS 2 SD.FOUNT with A1 = A2 = ptr to character translation table; FS.TRUNC with D1 = D2 = -1 IPC-reset, re-opening currently receiving serial ports, and clearing the ports 1 and 2 receiving and sending buffers. SD.EXTOP special support: Register values on entry: D4.B channel type -2:STX -1:SER 1:SRX D5.B old TRA-state D7.W -1:Port 1, 0:Port 2 A0 primary cdt (channel definition table) A2 secondary cdt A3 primary handler base address A4 call address (which was passed as A2) A5 secondary handler base address Any registers may be used at will, A0 and A3 inclusive, there are no special requirements, with the single exception of D0: D0 should always return a negative error code, to prevent false actions on, e.g., an attempt to checking wether a channel is of the CON-/SCR-type. Thus, for safety, the internal procedures will set D0 to err.bp (-15) whenever the value returned after the call was not negative. The suggested OK-code is err.nc (-2), which is fast and easily checked, and may be expected regularly only after a call to IOP.PICK of the pointer interface (a non-standard extension to the CON-/SCR-device) with a false job identification. Device definition: Secondary device handler data, in at d16(A5): psgnm -36 .l signature "SRT%" pqlfl -24 .b flag 0 QL-hardware, IPC properly working psqfl -20 .b flag -1 SMSQ/E, 1 SMSQ, 0 otherwise pohnd -16 .l base address of the primary device handler poio -12 .l primary i/o-entry poopn -8 .l primary open poclo -4 .l primary close * one item each for up to 8 ports, counting from 0 on: psctyp 48 .b use-flag -2:srx 0:no channel 1:stx -1:bi-directional ptxfl 56 .b STX access flag, locked if bit 7 set prxfl 64 .b SRX access flag psefl 72 .b SER access flag prque 120 .l ptr to header of receiving queue psque 152 .l ptr to header of transmitting queue ptabl 256 - preliminary(!) end of handler definition table - NOTE: When in an SMSQ/E system the items & cannot be used reliably with SER-type (bi-directional) channels and any channels of ports above no. 2 due to those systems forced multiple channels buffering. Secondary channel definition table data, in at d16(A2): csport 24 port .w port no., 1..8 cspar 26 OEMS .w parity-code none: 0 O:2 E:4 M:6 S:8 cshs 28 IHX .w handshake none: 0 I:1 H:2 (X:3 no action) cstra 30 DT .w TRA system:-1 D:0 T:1 csprot 32 RCA .w protocol none: 0 R:1 C:2 (A:3 no action) csfz 34 FZ .w eof-coding none: 0 Z:2 (F:1 no action) csxcdt 36 num. .w 1/8 cdt extending length, or 0/-ve cstyp 40 type .b type -2:srx -1:ser 1:stx (working parameter) ; 41 .b type 1:SER 2:SRX 3:STX (prm from open call) csttb 46 .l ptr to own character TRAnslation table, or 0/-ve cscdt 50 .l ptr to primary cdt csrq 62 .l ptr to primary queue header, corresponding to the channels type SRX or STX; 0 for SER-type channels cscdtl 84 - end of cdt - optional cdt extension begins here - NOTEs: The Z option in SMSQ/E systems does not work as supposed due to false flag handling within that system, which is left to be fixed by those who are responsible. There is NO FREE SPACE within the definition tables of both, the channels and the handlers data blocks, items not listed above are used internally or might be used in a future extended version. USER DATA storage is provided for by the optional cdt extending parameter, eight times the number of bytes of which will be allocated additionally at - re above. For more detailed programmer's information, pse, send a notice to the author by e-mail: phpr@berlin.snafu.de, or, refer to the german text. » .hpr'97 » eof » .