|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T f ┃
Length: 2664 (0xa68) Types: TextFile Names: »flub.sim«
└─⟦87ddcff64⟧ Bits:30001253 CPHDIST85 Tape, 1985 Autumn Conference Copenhagen └─ ⟦this⟧ »cph85dist/stage2/flub.sim«
."$"0 FLG " = 0. F"10=0;$ $ FLG " = 1. F"10=1;$ $ FLG " = 2. F"10=2;$ $ FLG " = 3. F"10=3;$ $ FLG " = ". F"10=F"20;$ $ """ " = 0 " 0. "10"40=0;$ $ """ " = " " 0. "10"40="10"50;$ $ """ " = 0 " 1. "10"40= "501;$ $ """ " = " " ". "10"40="10"50"60"10"70;$ $ PTR " = " " 7. P"10 = P"20 + 1;$ $ """ " = """ ". "10"40="50"80;$ $ GET " = ". {$ register struct memy *p;$ p = &memory[P"20];$ F"10 = (struct memy *)p->flag;$ V"10 = (struct memy *)p->value;$ P"10 = (struct memy *)p->pointer;$ };$ $ STO " = ". {$ register struct memy *p;$ p = &memory[P"10]; (struct memy *)p->flag = F"20;$ (struct memy *)p->value = V"20;$ (struct memy *)p->pointer = P"20;$ }$ $ TO "" IF """ " = ". if("30"60=="30"70)goto L"10"20;$ $ TO "" IF """ " NE ". if("30"60!="30"70)goto L"10"20;$ $ TO "" IF """ " GE ". if("30"60>="30"70)goto L"10"20;$ $ TO "" BY ". P"30="00;goto L"10"20;case "00:;$ $ RETURN BY ". retby=P"10;goto Looptop;$ $ TO "". goto L"10"20;$ $ STOP. exit();$ $ VAL " = CHAR. V"10=lb[lbr++];$ $ CHAR = VAL ". F"10=iwrch(V"10,lb,&lbw,&lbl);$ $ READ NEXT ". F"10=ioop(READ,V"10,lb,&ONE,&lbl);lb[lbl]= -1;lbr=1;$ $ WRITE NEXT ". F"10=ioop(WRITE,V"10,lb,&ONE,&lbl);lbw=1;$ $ REWIND ". F"10=ioop(CONTROL,V"10,lb,&ONE,&lbl);$ $ LOC "". L"10"20:$ $ MESSAGE """" TO ". mb[11]="11;mb[12]="21;mb[13]="31;mb[14]="41;$ F"50=ioop(WRITE,V"50,mb,&ONE,&TWO1);$ $ END PROGRAM. }}$ $ MESSAGE """"""". i=1;$ while(i<10) mb[i++]="11;$ mb[i]="21;i += 5;mb[i++]="21;mb[i++]="31;mb[i++]="41;mb[i++]="51;$ mb[i++]="61;mb[i]="71;$ $$ /* this is the prefix c code for stage2 */ #define READ -1 #define CONTROL 0 #define WRITE 1 #define MEMMAX 12000 /* number of memory cells to use */ int i,lbl,lbr,lbw,retby,ONE,TWO1,lb[124],mb[22], F0, V0, P0, F1, V1, P1, F2, V2, P2, F3, V3, P3, F4, V4, P4, F5, V5, P5, F6, V6, P6, F7, V7, P7, F8, V8, P8, F9, V9, P9, FA, VA, PA, FB, VB, PB, FC, VC, PC, FD, VD, PD, FE, VE, PE, FF, VF, PF, FG, VG, PG, FH, VH, PH, FI, VI, PI, FJ, VJ, PJ, FK, VK, PK, FL, VL, PL, FM, VM, PM, FN, VN, PN, FO, VO, PO, FP, VP, PP, FQ, VQ, PQ, FR, VR, PR, FS, VS, PS, FT, VT, PT, FU, VU, PU, FV, VV, PV, FW, VW, PW, FX, VX, PX, FY, VY, PY, FZ, VZ, PZ; struct memy { short flag; short value; int pointer; } memory[MEMMAX]; /* the pseudo machine memory */ main(argc,argv) int argc; char **argv; { F0=0; /* set up the initial values, per the book */ F1=1; F2=2; F3=3; V0=0; V1=1; V2=2; V3=3; V4=4; V5=5; V6=6; V7=7; V8=8; V9=9; P0=0; P1=1; P2=2; P3=3; P5=10; P7= 1; /* Memory increment */ P8 = 0; /* Memory start */ P9 = MEMMAX; /* Memory end */ ONE=1; TWO1=21; lbr=lbw=lbl=1;retby= -1; Looptop: switch (retby) { case -1: MESSAGE * ERROR.