forked from rileym65/Basic-02
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcasm.c
More file actions
35 lines (32 loc) · 1.01 KB
/
Copy pathcasm.c
File metadata and controls
35 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
*******************************************************************
*** This software is copyright 2021 by Michael H Riley ***
*** You have permission to use, modify, copy, and distribute ***
*** this software so long as this copyright notice is retained. ***
*** This software may not be used in commercial applications ***
*** without express written permission from the author. ***
*******************************************************************
*/
#include "header.h"
char* casm(char* line) {
char flag;
char aline[2048];
char *pline;
line = trim(line);
if (*line != 0) {
showError("Nothing can follow ASM on a line");
exit(1);
}
flag = -1;
while (flag) {
if (fgets(aline, 1023, source) == NULL) flag = 0;
else {
while (strlen(aline) > 0 && aline[strlen(aline)-1] <= 32) aline[strlen(aline)-1] = 0;
pline = aline;
pline = trim(pline);
if (strcasecmp(pline,"end") == 0) flag = 0;
else Asm(aline);
}
}
return line;
}