.MAIN. MACRO V04.00 17-MAY-82 12:10:36 PAGE 1 1 68 69 70 71 72 73 000000 SEG:: ;## 1 # 0 ## PROCEDURE SEG,GLOBAL 74 000000 NUL = 0 ;## 2 # 0 ## NUL = 0 75 ; 76 ;called from fortran by the call 77 ; call seg (instring,outstring,from,to) 78 ; 79 ; where instring= the input string (which is not changed) 80 ; outstring= the output string to contain the 81 ; segment from the instring 82 ; from = pointer to first character of the segment 83 ; wanted 84 ; to = pointer to the last character of the segment 85 ; wanted. 86 ; 87 ; from must be <= to 88 ; 89 ; 90 000000 121527 000004 cmpb (R5),#4 ;## 18 # 0 ## IFB (R5) = #4 THEN; we have a legal list of arguments 91 000004 001402 bEQ ll$2 92 000006 000167 000062 jmp ll$1 93 000012 ll$2: 94 000012 005725 tst (5)+ ;## 19 # 1 ## PROBE (5)+; skip into argument list 95 000014 012500 mov (R5)+,R0 ;## 20 # 1 ## LET R0 := (R5)+; fetch instring address 96 000016 012501 mov (5)+,R1 ;## 21 # 1 ## LET R1 := (5)+; fetch outstring address 97 000020 013502 mov @(5)+,R2 ;## 22 # 1 ## LET R2 := @(5)+; fetch 'from' 98 000022 013503 mov @(5)+,R3 ;## 23 # 1 ## LET R3 := @(5)+; fetch 'to' 99 000024 020203 cmp R2,R3 ;## 24 # 1 ## IF R2 <= R3 THEN 100 000026 003402 bLE ll$4 101 000030 000167 000032 jmp ll$3 102 000034 ll$4: 103 000034 060002 add R0,R2 ;## 25 # 2 ## LET R2 := R2 + R0 - #1; add offsets to pointers 104 000036 005302 dec R2 105 000040 060003 add R0,R3 ;## 26 # 2 ## LET R3 := R3 + R0 - #1 106 000042 005303 dec R3 107 000044 ll$5: ;## 27 # 2 ## WHILE R2 <= R3 DO; shovel .... 108 000044 020203 cmp R2,R3 109 000046 003404 bLE ll$8 110 000050 000167 000000 jmp ll$7 111 000054 000167 000006 ll$7: jmp ll$6 112 000060 ll$8: 113 000060 112221 movb (R2)+,(R1)+ ;## 28 # 3 ## LETB (R1)+ := (R2)+ 114 000062 000167 177756 jmp ll$5 ;## 29 # 2 ## END; shovel 115 000066 ll$6: 116 000066 ll$3: ;## 30 # 1 ## FI; if we have an actual string to move 117 000066 112711 000000 movb #,(R1) ;## 31 # 1 ## LETB (R1) := #; put a null at end of string 118 000072 000207 rts pc ;## 32 # 1 ## RETURN; to caller 119 000074 ll$1: ;## 33 # 0 ## FI; if have 4 arguments 120 000074 104400 TRAP 0 ;## 34 # 0 ## TRAP 0 121 ;## 35 # 0 ## .END 122 ;SUPERMAC error(s) detected: 0 123 ; 1 0 0 0 7 0 1 0 0 2 .MAIN. MACRO V04.00 17-MAY-82 12:10:36 PAGE 1-1 124 ; 38 0 2 20 4 1 1 4 20 8 125 ; 0 8 0 0 0 20 0 0 121 0 126 ; 0 1 1 0 2 0 0 1 35 20 127 ; 6 1 0 0 3 1 3 0 0 0 128 ; 0 0 0 0 0 0 0 0 0 0 129 ; 0 0 0 0 0 0 0 0 0 0 130 ; 0 0 0 0 0 0 131 000001 .END .MAIN. MACRO V04.00 17-MAY-82 12:10:36 PAGE 1-2 SYMBOL TABLE LL$1 000074R LL$3 000066R LL$5 000044R LL$7 000054R NUL = 000000 LL$2 000012R LL$4 000034R LL$6 000066R LL$8 000060R SEG 000000RG . ABS. 000000 000 000076 001 ERRORS DETECTED: 0 VIRTUAL MEMORY USED: 8704 WORDS ( 34 PAGES) DYNAMIC MEMORY AVAILABLE FOR 55 PAGES SEG,SEG=SEG