X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=macro.c;h=8d5d88e9b4f0ffe9ad1d8fdadb270181810aa8eb;hp=ccc93dc2f4cf84a1995b77fdbe19c81404484b71;hb=bdbf34766f4d074a5933eb1326fe4ce03d249e10;hpb=ff8188b7e279f99cf11ac8a283c4146af324d26f diff --git a/macro.c b/macro.c index ccc93dc..8d5d88e 100644 --- a/macro.c +++ b/macro.c @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for all Atari computers // MACRO.C - Macro Definition and Invocation -// Copyright (C) 199x Landon Dyer, 2011-2017 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2019 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source utilised with the kind permission of Landon Dyer // @@ -117,6 +117,7 @@ int defmac1(char * ln, int notEndFlag) curmac->lineList = malloc(sizeof(LLIST)); curmac->lineList->next = NULL; curmac->lineList->line = strdup(ln); + curmac->lineList->lineno = curlineno; curmac->last = curmac->lineList; } else @@ -124,6 +125,7 @@ int defmac1(char * ln, int notEndFlag) curmac->last->next = malloc(sizeof(LLIST)); curmac->last->next->next = NULL; curmac->last->next->line = strdup(ln); + curmac->lineList->lineno = curlineno; curmac->last = curmac->last->next; } @@ -224,6 +226,7 @@ WARNING("!!! Casting (char *) as LONG !!!") firstrpt = malloc(sizeof(LLIST)); firstrpt->next = NULL; firstrpt->line = strdup(line); + firstrpt->lineno = curlineno; nextrpt = firstrpt; } else @@ -231,6 +234,7 @@ WARNING("!!! Casting (char *) as LONG !!!") nextrpt->next = malloc(sizeof(LLIST)); nextrpt->next->next = NULL; nextrpt->next->line = strdup(line); + nextrpt->next->lineno = curlineno; nextrpt = nextrpt->next; } #endif @@ -264,7 +268,7 @@ int HandleRept(void) IREPT * irept = inobj->inobj.irept; irept->ir_firstln = firstrpt; irept->ir_nextln = NULL; - irept->ir_count = eval; + irept->ir_count = (uint32_t)eval; } return 0; @@ -413,8 +417,11 @@ int InvokeMacro(SYM * mac, WORD siz) else if (*tok == CONST) // Constants are 64-bits { *p++ = *tok++; // Token - *p++ = *tok++; // Hi LONG - *p++ = *tok++; // Lo LONG + uint64_t *p64 = (uint64_t *)p; + uint64_t *tok64 = (uint64_t *)tok; + *p64++ = *tok64++; + tok = (TOKEN *)tok64; + p = (uint32_t *)p64; } else if ((*tok == STRING) || (*tok == SYMBOL)) {