aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-10-09 07:41:02 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-10-09 07:41:02 -0400
commitd5acdcb03fdf8ca5d38268211619b37f03ff2913 (patch)
tree04b119d62609fc174241e4173fe0e84217744d3f
parenta2dc6a991277d3079579b247be18369e981baed2 (diff)
Fix string formats for register loading off stack
-rw-r--r--gen_code.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/gen_code.c b/gen_code.c
index 41e9113..561e474 100644
--- a/gen_code.c
+++ b/gen_code.c
@@ -25,39 +25,39 @@ char **reg_stack, **reg_ptr;
int reg_cnt;
#define STACK_SAVE {\
- fprintf(stdout,
- "pushq\t%rax\n"\
- "pushq\t%rcx\n"\
- "pushq\t%rdx\n"\
- "pushq\t%rsi\n"\
- "pushq\t%rdi\n"\
- "pushq\tr8\n" \
- "pushq\tr9\n" \
- "pushq\t%r10\n"\
- "pushq\t%r11\n"\
- "pushq\t%r12\n"\
- "pushq\t%r13\n"\
- "pushq\t%r14\n"\
- "pushq\t%r15\n"\
- )\
+ fprintf(stdout, \
+ "pushq\t%%rax\n"\
+ "pushq\t%%rcx\n"\
+ "pushq\t%%rdx\n"\
+ "pushq\t%%rsi\n"\
+ "pushq\t%%rdi\n"\
+ "pushq\t%%r8\n" \
+ "pushq\t%%r9\n" \
+ "pushq\t%%r10\n"\
+ "pushq\t%%r11\n"\
+ "pushq\t%%r12\n"\
+ "pushq\t%%r13\n"\
+ "pushq\t%%r14\n"\
+ "pushq\t%%r15\n"\
+ );\
}
#define STACK_LOAD {\
- fprintf(stdout,
- "popq\t%r15\n"\
- "popq\t%r14\n"\
- "popq\t%r13\n"\
- "popq\t%r12\n"\
- "popq\t%r11\n"\
- "popq\t%r10\n"\
- "popq\tr9\n" \
- "popq\tr8\n" \
- "popq\t%rdi\n"\
- "popq\t%rsi\n"\
- "popq\t%rdx\n"\
- "popq\t%rcx\n"\
- "popq\t%rax\n"\
- )\
+ fprintf(stdout,\
+ "popq\t%%r15\n"\
+ "popq\t%%r14\n"\
+ "popq\t%%r13\n"\
+ "popq\t%%r12\n"\
+ "popq\t%%r11\n"\
+ "popq\t%%r10\n"\
+ "popq\t%%r9\n" \
+ "popq\t%%r8\n" \
+ "popq\t%%rdi\n"\
+ "popq\t%%rsi\n"\
+ "popq\t%%rdx\n"\
+ "popq\t%%rcx\n"\
+ "popq\t%%rax\n"\
+ );\
}
int gen_label(t)