comparison os9/mc09/mc.c @ 100:990add11e9f8

add micro-c stuff
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 27 Dec 2018 11:49:54 +0900
parents 92ed427b7f7d
children 15569aa4098e
comparison
equal deleted inserted replaced
99:92ed427b7f7d 100:990add11e9f8
2 #define DEBUG error(-1) 2 #define DEBUG error(-1)
3 3
4 /*#include "CCLIB.TXT" 4 /*#include "CCLIB.TXT"
5 */ 5 */
6 #include <stdio.h> 6 #include <stdio.h>
7
8 /* to avoid conflict with stdio.h */
9 #define getline getline1
10 #define index index1
7 11
8 #define INT (-1) 12 #define INT (-1)
9 #define CHAR (-2) 13 #define CHAR (-2)
10 #define UNSIGNED (-3) 14 #define UNSIGNED (-3)
11 #define POINTER (-4) 15 #define POINTER (-4)
233 if (!chk) fprintf(stderr, 237 if (!chk) fprintf(stderr,
234 "Total internal labels : %u.\n",labelno-1); 238 "Total internal labels : %u.\n",labelno-1);
235 fprintf(stderr, 239 fprintf(stderr,
236 "Total global variables : %u bytes.\n\n",gpc); 240 "Total global variables : %u bytes.\n\n",gpc);
237 printf("_%d\tRTS\n_INITIALIZE\tEQU\t_1\n",ilabel); 241 printf("_%d\tRTS\n_INITIALIZE\tEQU\t_1\n",ilabel);
238 printf("_GLOBALS\tEQU\t%u\n\tEND\n",gpc); 242 printf("_GLOBALS\tEQU\t%u\n",gpc);
239 exit(0); 243 exit(0);
240 } 244 }
241 fprintf(stderr,"%5d:%s.\n",lineno, 245 fprintf(stderr,"%5d:%s.\n",lineno,
242 (n==FILERR) ? "Can't open specified file" : 246 (n==FILERR) ? "Can't open specified file" :
243 (n==DCERR) ? "Declaration syntax" : 247 (n==DCERR) ? "Declaration syntax" :