From 6110f6e3a32245f7dbff78ec69c39d91d44d8b22 Mon Sep 17 00:00:00 2001 From: dschmenk Date: Thu, 10 Dec 2015 06:37:07 -0800 Subject: [PATCH] Fix constant address function call --- src/toolsrc/codegen.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/toolsrc/codegen.c b/src/toolsrc/codegen.c index 7655135..3bf7a11 100755 --- a/src/toolsrc/codegen.c +++ b/src/toolsrc/codegen.c @@ -684,10 +684,18 @@ void emit_brlt(int tag) } void emit_call(int tag, int type) { - int fixup = fixup_new(tag, type, FIXUP_WORD); - char *taglbl = tag_string(tag, type); - printf("\t%s\t$54\t\t\t; CALL\t%s\n", DB, taglbl); - printf("_F%03d%c\t%s\t%s\t\t\n", fixup, LBL, DW, type & EXTERN_TYPE ? "0" : taglbl); + if (type == CONST_TYPE) + { + printf("\t%s\t$54\t\t\t; CALL\t%i\n", DB, tag); + printf("\t%s\t%i\t\t\n", DW, tag); + } + else + { + int fixup = fixup_new(tag, type, FIXUP_WORD); + char *taglbl = tag_string(tag, type); + printf("\t%s\t$54\t\t\t; CALL\t%s\n", DB, taglbl); + printf("_F%03d%c\t%s\t%s\t\t\n", fixup, LBL, DW, type & EXTERN_TYPE ? "0" : taglbl); + } } void emit_ical(void) {