mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-22 01:31:33 +00:00
Added Resume statement
This commit is contained in:
parent
2b5f96c7d0
commit
223f7bbb97
12
src/stmnt.c
12
src/stmnt.c
@ -21,6 +21,7 @@
|
|||||||
void bgnblk(char blkchr) {
|
void bgnblk(char blkchr) {
|
||||||
DEBUG("Beginning program block\n", 0)
|
DEBUG("Beginning program block\n", 0)
|
||||||
if (blkchr) {
|
if (blkchr) {
|
||||||
|
DEBUG("Expecting Block Delimiter '%c'\n", blkchr);
|
||||||
expect(blkchr);
|
expect(blkchr);
|
||||||
inblck = TRUE;
|
inblck = TRUE;
|
||||||
}
|
}
|
||||||
@ -372,11 +373,16 @@ void ppush(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* parse and compile return statement */
|
/* parse and compile return statement */
|
||||||
void pretrn(void) {
|
void pretrn(int INTRPT) {
|
||||||
DEBUG("Parsing RETURN statement\n", 0)
|
DEBUG("Parsing RETURN statement\n", 0)
|
||||||
skpspc();
|
skpspc();
|
||||||
|
if (INTRPT) {
|
||||||
|
expect(';');
|
||||||
|
asmlin("RTI", "");
|
||||||
|
} else {
|
||||||
prsfpr(';'); //Parse Function Return Valuea
|
prsfpr(';'); //Parse Function Return Valuea
|
||||||
asmlin("RTS", "");
|
asmlin("RTS", "");
|
||||||
|
}
|
||||||
lsrtrn = TRUE; //Set RETURN flag
|
lsrtrn = TRUE; //Set RETURN flag
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -524,8 +530,10 @@ void pstmnt(void) {
|
|||||||
ppop();
|
ppop();
|
||||||
else if (wordis("PUSH"))
|
else if (wordis("PUSH"))
|
||||||
ppush();
|
ppush();
|
||||||
|
else if (wordis("RESUME"))
|
||||||
|
pretrn(TRUE);
|
||||||
else if (wordis("RETURN"))
|
else if (wordis("RETURN"))
|
||||||
pretrn();
|
pretrn(FALSE);
|
||||||
else
|
else
|
||||||
prssym();
|
prssym();
|
||||||
if (lblcnt && !inblck) {
|
if (lblcnt && !inblck) {
|
||||||
|
Loading…
Reference in New Issue
Block a user