1: /
   2: /
   3: 
   4: / io2 -- format cracker
   5: 
   6: .globl  iowf
   7: .globl  iowp
   8: .globl  iorf
   9: 
  10: iowp:
  11:         mov     (sp)+,formp
  12:         mov     $6,r1
  13:         br      1f
  14: 
  15: iowf:
  16:         mov     (sp)+,formp
  17:         tst     (sp)+
  18:         mov     (sp)+,r1
  19: 1:
  20:         jsr     r5,setio; 2             / write
  21:         clr     rdflg
  22:         br      1f
  23: 
  24: iorf:
  25:         mov     (sp)+,formp
  26:         tst     (sp)+
  27:         mov     (sp)+,r1
  28:         jsr     r5,setio; 1             / read
  29:         mov     pc,rdflg
  30: 
  31: 1:
  32:         clr     binflg
  33:         clr     slcnt
  34:         clr     itmfnd
  35:         clr     scale
  36:         clr     itmflg
  37:         mov     $pbuf,ppar
  38:         mov     $-1,llpcnt
  39:         jsr     r5,fmtchr
  40:         mov     formp,llp
  41:         cmp     r0,$'(
  42:         beq     crack
  43:         jsr     r5,rerr; 106.
  44:         sys     exit
  45: crack:
  46:         clr     ngflg
  47:         mov     $1,rep
  48: item:
  49:         jsr     r5,fmtchr
  50:         cmp     $' ,r0
  51:         beq     item
  52:         cmp     $'\t,r0
  53:         beq     item
  54:         jsr     r5,switch; mswitch
  55:         jsr     r5,rerr; 105.
  56:         sys     exit
  57: 
  58: mswitch:
  59:         'a; afmt
  60:         'f; ffmt
  61:         'e; efmt
  62:         'g; gfmt
  63:         'd; dfmt
  64:         'i; ifmt
  65:         'l; lfmt
  66:         'h; hfmt
  67:         'x; xfmt
  68:         'p; scal
  69:         '-; minus
  70:         '0; numb
  71:         '1; numb
  72:         '2; numb
  73:         '3; numb
  74:         '4; numb
  75:         '5; numb
  76:         '6; numb
  77:         '7; numb
  78:         '8; numb
  79:         '9; numb
  80:         ',; crack
  81:         '/; slash
  82:         '(; lpar
  83:         '); rpar
  84:         '"; quote
  85:         ' ; item
  86:         0; 0
  87: 
  88: minus:
  89:         jsr     r5,gnum
  90:         neg     r0
  91:         br      1f
  92: numb:
  93:         dec     formp
  94:         jsr     r5,gnum
  95: 1:
  96:         mov     r0,rep
  97:         br      item
  98: 
  99: scal:
 100:         mov     rep,scale
 101:         br      crack
 102: 
 103: elist:
 104:         tst     _nocr
 105:         beq     1f
 106:         tst     rdflg
 107:         bne     1f
 108:         jsr     r5,eorec1
 109:         br      2f
 110: 1:
 111:         jsr     r5,eorec
 112: 2:
 113:         jmp     *(r4)+
 114: 
 115: slash:
 116:         jsr     r5,eorec
 117:         br      crack
 118: 
 119: rpar:
 120:         mov     ppar,r0
 121:         cmp     r0,$pbuf                / see if outer parens
 122:         blos    2f
 123:         dec     -2(r0)
 124:         ble     1f              / no repeats left
 125:         mov     -4(r0),formp    / reset scan
 126:         br      crack
 127: 1:
 128:         sub     $4,ppar
 129:         br      crack           / pop parens
 130: 2:
 131:         jsr     r5,getitm
 132:                 br elist
 133:         tst     itmfnd
 134:         bne     1f
 135:         jsr     r5,rerr; 107.
 136:         sys     exit
 137: 1:
 138:         jsr     r5,eorec
 139:         inc     itmflg
 140:         mov     llpcnt,r1
 141:         bpl     1f
 142:         mov     llp,formp
 143:         jmp     crack
 144: 1:
 145:         mov     llp,r2
 146:         mov     r2,formp
 147:         mov     ppar,r0
 148:         mov     r2,(r0)+
 149:         mov     r1,(r0)+
 150:         mov     r0,ppar
 151:         jbr     crack1
 152: 
 153: lpar:
 154:         mov     ppar,r0
 155:         cmp     r0,$pbuf+10
 156:         blo     1f
 157:         jsr     r5,rerr; 108.
 158:         sys     exit
 159: 1:
 160:         mov     formp,(r0)+
 161:         mov     rep,(r0)+
 162:         mov     r0,ppar
 163:         cmp     r0,$pbuf+4
 164:         bhi     1f
 165:         mov     formp,llp
 166:         mov     rep,llpcnt
 167: 1:
 168:         jmp     crack
 169: quote:
 170:         inc     ngflg
 171:         mov     $44,-(sp)
 172:         br      3f
 173: 
 174: hfmt:
 175:         inc     ngflg
 176:         mov     $40,-(sp)
 177:         br      3f
 178: 
 179: xfmt:
 180:         inc     ngflg
 181:         mov     $34,-(sp)
 182:         br      3f
 183: 
 184: afmt:
 185:         mov     $30,-(sp)
 186:         br      1f
 187: 
 188: ifmt:
 189:         clr     -(sp)
 190:         br      1f
 191: 
 192: lfmt:
 193:         mov     $4,-(sp)
 194: 1:
 195:         jsr     r5,gnum
 196:         mov     r0,width
 197:         br      2f
 198: 
 199: ffmt:
 200:         mov     $10,-(sp)
 201:         br      1f
 202: 
 203: dfmt:
 204:         mov     $14,-(sp)
 205:         br      1f
 206: 
 207: gfmt:
 208:         mov     $20,-(sp)
 209:         br      1f
 210: 
 211: efmt:
 212:         mov     $24,-(sp)
 213: 
 214: 1:
 215:         jsr     r5,gnum
 216:         mov     r0,width
 217: 4:
 218:         jsr     r5,fmtchr
 219:         cmp     r0,$' /
 220:         beq     4b
 221:         cmp     r0,$'.
 222:         bne     err1
 223:         jsr     r5,gnum
 224:         mov     r0,ndig
 225: 2:
 226:         inc     itmfnd
 227: 3:
 228:         add     $cvsw,(sp)
 229:         tst     rdflg
 230:         beq     1f
 231:         add     $2,(sp)
 232: 1:
 233:         mov     *(sp)+,-(sp)
 234: 1:
 235:         tst     ngflg
 236:         bne     2f
 237:         jsr     r5,getitm
 238:                 br 1f
 239: 2:
 240:         clr     gflg
 241:         jsr     r5,*(sp)
 242:         dec     rep
 243:         bgt     1b
 244:         tst     (sp)+
 245:         br      crack1
 246: 1:
 247:         tst     (sp)+
 248:         jmp     elist
 249: 
 250: cvsw:
 251:         iocv; iicv      / 0
 252:         locv; licv      / 4
 253:         focv; ficv      / 10
 254:         docv; dicv      / 14
 255:         gocv; gicv      / 20
 256:         eocv; eicv      / 24
 257:         aocv; aicv      / 30
 258:         xocv; xicv      / 34
 259:         hocv; hicv      / 40
 260:         qocv; qicv      / 44
 261: 
 262: crack1:
 263:         jmp     crack
 264: 
 265: err1:
 266:         jsr     r5,rerr; 109.
 267:         sys     exit

