Limits check in assembler seemed to break on 32 bit systems, fixed

Fix:
Replaced the integer literals with macros from the <climits.h>
library.
This commit is contained in:
Thomas Fehmel
2016-11-25 12:02:05 +01:00
parent f662ba4d89
commit 2ecf87635c

View File

@@ -3,6 +3,7 @@
* - checking instruction parameters for their validity
*/
#include <stdio.h>
#include <limits.h>
#include "../inc/msg.h"
#include "../inc/global.h"
@@ -58,7 +59,7 @@ int unsigned4(int imm) {
* imm: immediate to be checked
*/
int word(int imm) {
if ((imm >= -2147483648) && (imm <= 2147483647)) {
if ((imm >= INT_MIN) && (imm <= INT_MAX)) {
// in valid range
return imm;
} else {