PiDP-8/I SoftwareCheck-in [d72ed26926]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update of native OS/8 C compiler from Ian Schofield which include: Add string storage area in Field 4. Improvements to CC.SV to read file line by line, and to include a bit more preprocessor functionality: Add simple #define directive. (Warning! Quoted text is not ignored!) Ignores formfeed character.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | smc85-cc8
Files: files | file ages | folders
SHA1: d72ed2692641be9fffc570b882bc4d1cd41d745f
User & Date: poetnerd 2019-01-13 15:17:33
Context
2019-01-30
20:30
Another cc8/cross update from Ian Schofield. Addresses bug a4123bb743, making the cross compiler at last allow typed function declarations. cc8 now builds silently with -Wall. Supporting struct in the pdp-8 target had a storage management bug that is now fixed. The void type is now added to cc8. The resulting native C compiler for OS/8 is unchanged -- bit for bit identical, because that code does not use any of the enhancements to the cc8 cross compiler. check-in: dc687b9f08 user: poetnerd tags: smc85-cc8
2019-01-13
15:17
Update of native OS/8 C compiler from Ian Schofield which include: Add string storage area in Field 4. Improvements to CC.SV to read file line by line, and to include a bit more preprocessor functionality: Add simple #define directive. (Warning! Quoted text is not ignored!) Ignores formfeed character. check-in: d72ed26926 user: poetnerd tags: smc85-cc8
2019-01-07
04:45
Turn off debugging in cc8-tu56.os8 script. check-in: b087822359 user: poetnerd tags: smc85-cc8
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/cc8/cross/code8.c.

48
49
50
51
52
53
54

55
56
57
58
59
60
61
...
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
...
475
476
477
478
479
480
481


482
483
484
485
486
487
488
489




490
491






492
493
494
495
496
497
498
	output_line ("OPDEF JMPI 5400");
	output_line ("OPDEF MQL 7421");
	output_line ("OPDEF MQA 7701");
	output_line ("OPDEF MQO 7501");
	output_line ("OPDEF SWP 7521");
	output_line ("OPDEF CDF1 6211");
	output_line ("OPDEF CDF0 6201");

	output_line ("OPDEF RIF 6224");
	output_line ("OPDEF CAF0 6203");
	output_line ("OPDEF BSW 7002");
	output_line ("OPDEF CAM 7621");
	output_line ("/");
}

................................................................................
	output_with_tab ("\tJMP D");
	print_label (litlab);
	newline ();
	output_with_tab ("\tJMP I M");
	print_label (litlab);
	newline ();
	output_line("CCEND,\t0");
	output_line ("END");
}


/*
 *	function prologue
 */
void prologue (SYMBOL *sym) {
................................................................................
	output_line("\tCPAGE 2");
	output_line("\tJMSI PCAL");
	output_with_tab ("\t");
	output_string (sname);
	newline ();
}



void stri()
{
	output_line("\tDCAI 10");
}

void iinit()
{
	output_line("\tCIA;CMA");




	output_line("\tDCA 10");
}







/*
 *	return from subroutine
 *
 */

void gen_ret (sym)







>







 







|







 







>
>


|




|
>
>
>
>
|

>
>
>
>
>
>







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
...
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
...
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
	output_line ("OPDEF JMPI 5400");
	output_line ("OPDEF MQL 7421");
	output_line ("OPDEF MQA 7701");
	output_line ("OPDEF MQO 7501");
	output_line ("OPDEF SWP 7521");
	output_line ("OPDEF CDF1 6211");
	output_line ("OPDEF CDF0 6201");
	output_line ("OPDEF CDF4 6241");
	output_line ("OPDEF RIF 6224");
	output_line ("OPDEF CAF0 6203");
	output_line ("OPDEF BSW 7002");
	output_line ("OPDEF CAM 7621");
	output_line ("/");
}

................................................................................
	output_with_tab ("\tJMP D");
	print_label (litlab);
	newline ();
	output_with_tab ("\tJMP I M");
	print_label (litlab);
	newline ();
	output_line("CCEND,\t0");
	output_line ("\tEND");
}


/*
 *	function prologue
 */
void prologue (SYMBOL *sym) {
................................................................................
	output_line("\tCPAGE 2");
	output_line("\tJMSI PCAL");
	output_with_tab ("\t");
	output_string (sname);
	newline ();
}

/* Serial read/write routines for use of field 4 a a block of storage */

void stri()
{
	output_line("\tJMSI PSTRI");
}

void iinit()
{
	output_line("\tJMSI PINIT");
}

void strd()
{
	output_line("\tJMSI PSTRD");
}

void strl()
{
	output_line("\tJMSI PSTRL");
}


/*
 *	return from subroutine
 *
 */

void gen_ret (sym)

Changes to src/cc8/cross/primary.c.

351
352
353
354
355
356
357