Defined functions

afmt defined in line 184; used 1 times
  • in line 59
crack defined in line 45; used 9 times
crack1 defined in line 262; used 2 times
cvsw defined in line 250; used 1 times
dfmt defined in line 203; used 1 times
  • in line 63
efmt defined in line 211; used 1 times
  • in line 61
elist defined in line 103; used 2 times
err1 defined in line 265; used 1 times
ffmt defined in line 199; used 1 times
  • in line 60
gfmt defined in line 207; used 1 times
  • in line 62
hfmt defined in line 174; used 1 times
  • in line 66
ifmt defined in line 188; used 1 times
  • in line 64
iorf declared in line 8; defined in line 24; used 1 times
  • in line 8
iowf declared in line 6; defined in line 15; used 1 times
  • in line 6
iowp declared in line 7; defined in line 10; used 1 times
  • in line 7
item defined in line 48; used 4 times
lfmt defined in line 192; used 1 times
  • in line 65
lpar defined in line 153; used 1 times
  • in line 82
minus defined in line 88; used 1 times
  • in line 69
mswitch defined in line 58; used 1 times
  • in line 54
numb defined in line 92; used 10 times
quote defined in line 169; used 1 times
  • in line 84
rpar defined in line 119; used 1 times
  • in line 83
scal defined in line 99; used 1 times
  • in line 68
slash defined in line 115; used 1 times
  • in line 81
xfmt defined in line 179; used 1 times
  • in line 67
Last modified: 1975-07-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 592
Valid CSS Valid XHTML 1.0 Strict