cpu32

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 215c349e8cdd79885540884c13124f469770668f
parent 361c3bdceab40bd8a9b5bae4b0abcdc1755c3c4e
Author: Brian Swetland <swetland@frotz.net>
Date:   Sat, 18 Feb 2012 06:45:35 -0800

a32: fix constant rules to reflect that constants are signed

Diffstat:
Ma32.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/a32.c b/a32.c @@ -638,7 +638,7 @@ void assemble_line(int n, unsigned *tok, unsigned *num, char **str) { if (is_register(tok[5])) { emit(instr | TO_B(to_register(tok[5])) | TO_D(to_register(tok[1]))); } else if (tok[5] == tNUMBER) { - if (num[5] > 65535) die("immediate too large"); + if ((num[5] > 65535) && ((num[5] & 0xFFFF8000) != 0xFFFF8000)) die("immediate too large"); emit(instr | 0x10000000 | TO_B(to_register(tok[1])) | TO_I16(num[5])); } else { die("expected register or #, got %s", tnames[tok[5]]);