Add support for float negative values to #emit
Signed-off-by: VVWVV <d0u61ev@gmail.com>
This commit is contained in:
parent
6a3ab7c9f4
commit
b75c633ad7
@ -1346,10 +1346,16 @@ static int command(void)
|
|||||||
extern char *sc_tokens[];/* forward declaration */
|
extern char *sc_tokens[];/* forward declaration */
|
||||||
char s2[33]="-";
|
char s2[33]="-";
|
||||||
if ((char)tok=='-') {
|
if ((char)tok=='-') {
|
||||||
if (lex(&val,&str)==tNUMBER) {
|
int current_token=lex(&val,&str);
|
||||||
|
if (current_token==tNUMBER) {
|
||||||
outval(-val,FALSE);
|
outval(-val,FALSE);
|
||||||
code_idx+=opargs(1);
|
code_idx+=opargs(1);
|
||||||
break;
|
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 {
|
} else {
|
||||||
strcpy(s2+1, str);
|
strcpy(s2+1, str);
|
||||||
error(1,sc_tokens[tSYMBOL-tFIRST],s2);
|
error(1,sc_tokens[tSYMBOL-tFIRST],s2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user