358
359
360
361
362
363
364
    }
    if (strcmp(ptr,"iinit")==0) {
        expression(NO);
	iinit();
	needbrack(")");
	return;
    }












    nargs = 0;
    blanks ();
    if (ptr == 0)
        gen_push (HL_REG);
    while (!streq (line + lptr, ")")) {
        if (endst ())







>
>
>
>
>
>
>
>
>
>
>







351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
    }
    if (strcmp(ptr,"iinit")==0) {
        expression(NO);
	iinit();
	needbrack(")");
	return;
    }
    if (strcmp(ptr,"strd")==0) {
	strd();
	needbrack(")");
	return;
    }
    if (strcmp(ptr,"strl")==0) {
	strl();
	needbrack(")");
	return;
    }


    nargs = 0;
    blanks ();
    if (ptr == 0)
        gen_push (HL_REG);
    while (!streq (line + lptr, ")")) {
        if (endst ())

Changes to src/cc8/include/init.h.

16
17
18
19
20
21
22





23
24
25
26
27
28
29
..
50
51
52
53
54
55
56








57
58
59
60
61
62
63
...
104
105
106
107
108
109
110






















111
112
113
114
115
116




117
118

 * <http://www.gnu.org/licenses/>.
 */

#asm
/
/	PDP8/E Run time routines for the Small-C compiler.  SABR syntax.
/





ABSYM POP 160
ABSYM PSH 161
ABSYM JLC 162
ABSYM STKP 163
ABSYM PTSK 164
ABSYM POPR 165
ABSYM PCAL 166
................................................................................
		DCA POP
		TAD MVL
		DCA PTSK
		TAD PVR
		DCA POPR
		TAD PVC
		DCA PCAL








		RIF
		TAD (3201
		DCA PCL1
		TAD PCL1
		DCA DCC0
		JMS MCC0
		CLA CMA
................................................................................
		TADI PCALL
		DCA ZTMP
		TAD PCALL
		IAC
		JMSI PSH		/ PUSH RETURN
		CLA
		JMPI ZTMP






















PVL,	PUSH
OVL,	PPOP
MVL,	PUTSTK
SVL,	STK
PVR,	POPRET
PVC,	PCALL




/
#endasm








>
>
>
>
>







 







>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
>
>
>


>
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
...
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
 * <http://www.gnu.org/licenses/>.
 */

#asm
/
/	PDP8/E Run time routines for the Small-C compiler.  SABR syntax.
/
ABSYM STRV 153
ABSYM PSTRL 154
ABSYM PSTRD 155
ABSYM PINIT 156
ABSYM PSTRI 157
ABSYM POP 160
ABSYM PSH 161
ABSYM JLC 162
ABSYM STKP 163
ABSYM PTSK 164
ABSYM POPR 165
ABSYM PCAL 166
................................................................................
		DCA POP
		TAD MVL
		DCA PTSK
		TAD PVR
		DCA POPR
		TAD PVC
		DCA PCAL
		TAD SII
		DCA PINIT
		TAD SRI
		DCA PSTRI
		TAD SRD
		DCA PSTRD
		TAD SRL
		DCA PSTRL
		RIF
		TAD (3201
		DCA PCL1
		TAD PCL1
		DCA DCC0
		JMS MCC0
		CLA CMA
................................................................................
		TADI PCALL
		DCA ZTMP
		TAD PCALL
		IAC
		JMSI PSH		/ PUSH RETURN
		CLA
		JMPI ZTMP
IINIT,	0
		DCA STRV
		JMPI IINIT
STRI,	0
		CDF4
		DCAI STRV
		CDF1
		ISZ STRV
		JMPI STRI
STRD,	0
		CDF4
		CLA
		TADI STRV
		CDF1
		ISZ STRV
		JMPI STRD		
STRL,	0
		CDF4
		CLA
		TADI STRV
		CDF1
		JMPI STRL		
PVL,	PUSH
OVL,	PPOP
MVL,	PUTSTK
SVL,	STK
PVR,	POPRET
PVC,	PCALL
SII,	IINIT
SRI,	STRI
SRD,	STRD
SRL,	STRL
/
#endasm

Changes to src/cc8/include/libc.h.

52
53
54
55
56
57
58


#define isalnum libc24
#define isspace libc25
#define fprintf vlibc26
#define	fputs libc27
#define strcmp libc28
#define cupper libc29
#define fgets libc30









>
>
52
53
54
55
56
57
58
59
60
#define isalnum libc24
#define isspace libc25
#define fprintf vlibc26
#define	fputs libc27
#define strcmp libc28
#define cupper libc29
#define fgets libc30
#define revcpy libc31
#define toupper libc32

Changes to src/cc8/os8/c8.c.

15
16
17
18
19
20
21
22






23





























































24
25
26
27
28
29
30
31
32
33









































34
35
36




37

38
39
40
41
42
43
44
45
46
 * along with the CC8 OS/8 C compiler as ../GPL3.txt.  If not, see
 * <http://www.gnu.org/licenses/>.
 */

#include <libc.h>
#include <init.h>

/* C compiler driver: asks for input files, copies to CC.C & runs CC1 */




































































main()
{
	int bfr;
	int fnm[10];

	putc('>');
	gets(fnm);
	cupper(fnm);
	fopen(fnm,"r");
	fopen("CC.C","w");









































	while (bfr=fgetc())
		if (bfr!=12)		/* Ignore form feed */
			fputc(bfr);




	fclose();

#asm	
	CALL 1,CHAIN
	ARG FNM
	HLT
FNM,	TEXT "CC1@@@"
#endasm


}







|
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

<
|
>
>
>
>

>









15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
 * along with the CC8 OS/8 C compiler as ../GPL3.txt.  If not, see
 * <http://www.gnu.org/licenses/>.
 */

#include <libc.h>
#include <init.h>

/* C pre-processor stub for PDP/8 c compiler 2017 */
/* Ask for input file, copy to CC.CC and run CC1 */
/* Update Feb 2018: */
/* 1. Read file line by line */
/* 2. Exclude FF (12) */
/* 3. Implement simple #define directive **Warning** quoted text is not ignored */
/* 4. Implement #asm/#endasm directive */

int ln[80],*p,*q,*tm,*dfp,tkbf[10],smbf[10];
int dflst[1024],tmln[80];
int asm[1024];


skpsp()
{
	while (isspace(*p))
		p++;
}

strlen(p)
char *p;
{
	int n;

	n=0;
	while (*p++)
		n++;
	return n;
}

getsym()
{
	q=tkbf;
	skpsp();
	while (isalnum(*p))
		*q++=*p++;
	*q=0;
	skpsp();
	return *tkbf;
}


parse()
{
	getsym();
	strcpy(dfp,tkbf);
	getsym();
	strcpy(dfp+512,tkbf);
	dfp+=10;
}

dorep()
{
	p=dflst;
	while (*p) {
		q=strstr(ln,p);
		if (q) {
			memset(tmln,0,80);
			if (q-p)
				memcpy(tmln,ln,q-ln);
			strcat(tmln,p+512);
			strcat(tmln,q+strlen(p));
			memcpy(ln,tmln,80);
		}
		p+=10;
	}
}


main()
{
	int bfr;
	int fnm[10];

	putc('>');
	gets(fnm);
	cupper(fnm);
	fopen(fnm,"r");
	fopen("CC.CC","w");
	*asm=0;
	memset(dflst,0,1024);
	dfp=dflst;
	while (1) {
		fgets(p=ln);
		if (!*ln)
			break;

		dorep();

		while (*p) {
			if (*p==12)
				*p=' ';
			p++;
		}

		p=strstr(ln,"#asm");
		q=0;
		while (p) {
			fgets(ln);
			q=strstr(ln,"#endasm");
			if (q) {
				strcpy(ln,"`\r\n");
				break;
			}
			toupper(ln);
			strcat(asm,ln);
		}
		if (p)
			strcat(asm,"$");
		
		p=strstr(ln,"#define ");
		if (p) {
			p=p+8;
			parse();
		} else
			fputs(ln);
	}
	fclose();
	fopen("HEADER.SB","r");
	fopen("CASM.TX","w");
	while (bfr=fgetc())

		fputc(bfr);
	fputc('!');
	p=asm;
		while (*p)
			fputc(*p++);
	fclose();

#asm	
	CALL 1,CHAIN
	ARG FNM
	HLT
FNM,	TEXT "CC1@@@"
#endasm


}

Changes to src/cc8/os8/libc.c.

186
187
188
189
190
191
192


193
194
195
196
197
198
199
...
457
458
459
460
461
462
463
464
465
466
467




468




469
470
471
472
473
474
475
476
477
478
479

480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
...
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
...
737
738
739
740
741
742
743






















744
745
746
747
748
749
750
...
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901













902
903
904
905
906
907
908
...
978
979
980
981
982
983
984
985










		ISALNUM
		ISSPACE
		FPRINTF
		FPUTS
		STRCMP
		CUPPER
		FGETS


#endasm

#define stdout 0
#define NULL 0
#define isdigit isnum


................................................................................
	3117	/ DIL
#endasm
}

getc()
{
#asm
	CLA
GT1, KSF
	 JMP GT1
	 KRB




	 TLS




	 AND (127	/* 7 BIT! */
#endasm
}

gets(p)
char *p;
{
int q,tm;
		tm=1;
		q=p;
		while (tm) {

#asm
XC2,	CLA CLL
		KSF
		JMP XC2
		KRB
		TAD (-255
		CLA
		KRB
		SNL			/ DO NOT ECHO BS
		TLS
XC3,	AND (127
		TAD (-13	/ CR IS END OF STRING -> 0
		SZA
		TAD (13
	    DCAI STKP
#endasm
		if (tm!=127)
		  *p++=tm;
		else
			if (p-q) {
		   puts("\b \b");
		   p--;
			}
	}
................................................................................
 } return 0 ;
}

exit(retval)
int retval;
{
#asm
		CALL 0,EXIT
		HLT
#endasm
}

isalnum(vl)
int vl;
{
................................................................................
		TAD (91
		DCAI ZTMP
CPP3,	ISZ ZTMP
		JMP CPP1
CPP2,
#endasm
}























/* Arbitrary fgets(). Read until LF, CR/LF are retained*/
/* EOF returns null, else strlen(*p) */

fgets(p)
char *p;
{
................................................................................
#endasm

  return(cc);
  }

/*
** itoa(n,s) - Convert n to characters in s 
*/
itoa(n, s) char *s; int n; {
  int sign;
  char *ptr;
  ptr = s;
  if ((sign = n) < 0) n = -n;
  do {
    *ptr++ = n % 10 + '0';
    } while ((n = n / 10) > 0);
  if (sign < 0) *ptr++ = '-';
  *ptr = '\0';
  reverse(s);
  }














/*
** itoab(n,s,b) - Convert "unsigned" n to characters in s using base b.
**                NOTE: This is a non-standard function.
*/
itoab(n, s, b) int n; char *s; int b; {
  char *ptr;
................................................................................
          }
        *narg = sign * u;
      }
    ++ac;                          
    }
  return (ac);
  }


















>
>







 







|



>
>
>
>

>
>
>
>
|










>

<
<
<
<
<
<
<
<
<
|





|







 







|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|












>
>
>
>
>
>
>
>
>
>
>
>
>







 








>
>
>
>
>
>
>
>
>
>
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
...
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491









492
493
494
495
496
497
498
499
500
501
502
503
504
505
...
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
...
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
...
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
....
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
		ISALNUM
		ISSPACE
		FPRINTF
		FPUTS
		STRCMP
		CUPPER
		FGETS
		REVCPY
		TOUPPER
#endasm

#define stdout 0
#define NULL 0
#define isdigit isnum


................................................................................
	3117	/ DIL
#endasm
}

getc()
{
#asm
	 CLA CLL
GT1, KSF
	 JMP GT1
	 KRB
	 TAD (-254
	 CLA
	 KRB
	 SNL			/ DO NOT ECHO BS
	 TLS
	 TAD (-131		/ ? ^C
	 SNA CLA
	 JMP OSRET
	 KRB
	 AND (127		/ 7 BITS!
#endasm
}

gets(p)
char *p;
{
int q,tm;
		tm=1;
		q=p;
		while (tm) {
		getc();
#asm









		AND (127
		TAD (-13	/ CR IS END OF STRING -> 0
		SZA
		TAD (13
	    DCAI STKP
#endasm
		if (tm-127)	/* Handle BS */
		  *p++=tm;
		else
			if (p-q) {
		   puts("\b \b");
		   p--;
			}
	}
................................................................................
 } return 0 ;
}

exit(retval)
int retval;
{
#asm
OSRET,	CALL 0,EXIT
		HLT
#endasm
}

isalnum(vl)
int vl;
{
................................................................................
		TAD (91
		DCAI ZTMP
CPP3,	ISZ ZTMP
		JMP CPP1
CPP2,
#endasm
}

toupper(p)
int p;
{
	p;
#asm
		DCA ZTMP
		TAD ZTMP
		TAD (-97
		SPA
		JMP TPP3
		TAD (-26
		SMA
		JMP TPP3
		TAD (91
		JMP TPP2
TPP3,	CLA CLL
		TAD ZTMP
TPP2,
#endasm
}


/* Arbitrary fgets(). Read until LF, CR/LF are retained*/
/* EOF returns null, else strlen(*p) */

fgets(p)
char *p;
{
................................................................................
#endasm

  return(cc);
  }

/*
** itoa(n,s) - Convert n to characters in s 

itoa(n, s) char *s; int n; {
  int sign;
  char *ptr;
  ptr = s;
  if ((sign = n) < 0) n = -n;
  do {
    *ptr++ = n % 10 + '0';
    } while ((n = n / 10) > 0);
  if (sign < 0) *ptr++ = '-';
  *ptr = '\0';
  reverse(s);
  }
*/

itoa(n, s) char *s; int n; {
  int sign;
  char *ptr;
  ptr = s;
  if ((sign = n) < 0) {
	  n = -n;
	  *ptr++='-';
  }
  itoab(n,ptr,10);
}


/*
** itoab(n,s,b) - Convert "unsigned" n to characters in s using base b.
**                NOTE: This is a non-standard function.
*/
itoab(n, s, b) int n; char *s; int b; {
  char *ptr;
................................................................................
          }
        *narg = sign * u;
      }
    ++ac;                          
    }
  return (ac);
  }

revcpy(dst,src,cnt)
int *dst,*src,cnt;
{
	dst+=cnt;
	src+=cnt;
	while (cnt--)
		*dst--=*src--;
}


Changes to src/cc8/os8/n8.c.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
66
67
68
69
70
71
72

73
74
75
76
77
78
79
80
81
82
83
84

85
86
87
88
89

90
91
92
93
94
95
96
97
...
150
151
152
153
154
155
156

157
158
159
160
161
162
163
...
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
213
214
215
216
217
218
219




220
221
222
223
224
225
226
...
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
...
451
452
453
454
455
456
457

458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
...
491
492
493
494
495
496
497

498
499
500
501

502
503
504
505
506
507
508
...
525
526
527
528
529
530
531
532
533

534



535
536
537
538
539
540
541
...
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
...
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
 * <http://www.gnu.org/licenses/>.
 */


#include <libc.h>
#include <init.h>


#define SMAX 10
#define CMAX 256
#define BMAX 64
#define LMAX 32
#define DMAX 32
#define CBMX 1024
#define LXMX 999

int asm[CBMX];
int ltbf[512];
int xlt[CMAX];
int gm[CMAX];		/* Global symbol table */
int tkbf[LMAX];
int *p,*q,*s,*ltpt;
int gsym,lsym,gadr,ladr,stkp,lctr,*fptr,gsz,ctr,tm,ectr,cop;
int glim,*n,ccm;
int tmp;
int tkn[BMAX];
int bfr[BMAX];
................................................................................
	return *tkbf;
}


/* recursive descent parser for arithmetic/logical expressions */

S(  ) {


	cop=0;
	J( );
	switch(*p++){
	case '=':
		S();
		stri(1);
		stkp--;
		break;
	case ']':
	case ')':
		return 1;

	case ',':
		break;
	default: 
		p--;
	}

	return 0;
} /* end S */

J(  ) {

	K( );
	switch(*p++){
	case '&': J( ); stri(20); break;
................................................................................

	if (!*p)
		return;

	if (cop) {
		stri(19);
		stkp++;

	}

	if (*p=='"') {
		stri(10);
		stri(ltpt-ltbf);
		while (*++p-'"') {
			if (*p=='\\')
................................................................................
			}
			*ltpt++=*p;
		}
		*ltpt++=0;
		p++;
		return;
	}
	n=q=p;
	if (*p=='-')
		p++;
	if(isdigit(*p)) {
		while(isdigit(*p))
			p++;
		stri(4);
		atoi(q,&tmp);
		stri(tmp);
		return;
................................................................................
				return;
			case '(':
				S();
				return;
			case ')':
				icd=1;
				return;




		}
	}
	if(*p=='('){
		strcpy(txbf,tkbf);
		ctx=o=0;p++;
		while (*p && !o) {
			o=S( );
................................................................................
				tmp=-8;
			ixf=0;
			stkp++;
			break;
	}
	stri(tmp);
	stri(o);
	if (*n=='-')
		stri(27);
	if (izf)
		stri(15);
	if (idf)
		stri(25);
	if (ixf)
		stri(22);
	return;
................................................................................
					strcpy(tkbf,"XMAIN");
				addsym(tkbf,1);
				procst(')');
				stkp=-(ccm+1);
				while (*p) {
					getsym();
					addsym(tkbf,-1);

					p++;
					stkp+=2;
				}
				stkp=0;
				tm=gettk();
				cbrk=100;
				break;
			case ',':
			case ';':
				addsym(tkbf,1);
				break;
					}				/* end whie */
				}					/* end case 0: */
				break;
			case 4:
				fflg=fflg+100;
			case 12:
				fnbrk();
				stri(5);
				*++fptr=fflg;
				stri(fflg);
				procst(0);
				stri(12);
				stri(tm=*fptr+2);
				*++fptr=cbrk;
				if (fflg<100)
					cbrk=tm;
				*++fptr=inproc;
				lctr+=3;
				tm=0;
				stri(99);
				break;
			case 7:
................................................................................
				tm=0;
				break;
			case 18:
				stri(23);
				stri(cbrk);
				break;
			case 24:

				procst(';');
				stri(23);
				stri(ectr);
				tm=1;

				break;
			case 31:
				fnbrk();
				procst(';');
				stri(5);
				stri(lctr++);
				*++fptr=lctr;
................................................................................
				break;
			default:
				dostt();
		} /* End switch */
	} else
		switch (tm) {
				case '{':
					tm=1;
					inproc++;

					break;



				case '}':
					break;
				case -1:
				case 0:
					stri(0);
#asm
					CALL 1,CHAIN
................................................................................


main()
{
	char trm;

	memset(ltbf,0,&ssz-ltbf);
	fopen("CC.C","r");
	strcpy(tkn,"int if else while break return for ");
	lctr = 10;
	ectr = 900;
	ltpt = ltbf;
	fptr = fstk;
	*fptr = -1;
	gadr = 128; /* Start of globals */
	iinit(asm);
	tm=gettk();
	while (1) {
		trm=next();
		tm=gettk();
		switch (trm) {
			case '{':
				inproc++;
................................................................................
					break;
				}
			case ';':
			case 1:
				stri(99);
				if (!strcmp("else",tkbf)) {
					stri(-23);
					stri(100+lctr+2);
					popfr();
					*++fptr=100+lctr++;
					*++fptr=cbrk;
					*++fptr=inproc;
				}
				else
					popfr();
			case 0:
				break;
			default:
				procst(';');
		}
	}
}








<

|






<


|







 







>

|









|
>





>
|







 







>







 







|
<
<







 







>
>
>
>







 







<
<







 







>
|




|









|









|







 







>
|
|
|
|
>







 







<

>

>
>
>







 







|







|







 







|

|













16
17
18
19
20
21
22

23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39
40
..
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
...
172
173
174
175
176
177
178
179


180
181
182
183
184
185
186
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
...
292
293
294
295
296
297
298


299
300
301
302
303
304
305
...
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
...
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
...
530
531
532
533
534
535
536

537
538
539
540
541
542
543
544
545
546
547
548
549
...
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
...
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
 * <http://www.gnu.org/licenses/>.
 */


#include <libc.h>
#include <init.h>


#define SMAX 10
#define CMAX 280
#define BMAX 64
#define LMAX 32
#define DMAX 32
#define CBMX 1024
#define LXMX 999


int ltbf[512];
int xlt[CMAX];
int gm[512];		/* Global symbol table */
int tkbf[LMAX];
int *p,*q,*s,*ltpt;
int gsym,lsym,gadr,ladr,stkp,lctr,*fptr,gsz,ctr,tm,ectr,cop;
int glim,*n,ccm;
int tmp;
int tkn[BMAX];
int bfr[BMAX];
................................................................................
	return *tkbf;
}


/* recursive descent parser for arithmetic/logical expressions */

S(  ) {
int rtv;

	cop=rtv=0;
	J( );
	switch(*p++){
	case '=':
		S();
		stri(1);
		stkp--;
		break;
	case ']':
	case ')':
		rtv++;
		break;
	case ',':
		break;
	default: 
		p--;
	}
	skpsp();
	return rtv;
} /* end S */

J(  ) {

	K( );
	switch(*p++){
	case '&': J( ); stri(20); break;
................................................................................

	if (!*p)
		return;

	if (cop) {
		stri(19);
		stkp++;
		cop=0;
	}

	if (*p=='"') {
		stri(10);
		stri(ltpt-ltbf);
		while (*++p-'"') {
			if (*p=='\\')
................................................................................
			}
			*ltpt++=*p;
		}
		*ltpt++=0;
		p++;
		return;
	}
	q=p;


	if(isdigit(*p)) {
		while(isdigit(*p))
			p++;
		stri(4);
		atoi(q,&tmp);
		stri(tmp);
		return;
................................................................................
				return;
			case '(':
				S();
				return;
			case ')':
				icd=1;
				return;
			case '-':
				Y();
				stri(27);
				return;
		}
	}
	if(*p=='('){
		strcpy(txbf,tkbf);
		ctx=o=0;p++;
		while (*p && !o) {
			o=S( );
................................................................................
				tmp=-8;
			ixf=0;
			stkp++;
			break;
	}
	stri(tmp);
	stri(o);


	if (izf)
		stri(15);
	if (idf)
		stri(25);
	if (ixf)
		stri(22);
	return;
................................................................................
					strcpy(tkbf,"XMAIN");
				addsym(tkbf,1);
				procst(')');
				stkp=-(ccm+1);
				while (*p) {
					getsym();
					addsym(tkbf,-1);
					if (*p)
						p++;
					stkp+=2;
				}
				stkp=0;
				tm=gettk();
				cbrk=200;
				break;
			case ',':
			case ';':
				addsym(tkbf,1);
				break;
					}				/* end whie */
				}					/* end case 0: */
				break;
			case 4:
				fflg=fflg+200;
			case 12:
				fnbrk();
				stri(5);
				*++fptr=fflg;
				stri(fflg);
				procst(0);
				stri(12);
				stri(tm=*fptr+2);
				*++fptr=cbrk;
				if (fflg<200)
					cbrk=tm;
				*++fptr=inproc;
				lctr+=3;
				tm=0;
				stri(99);
				break;
			case 7:
................................................................................
				tm=0;
				break;
			case 18:
				stri(23);
				stri(cbrk);
				break;
			case 24:
				if (tm-';') {
					procst(';');
					stri(-23);
					stri(ectr);
					tm=1;
				}
				break;
			case 31:
				fnbrk();
				procst(';');
				stri(5);
				stri(lctr++);
				*++fptr=lctr;
................................................................................
				break;
			default:
				dostt();
		} /* End switch */
	} else
		switch (tm) {
				case '{':

					inproc++;
					tm=1;
					break;
				case '`':
					tm=1;
					stri(29);
				case '}':
					break;
				case -1:
				case 0:
					stri(0);
#asm
					CALL 1,CHAIN
................................................................................


main()
{
	char trm;

	memset(ltbf,0,&ssz-ltbf);
	fopen("CC.CC","r");
	strcpy(tkn,"int if else while break return for ");
	lctr = 10;
	ectr = 900;
	ltpt = ltbf;
	fptr = fstk;
	*fptr = -1;
	gadr = 128; /* Start of globals */
	iinit(128);
	tm=gettk();
	while (1) {
		trm=next();
		tm=gettk();
		switch (trm) {
			case '{':
				inproc++;
................................................................................
					break;
				}
			case ';':
			case 1:
				stri(99);
				if (!strcmp("else",tkbf)) {
					stri(-23);
					stri(200+lctr+2);
					popfr();
					*++fptr=200+lctr++;
					*++fptr=cbrk;
					*++fptr=inproc;
				}
				else
					popfr();
			case 0:
				break;
			default:
				procst(';');
		}
	}
}

Changes to src/cc8/os8/p8.c.

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

46
47
48
49
50

51
52





53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

73
74

75
76
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
...
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
...
183
184
185
186
187
188
189








190
191
192
193
194
195
196
 */


#include <libc.h>
#include <init.h>

#define SMAX 10
#define CMAX 256
#define BMAX 64
#define LMAX 32
#define DMAX 32
#define CBMX 1024
#define LXMX 999

int asm[CBMX];
int ltbf[512];
int xlt[CMAX];
int gm[CMAX];		/* Global symbol table */
int tkbf[LMAX];
int *p,*q,*s,*ltpt;
int gsym,lsym,gadr,ladr,stkp,*as,lctr,*fptr,gsz,ctr,tm,ectr;
int glim;
int ltsz,pflg,t;
int tmstr[32];

main()
{

	as=asm;

	fopen("HEADER.SB","r");
	fopen("CC.SB","w");
	strcpy(xlt,"ITOA    PUTS    DISPXY  GETC    GETS    ATOI    SSCANF  XINIT   MEMCPY  KBHIT   PUTC    STRCPY  STRCAT  STRSTR  EXIT    ISNUM   ");
	strcat(xlt,"ISALPH  SPRINTF MEMSET  FGETC   FOPEN   FPUTC   FCLOSE  PRINTF  ISALNUM ISSPACE FPRINTF FPUTS   STRCMP  CUPPER  FGETS   ");
	while (t=fgetc())

		if (t!=12)			/* Ignore form feed */
			fputc(t);





	cupper(gm);
	while (*as) {
		pflg=0;
		*tmstr=0;
		switch (*as++) {
			case 99:
				fprintf("/\r");
				break; 
			case 1:
				fprintf("\tJMSI PTSK\r");
				break;
			case 3:
				strcpy(tmstr,"\tCIA\r");
			case 2:
				fprintf("%s\tTADI STKP\r\tJMSI POP\r",tmstr);
				break;
			case 4:
				fprintf("\tCLA\r\tTAD (%d\r",*as++);
				break;
			case 5:

				if (*as<0)
					*as=100-*as;

				fprintf("CC%d,\r",*as++);
				break;
			case 6:
				if (*as>1)
					fprintf("\tTAD STKP\r\tTAD (%d\r\tDCA STKP\r",*as);
				else
					if (*as>0)
						fputs("\tISZ STKP\r");
				as++;

				break;
			case 7:
				p=gm+*as++;
				while (*p-' ')
					fputc(*p++);
				fputs(",\r");
				break;
			case -8:
				strcpy(tmstr,"\tDCA JLC\r\tTADI JLC\r");
			case 8:
				if (*as>0)
					fprintf("\tCLA\r\tTAD (%d\r%s\tJMSI PSH\r",*as++,tmstr);
				else
					fprintf("\tCLA\r\tTAD STKP\r\tTAD (%d\r%s\tJMSI PSH\r",*as++,tmstr);
				break;
			case 9:
				tm=*as++;
				p=gm+*as++;
				strcpy(tkbf,"        ");
				memcpy(tkbf,p,7);
				if (p=strstr(xlt,tkbf)) {
					t=(p-xlt)>>3;
					if ((t==6) + (t==17) + (t==23)) 
						fprintf("\tCLA\r\tTAD (%d\r\tJMSI PSH\r",tm++);
					fprintf("\tCLA\r\tTAD (%d\r\tMQL\r\tCALL 1,LIBC\r\tARG STKP\r\tCDF1\r",t);
				}
				else
					fprintf("\tJMSI PCAL\r\t%s\r",tkbf);
				if (tm)
				    fprintf("\tMQL\r\tTAD (%d\r\tTAD STKP\r\tDCA STKP\r\tSWP\r",-tm);
				break;
			case 10:
				fprintf("\tCLA\r\tTAD GBL\r\tTAD (%d\r",*as++);
				break;
			case -11:
				fprintf("\tCIA\r\tTADI STKP\r\tJMSI POP\r\tSMA SZA CLA\r\tCMA\r");
				break;
			case 11:
				fprintf("\tCIA\r\tTADI STKP\r\tJMSI POP\r\tSPA CLA\r\tCMA\r");
				break;
			case 12:
					fprintf("\tSNA\r\tJMP CC%d\r",*as++);
				break;
			case 13:
				fprintf("\tJMSI POP\r\tDCA JLC\r\tSWP\r\tCALL 1,MPY\r\tARG JLC\r\tCDF1\r");
				break;
			case -14:
				fprintf("\tCALL 1,IREM\r\tARG 0\r\tCDF1\r");
				break;
................................................................................
			case 14:
				fprintf("\tJMSI POP\r\tDCA JLC\r\tSWP\r\tCALL 1,DIV\r\tARG JLC\r\tCDF1\r");
				break;
			case 15:
				fprintf("\tISZI JLC\r\tNOP\r");
				break;
			case 16:
				fprintf("\tMQL\r\tTAD STKP\r\tTAD (%d\r\tDCA STKP\r\tSWP\r\tJMPI POPR\r/\r",*as++);
				break;
			case 17:
				pflg++;
			case -17:
				if (*as>0) 
					fprintf("\tCLA\r\tTAD (%d\r\tDCA JLC\r\tTADI JLC\r",*as++);
				else
					fprintf("\tCLA\r\tTAD STKP\r\tTAD (%d\r\tDCA JLC\r\tTADI JLC\r",*as++);
				if (pflg==0)
					break;
			case 19:
				fprintf("\tJMSI PSH\r");
				break;
			case 20:
				fprintf("\tANDI STKP\r\tJMSI POP\r");
				break;
			case -20:
				fprintf("\tJMSI POP\r\tMQO\r");
				break;
			case 21:
				if (*as>0) 
					fprintf("\tCLA\r\tTAD (%d\r",*as++);
				else
					fprintf("\tCLA\r\tTAD STKP\r\tTAD (%d\r",*as++);
				break;
			case 22:
				fprintf("\tDCA JLC\r\tTADI JLC\r");
				break;
			case 23:
				if (*as<100)
					fprintf("\tJMP CC%d\r",*as);
				as++;
				break;
			case -23:
					fprintf("\tJMP CC%d\r",*as++);
				break;
			case 24:
				fprintf("\tCIA\r\tTADI STKP\r\tJMSI POP\r\tSNA CLA\r\tCMA\r");
				break;
			case 25:
				fprintf("\tMQL\r\tCMA\r\tTADI JLC\r\tDCAI JLC\r\tSWP\r");
				break;
................................................................................
			case 26:
				fprintf("\tSNA CLA\r");
			case -26:
				fprintf("\tCMA\r");
				break;
			case 27:
				fputs("\tCIA\r");








		}
	}
	ltsz=ltpt-ltbf;
	fprintf("\tLAP\r\tCPAGE %d\rLCC0,\t%d\rXCC0,\tCC0\rCC0,\t\r",ltsz+2,-ltsz);
	p=ltbf;
	while (ltsz) {
		fprintf("%d",*p++);







|






<


|


|







<
>
|

|
<
|
>
|
|
>
>
>
>
>

|


|












|


>
|
<
>
|


|
|

|

<
>


|







|
|

|


|
|









|




|








|







 







|




|
|

|












|
|

|





|
|
|


|







 







>
>
>
>
>
>
>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
47

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

79
80
81
82
83
84
85
86
87

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
...
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
...
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
 */


#include <libc.h>
#include <init.h>

#define SMAX 10
#define CMAX 280
#define BMAX 64
#define LMAX 32
#define DMAX 32
#define CBMX 1024
#define LXMX 999


int ltbf[512];
int xlt[CMAX];
int gm[512];		/* Global symbol table */
int tkbf[LMAX];
int *p,*q,*s,*ltpt;
int gsym,lsym,gadr,ladr,stkp,lctr,*fptr,gsz,ctr,tm,ectr;
int glim;
int ltsz,pflg,t;
int tmstr[32];

main()
{


	iinit(128);
	fopen("CASM.TX","r");
	fopen("CC.SB","w");
	while (1) {

		t=fgetc();
		if (t=='!')
			break;
		fputc(t);
	}

	strcpy(xlt,"ITOA    PUTS    DISPXY  GETC    GETS    ATOI    SSCANF  XINIT   MEMCPY  KBHIT   PUTC    STRCPY  STRCAT  STRSTR  EXIT    ISNUM   ");
	strcat(xlt,"ISALPHA SPRINTF MEMSET  FGETC   FOPEN   FPUTC   FCLOSE  PRINTF  ISALNUM ISSPACE FPRINTF FPUTS   STRCMP  CUPPER  FGETS   REVCPY  ");
	strcat(xlt,"TOUPPER ");
	cupper(gm);
	while (strl()) {
		pflg=0;
		*tmstr=0;
		switch (strd()) {
			case 99:
				fprintf("/\r");
				break; 
			case 1:
				fprintf("\tJMSI PTSK\r");
				break;
			case 3:
				strcpy(tmstr,"\tCIA\r");
			case 2:
				fprintf("%s\tTADI STKP\r\tJMSI POP\r",tmstr);
				break;
			case 4:
				fprintf("\tCLA\r\tTAD (%d\r",strd());
				break;
			case 5:
				tm=strd();
				if (tm<0)

					tm=200-tm;
				fprintf("CC%d,\r",tm);
				break;
			case 6:
				if (strl()>1)
					fprintf("\tTAD STKP\r\tTAD (%d\r\tDCA STKP\r",strl());
				else
					if (strl()>0)
						fputs("\tISZ STKP\r");

				strd();
				break;
			case 7:
				p=gm+strd();
				while (*p-' ')
					fputc(*p++);
				fputs(",\r");
				break;
			case -8:
				strcpy(tmstr,"\tDCA JLC\r\tTADI JLC\r");
			case 8:
				if (strl()>0)
					fprintf("\tCLA\r\tTAD (%d\r%s\tJMSI PSH\r",strd(),tmstr);
				else
					fprintf("\tCLA\r\tTAD STKP\r\tTAD (%d\r%s\tJMSI PSH\r",strd(),tmstr);
				break;
			case 9:
				tm=strd();
				p=gm+strd();
				strcpy(tkbf,"        ");
				memcpy(tkbf,p,7);
				if (p=strstr(xlt,tkbf)) {
					t=(p-xlt)>>3;
					if ((t==6) + (t==17) + (t==23)) 
						fprintf("\tCLA\r\tTAD (%d\r\tJMSI PSH\r",tm++);
					fprintf("\tCLA\r\tTAD (%d\r\tMQL\r\tCALL 1,LIBC\r\tARG STKP\r\tCDF1\r",t);
				}
				else
					fprintf("\tCPAGE 2\r\tJMSI PCAL\r\t%s\r",tkbf);
				if (tm)
				    fprintf("\tMQL\r\tTAD (%d\r\tTAD STKP\r\tDCA STKP\r\tSWP\r",-tm);
				break;
			case 10:
				fprintf("\tCLA\r\tTAD GBL\r\tTAD (%d\r",strd());
				break;
			case -11:
				fprintf("\tCIA\r\tTADI STKP\r\tJMSI POP\r\tSMA SZA CLA\r\tCMA\r");
				break;
			case 11:
				fprintf("\tCIA\r\tTADI STKP\r\tJMSI POP\r\tSPA CLA\r\tCMA\r");
				break;
			case 12:
					fprintf("\tSNA\r\tJMP CC%d\r",strd());
				break;
			case 13:
				fprintf("\tJMSI POP\r\tDCA JLC\r\tSWP\r\tCALL 1,MPY\r\tARG JLC\r\tCDF1\r");
				break;
			case -14:
				fprintf("\tCALL 1,IREM\r\tARG 0\r\tCDF1\r");
				break;
................................................................................
			case 14:
				fprintf("\tJMSI POP\r\tDCA JLC\r\tSWP\r\tCALL 1,DIV\r\tARG JLC\r\tCDF1\r");
				break;
			case 15:
				fprintf("\tISZI JLC\r\tNOP\r");
				break;
			case 16:
				fprintf("\tMQL\r\tTAD STKP\r\tTAD (%d\r\tDCA STKP\r\tSWP\r\tJMPI POPR\r/\r",strd());
				break;
			case 17:
				pflg++;
			case -17:
				if (strl()>0) 
					fprintf("\tCLA\r\tTAD (%d\r\tDCA JLC\r\tTADI JLC\r",strd());
				else
					fprintf("\tCLA\r\tTAD STKP\r\tTAD (%d\r\tDCA JLC\r\tTADI JLC\r",strd());
				if (pflg==0)
					break;
			case 19:
				fprintf("\tJMSI PSH\r");
				break;
			case 20:
				fprintf("\tANDI STKP\r\tJMSI POP\r");
				break;
			case -20:
				fprintf("\tJMSI POP\r\tMQO\r");
				break;
			case 21:
				if (strl()>0) 
					fprintf("\tCLA\r\tTAD (%d\r",strd());
				else
					fprintf("\tCLA\r\tTAD STKP\r\tTAD (%d\r",strd());
				break;
			case 22:
				fprintf("\tDCA JLC\r\tTADI JLC\r");
				break;
			case 23:
				if (strl()<200)
					fprintf("\tJMP CC%d\r",strl());
				strd();
				break;
			case -23:
					fprintf("\tJMP CC%d\r",strd());
				break;
			case 24:
				fprintf("\tCIA\r\tTADI STKP\r\tJMSI POP\r\tSNA CLA\r\tCMA\r");
				break;
			case 25:
				fprintf("\tMQL\r\tCMA\r\tTADI JLC\r\tDCAI JLC\r\tSWP\r");
				break;
................................................................................
			case 26:
				fprintf("\tSNA CLA\r");
			case -26:
				fprintf("\tCMA\r");
				break;
			case 27:
				fputs("\tCIA\r");
				break;
			case 29:
				while (1) {
					t=fgetc();
					if (t=='$')
						break;
					fputc(t);
				}
		}
	}
	ltsz=ltpt-ltbf;
	fprintf("\tLAP\r\tCPAGE %d\rLCC0,\t%d\rXCC0,\tCC0\rCC0,\t\r",ltsz+2,-ltsz);
	p=ltbf;
	while (ltsz) {
		fprintf("%d",*p++);