diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index 55da378..cff0691 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -1346,10 +1346,16 @@ static int command(void) extern char *sc_tokens[];/* forward declaration */ char s2[33]="-"; if ((char)tok=='-') { - if (lex(&val,&str)==tNUMBER) { + int current_token=lex(&val,&str); + if (current_token==tNUMBER) { outval(-val,FALSE); code_idx+=opargs(1); break; + } else if (current_token==tRATIONAL) { + /* change the first bit to make the number negative */ + outval(val | 0x80000000,FALSE); + code_idx+=opargs(1); + break; } else { strcpy(s2+1, str); error(1,sc_tokens[tSYMBOL-tFIRST],s2);