chiark / gitweb /
Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sail / _sh / anchor
1 ;
2 ; anchor.sh
3 ;
4 ; Layout of anchor blocks
5 ;
6 ; © 1995 Straylight
7 ;
8
9                 [       :LNOT::DEF:anchor__dfn
10                 GBLL    anchor__dfn
11
12                 ; --- Anchor block contents ---
13
14                 ^       0,R12
15
16 tsc_R13         #       4                       ;Saved R13 (stack pointer)
17 tsc_anchor      #       4                       ;Pointer to block anchor
18 tsc_scSize      #       4                       ;Size of script file
19 tsc_tokAnchor   #       4                       ;Ptr to tokenised file anchor
20 tsc_currAnchor  #       4                       ;Current anchor for input
21 tsc_oldAnchor   #       4                       ;Previous anchor for input
22 tsc_flags       #       4                       ;A nice flags word
23 tsc_timeOff     #       4                       ;OS_ReadMonotonicTime-TIME
24 tsc_line        #       4                       ;Current line number
25 tsc_timeSoFar   #       4                       ;Time execution started
26 tsc_rndSeed     #       8                       ;Random number seed
27 tsc_rmaList     #       4                       ;List of blocks from RMA
28 tsc_spool       #       4                       ;File handle for SPOOL
29 tsc_files       #       32                      ;Files-open flags
30 tsc_errorS      #       4                       ;Offset of ERROR$
31
32                 ; --- Newline characters ---
33
34 tsc_rnewline    #       4                       ;Offset of rnewline string
35 tsc_lnewline    #       4                       ;Offset of lnewline string
36
37                 ; --- DATA information ---
38
39 tsc_dataPtr     #       4                       ;Current DATA pointer
40 tsc_dataLine    #       4                       ;Current data line
41
42                 ; --- WATCHFOR data ---
43
44 tsc_wForState   #       4                       ;Current state of watchfor
45 tsc_wForNumber  #       4                       ;Number we are looking for
46 tsc_wForStrings #       32*8                    ;A word+byte for each lvalue
47
48                 ; --- Resizing blocks ---
49
50 tsc_rszBlocks   #       0
51
52 tsc_varTree     #       4                       ;The variable stack anchor
53 tsc_varPtr      #       4                       ;Where to create the next var
54 tsc_varSize     #       4                       ;Current size if the stack
55
56 tsc_execStack   #       4                       ;Anchor of execution stack
57 tsc_execStkPtr  #       4                       ;Pointer into stack
58 tsc_execStkSize #       4                       ;Size of the stack
59
60 tsc_opStack     #       4                       ;Anchor of execution stack
61 tsc_opStkPtr    #       4                       ;Pointer into stack
62 tsc_opStkSize   #       4                       ;Size of the stack
63
64 tsc_calcStack   #       4                       ;Anchor of execution stack
65 tsc_calcStkPtr  #       4                       ;Pointer into stack
66 tsc_calcStkSize #       4                       ;Size of the stack
67
68 tsc_stracc      #       4                       ;Anchor of execution stack
69 tsc_straccPtr   #       4                       ;Pointer into stack
70 tsc_straccSize  #       4                       ;Size of the stack
71
72 tsc_bucket      #       4                       ;String bucket anchor
73 tsc_bktPtr      #       4                       ;Free pointer for bucket
74 tsc_bktSize     #       4                       ;Current size of bucket block
75
76 tsc_erszBlocks  #       0
77
78 tsc_misc        #       256                     ;A big buffer for things
79
80 tsc_blkSize     EQU     2048                    ;Enough space for a stack
81
82                 [       {VAR}-tsc_R13+1024>tsc_blkSize
83                 !       1,"tsc_blkSize is too small"
84                 ]
85
86 tscFlag_nl      EQU     (1<<0)                  ;We have just read a newline
87
88 tscFlag_echoRL  EQU     (1<<1)                  ;Echo remote input locally
89 tscFlag_echoRR  EQU     (1<<2)                  ;Echo remote input remotely
90 tscFlag_echoLL  EQU     (1<<3)                  ;Echo local input locally
91 tscFlag_echoLR  EQU     (1<<4)                  ;Echo local input remotely
92 tscFlag_watch   EQU     (1<<5)                  ;We are doing a watchfor
93 tscFlag_error   EQU     (1<<6)                  ;We are generating errors
94
95                 ]
96
97 ;----- That's all, folks ----------------------------------------------------
98
99                 END