diff --git a/stage1/High_level_prototypes/M0-macro.c b/stage1/High_level_prototypes/M0-macro.c index b868576..9aabfa9 100644 --- a/stage1/High_level_prototypes/M0-macro.c +++ b/stage1/High_level_prototypes/M0-macro.c @@ -159,7 +159,14 @@ void identify_macros(struct Token* p) { p->type = macro; p->Text = p->next->Text; - p->Expression = p->next->next->Text; + if(p->next->next->type & str) + { + p->Expression = p->next->next->Text + 1; + } + else + { + p->Expression = p->next->next->Text; + } p->next = p->next->next->next; } diff --git a/stage1/M0-macro.s b/stage1/M0-macro.s index 8d819a0..ca2061d 100644 --- a/stage1/M0-macro.s +++ b/stage1/M0-macro.s @@ -327,6 +327,7 @@ PUSHR R0 R15 PUSHR R1 R15 PUSHR R2 R15 + PUSHR R3 R15 ;; Main Loop :Identify_Macros_0 @@ -350,6 +351,9 @@ ;; Set p->Expression = p->next->next->Text LOAD32 R2 R2 0 ; Get Next->Next LOAD32 R0 R2 8 ; Get Next->Next->Text + LOAD32 R3 R2 4 ; Get Next->Next->type + CMPSKIP.NE R3 2 ; If node is a string + ADDUI R0 R0 1 ; Skip first char STORE32 R0 R1 12 ; Set Expression = Next->Next->Text ;; Set p->Next = p->Next->Next->Next @@ -366,6 +370,7 @@ :Identify_Macros_Done ;; Restore registers + POPR R3 R15 POPR R2 R15 POPR R1 R15 POPR R0 R15