Mercurial > hg > index.cgi
comparison lwasm/lwasm.c @ 380:17fcd0c3ee45
Allow multibyte ascii constants in m80ext mode
Allow multibyte ascii constants using ' in m80ext mode, with the allowed
size depending on the actual size of the register being referenced.
Thanks to Erik G <erik@6809.org> for the patch.
author | William Astle <lost@l-w.ca> |
---|---|
date | Mon, 13 Jul 2015 21:04:39 -0600 |
parents | 35d4213e6657 |
children | 80d615a6642c |
comparison
equal
deleted
inserted
replaced
379:d791d47afc48 | 380:17fcd0c3ee45 |
---|---|
518 (*p)++; | 518 (*p)++; |
519 | 519 |
520 return lw_expr_build(lw_expr_type_int, v); | 520 return lw_expr_build(lw_expr_type_int, v); |
521 } | 521 } |
522 | 522 |
523 /* double ASCII constant, like LDD #'MG */ | |
524 if (CURPRAGMA(as->cl, PRAGMA_M80EXT)) | |
525 { | |
526 if (((**p == '"') || (**p == '\'')) && (as->cl->genmode == 16)) | |
527 { | |
528 int v; | |
529 (*p)++; | |
530 if (!**p) | |
531 return NULL; | |
532 if (!*((*p) + 1)) | |
533 return NULL; | |
534 v = (unsigned char) **p << 8 | (unsigned char) *((*p) + 1); | |
535 (*p) += 2; | |
536 | |
537 if ((**p == '"') || (**p == '\'')) | |
538 (*p)++; | |
539 | |
540 return lw_expr_build(lw_expr_type_int, v); | |
541 } | |
542 } | |
543 | |
544 /* single ASCII constant, like LDA #'E */ | |
523 if (**p == '\'') | 545 if (**p == '\'') |
524 { | 546 { |
525 int v; | 547 int v; |
526 | 548 |
527 (*p)++; | 549 (*p)++; |