File: stack.t2

For general comments see here
LineAddressObject Code LabelF1N1BF2N2CommentsCheck
1 0  ; tape1.d/stack.t2
2 0  ;-----------------
3 0  ; addtodic
4 0  ; add item to dictionary
5 0  ;
6 0  stack::; 
7 0  ;
8 0  =1287 
9 1287  ;
10 1287  addtodic.ent:; 
11 1287 0010702400000 o00 dicpt/sto 0;store in list @1287
12 1288 0040000 o02 0   ;=1
13 1288+0762160 o37 dicpt   ;decrement pointer
14 1289 1002416 jmp .1294   ; @1289
15 1289+ ;
16 1289+ ; test for overlap between stack and list
17 1289+1022413.1289P:jn .1291   ;test for out of space
18 1290  .ret:ret     ;OK, return @1290
18+11290 0012033000001 o00 stack.lnk/jmp 1 
19 1291  ;; out of free space, abort compilation
20 1291  ;
21 1291  .1291:call     ;call 1070 - report oflo
21+11291 7306145002056 lnk L1070.lnk:jmp L1070.ent 
22 1292 1002412 jmp .ret   ;return @1292
23 1292+ ;
24 1292+0000000 o00 0   ;no-op
25 1293  ;
26 1293  ; stack - add a word to the stack, increment stkp and check for overflow
27 1293  ;
28 1293  stack.ent:; 
29 1293 2210646377777 inc stkp/sto -1;store word @1293
30 1294 0602160.1294:lod dicpt   ;stack limit @1294
31 1294+ ; from 2572+
32 1294+0124336.test:sub K5b   ;=5 allowance - elbow room!
33 1295 0122151 sub stkp   ;stack ptr @1295
34 1295+1102411 jmp .1289P   ;test and return if OK
35 1296  ;---------------------------------------------------------------------
36 1296  =2570 
37 2570  ;
38 2570  ; push - add item to forward stack
39 2570  ;
40 2570  ;
41 2570  push.ent:; 
42 2570 2210646337777 inc stkp/stc -1; @2570
43 2571 0104766 add push.lnk   ; return address
44 2571+ StkCheck:; 
45 2571+ .2571P:; 
46 2571+0342406 stc stack.lnk   ; store for return
47 2572 0104304 add constptr   ; @2572
48 2572+1102416 jmp stack.test   ; check for oflo
49 2573  ;--------------------------------------------------------------------
50 2573  ; pop top stack element (A), pop return address to lnk,
51 2573  ; push A, return via lnk
52 2573  ;
53 2573  =2619 
54 2619  ;L2619:
55 2619  Pop1:; 
56 2619 0040000.pop1:o02 0   ;=1
57 2619+0562151 o27 stkp   ;decrement stack ptr
58 2620 0010646600000 o00 stkp/lod 0;get return value @2620
59 2621 0010646177777 o00 stkp/exa -1;get return address
60 2622 2023733000001 sto term.lnk/jmp 1;return @2622
61 2623  ;------------------------------------------------------