; ****************************************************************** ; ***** ***** ; ***** Telesoftware code - 16/7/1984 ***** ; ***** ***** ; ***** Version history ***** ; ***** V1.00 BBC assembler release version ***** ; ***** V1.01 MASM version of 1.00 - identical code ***** ; ***** V1.02 TH added *LOAD patch to rom + small changes ***** ; ***** V1.03 GT corrected use of zero-page for ADFS 13 Oct 84 ***** ; ***** ***** ; ****************************************************************** ; ZPER * &BC ; *** Tim *** Was &BE ; zero page - first two bytes temporary LPER * &E00 ATPER * 0 ; This indicates the end of our workspace - dummy value ; until defined by RTF KPER * phex ; ; ; File - DEC1 Initial constants and manifests ; ; ; offsets in control block ; hold * 2 upda00 * 3 incons * 4 full * 5 crcpre * 6 crcok * 7 specia * 8 inuse * 9 ; 0,1 are pointers. CBlen * 10 ; offsets in page image ; pagehe * 2 pageju * 8 ; general bits & pieces flagbi * &40 TIM01 * 191 ; Must be changed if flagbi changes :- ; changed to: (NOT flagbi) AND &FF ; offsets on headbu groupA * 6 groupB * 7 nopage * 255/CBlen ; header flags magser * 1 suphea * 2 intseq * 4 inhibd * 8 newsfl * 16 subtit * 32 update * &40 eraseF * &80 ; ; ******** OS entry points ********** ; ourosw * &7A ; ; Our osword number ; osbyte * &FFF4 osword * &FFF1 oswrch * &FFEE osrdch * &FFE0 osargs * &FFDA osnewl * &FFE7 getbyt * &FFD7 osasci * &FFE3 oscli * &FFF7 osfile * &FFDD fscmdv * &21E ; ; ********* Sideways reason codes ********** ; swfixe * 1 ; offer fixed allocation swpriv * 2 ; offer private allocation swboot * 3 ; offer boot swcmd * 4 ; offer command swint * 5 ; offer interr swbrk * 6 ; offer BRK swosby * 7 ; offer spare FX swoswo * 8 ; offer spare OSWORD swrelf * &0D ; release fixed workspace swclai * &0E ; claim fixed workspace swstar * &12 ; ; Start specified filing system ; ********** Decoder hardware Addresses *********** ; ctrlre * &FC10 stat00 * &FC10 rowreg * &FC11 datare * &FC12 status * &FC13 TR3STA * &FEE4 ; *** Tim *** TR3DAT * TR3STA+1 ; | tube * &406 ; | identi * 1 ; *** Tim *** Tube id ; ; ZPER HOLDS NEXT FREE ZERO PAGE ; ** NB Currently, the first two are in the temporary area ** ; ;dmazp0 * &80 ; Tempory ;dmazp1 * &81 ; Tempory ;dmazp2 * &82 ; Tempory ;dmazp3 * &83 ; Tempory ; zp0 * ZPER ; ^BC zp1 * zp0+1 ; ^BD swzp0 * zp1+1 ; ^BE *** It is VITAL that these two are NOT swzp1 * swzp0+1 ; ^BF in permanent filing-system zero-page dmazp0 * swzp1+1 ; *** Tim *** dmazp1 * dmazp0+1 ; | dmazp2 * dmazp1+1 ; | 4 byte address for tube dmazp3 * dmazp2+1 ; | intzp0 * dmazp3+1 ; | intzp1 * intzp0+1 ZPER2 * intzp1+1 ; *** Tim *** Changed from dmazp1+1 ; ; *** Tim *** Zero-page for *LOAD patch temp * &B0 ; | from * temp ; | cb * temp+4 ; | scratc * temp ; OVERLAY cblow * cb ; | scra00 * temp+1 ; OVERLAY cbhigh * cb+1 ; | count * cb+2 ; | TTEMP * count+2 ; | TTEMP2 * TTEMP+2 ; | ; ; Fixed data area - vectors, pointers & minimum buffer allocation ; ; ******************* Description of control blocks ********************** ; ;Page control blocks pointing to each of the page buffers ;which could exist. Status indicates memory allocated/in use. ;These are kept in order of priority by the store manager ;in files DEC3 & DEC5 which implement chaining, branching & CRC checks ; ;***** PAGE CONTROL BLOCK FORMAT ***** ;A page control block is an internal data structure ;to the teletext system. It consists of a two byte pointer to where ;the page requested by the block is to be stored, ;and flags which detail the state of that page. ; To compress data, the flags are stored in the same ;bytes as the number of the requested page. ;This is possible because page no. digits never use more ;than 4 bits, leaving the other 4 for other uses. ;In practice, the top bit is used as a 'Wildcard' bit, and the next-to-top ;bit as a flag bit. This simplifies testing. ; ; The flags used are ; ; Full ; Set whenever the page is filled. ; Does not mean that the data is valid, ; -- see 'incons' ; ; Updated ;Also set whenever the page is filled. ; May however be cleared by the user ; to ensure that the latest copy of ; a page is captured. ; ; Inconsistent ; A page is currently ; rolling in for this request. ; Does not imply either full or empty. ; ; Hold ; 'Do not allow this page to become ; incons again once it has ; next been made consistent.' ; Crcpresent ; ; false=> CRC absent or not yet computed. ; true => CRC was transmitted. ; ; Crcok ; false=> CRC wrong or not yet computed. ; true => CRC correct or not transmitted. ; ; ***NOTE That the combination of CRCpresent=false ; and CRCok=false is invali, ; (an absent CRC is defined as being OK!) ; -- so this is used as an internal ; flag in the interrroutine ; to denote 'CRC not yet computed' ; ; Special page ; This page should be kept ; up to date in case it is re-select. (The KEEP feature) ; In later issues of thissoftware, ; these control-blocks will be used ; to implement multiple request ; should the machine be used ; as a teletext server in a network. ; ; Finally, ; Inuse ; Currently control blocks are stored in ; a fixed-size array. Eventually, they ; will be in a linked-list structure. ; The inuse bit temporarily serves to ; mark an element of the array as being valid. ; ; ****NOTE Chained and linked pages ; can be requested by the system ; (pre-fetching before the user requests it) ; but the control blocks holding the ; request may be pre-empted by a 'special page' request. ; Pages without the Specialpage bit (excepting the Currentpage) ; must therefor be considered 'hints' ; to the system and not definite request. ; ; ;[specias may be referred to in the code as 'Hermannpages' in deference ; to their instigator.] ; ; ; The current page is indexed by variable 'select' ; In the linked list version, the current ; page will be the one at the head of the list. ; ; Rolling headers are displaed for the magazine corresponding ; to the current page (i.e.'select') ; A wild-card magazine displas all headers ; ; Bytes 0&1 - Pointer to data area. ; ; ** Page number ** ; Byte 2 - Magazine no. Bit 7 = 1 for wildca ; Bytes 3&4 - "Page" no. Wildcard as above. ; Bytes 5-9 - Subcode. Wildcard as above. ; ; ******** FORMAT OF A PAGE BUFFER ******** ; ; Currently, one page is allocated in fixed space by the system; ; When multiple requests are made the user ; should supply the space to store the page ;This feature is not yet finalised. ; ; Byte 0 - Maximum number of rows (Rows 0-23 stored in order, ; other rows stored on the end as they arrive) ; Byte 1 - Slot number of next high-row spare space. ; Or pointer to row beyond last row when full ; ;This is followed by a number of rows in the format - ;Byte 0 - Row number (decode - i.e. straight binary, not Hammed) ; This byte is left set to &FF to indicate a line which ; was not transmitted. The Erase page bit clears all of them. ;Bytes 1,2 - spare ;Bytes 3-7 - Also spare. Will eventually (Soon?) be removed. ; All set to &FF indicates CRC O.K. ;Bytes 8-47 - Teletext data ; {data area declared later so that it gets into the area which is ; saved when the FS workspace is claimed from us. Label is } ; ; These variables are temporary and are not saved in private space ; Interrupt routine variables first ; ^ LPER headbu # 8 intscr # 1 ints00 # 1 CurCB # 1 thisro # 1 thisma # 1 thispa # 6 thishe # 1 rowcnt # 1 magptr # 8 dmascr # 1 CurCB2 # 1 timewo # 2 timebl # 16 ; declarations for MJD code leap # 1 yeard # 2 month # 1 year # 2 subtra # 3 ARGcon # 16 param # 8 ARGtst # 1 ARGerr # 1 errors # 1 erro00 # 1 tests # 1 tests1 # 1 errcnt # 1 tsts # 1 grains # 1 length # 1 TSbuff # 40 crcofs # 1 crcrow # 1 crclow # 1 crchig # 1 redc01 # 1 redc00 # 1 redcod # 2 correc # 2 ; ; ; The following workspace must be preserved in private space when ; the fixed space is claimed ; starts # 0 oldctr # 1 currow # 1 curofs # 1 sonrow # 1 sonofs # 1 sobrow # 1 sobofs # 1 eobrow # 1 eobofs # 1 CBswit # 1 CRCsig # 1 prevla # 1 prevfs # 1 select # 1 head00 # 2 eof0E # 1 eof0F # 1 ; ctrlbl # nopage*CBlen ; ; Following taken from RTF code ; lonety # &100 lonelo # &100 lonehi # &100 esctyp # &100 esclo # &100 eschi # &100 stackb # &7F stackt # 1 GPER # &80 lospac # &2FF hispac # 1 lowest # 4 ; *** Tim *** Used by *LOAD and *RUN DPER # 0 ; ; ; Memory area for page control blocks ; ; endsav * DPER ; D% set in TLINK to the end value of L% ie end of ; telesoftware workspace endfix * DPER ; end of workspace is same as end of area to save ; LNK DEC2