Add C code to handle IMM16.

This commit is contained in:
Michael Munday 2016-12-02 14:20:59 -05:00
parent 2324be897e
commit 7181c391bd

View File

@ -264,12 +264,12 @@ void dasm_put(Dst_DECL, int start, ...)
b[pos++] = ofs; /* Store pass1 offset estimate. */ b[pos++] = ofs; /* Store pass1 offset estimate. */
break; break;
case DASM_IMM16: case DASM_IMM16:
CK(((short)n) == n, RANGE_I); /* TODO: unsigned immediates? */
ofs += 2; ofs += 2;
fprintf(stderr, "DASM_IMM16 not implemented\n"); b[pos++] = n;
break; break;
case DASM_IMM32: case DASM_IMM32:
ofs += 4; ofs += 4;
CK((n >> 32) == 0, RANGE_I);
b[pos++] = n; b[pos++] = n;
break; break;
case DASM_DISP20: case DASM_DISP20:
@ -433,7 +433,7 @@ int dasm_encode(Dst_DECL, void *buffer)
case DASM_LABEL_PC: case DASM_LABEL_PC:
break; break;
case DASM_IMM16: case DASM_IMM16:
fprintf(stderr, "DASM_IMM16 not implemented\n"); *cp++ = n;
break; break;
case DASM_IMM32: case DASM_IMM32:
*cp++ = n >> 16; *cp++ = n >> 16;