mov dx, 1f6h

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
St8ic

mov dx, 1f6h

Post by St8ic »

This line doesn't work on nasm. It give two errors:

"warning: byte value exceeds bounds"

"'obj' output driver does not support one-byte relocations"
jcmatias

RE:mov dx, 1f6h

Post by jcmatias »

try mov dx, 0x1f6
St8ic

RE:mov dx, 1f6h

Post by St8ic »

"try mov dx, 0x1f6"

already did. No change.
ASHLEY4

RE:mov dx, 1f6h

Post by ASHLEY4 »

This is the reason, but as i do not understand c maybe some one can convert.

case 020: case 021: case 022:
if (ins->oprs[c-020].offset < -256 || ins->oprs[c-020].offset > 255)
    errfunc (ERR_WARNING, "byte value exceeds bounds");
bytes[0] = ins->oprs[c-020].offset;
out (offset, segment, bytes, OUT_RAWDATA+1, NO_SEG, NO_SEG);
offset += 1;
break;

ASHLEY4.
Anton

RE:mov dx, 1f6h

Post by Anton »

Well, somehow the compiler mixex up the "dx" with the byte. :)
Does "mov dx, 1f0h" give an error, or is it only with this magic number?
What about "mov ax,1f6"?
Do you have any code settings(compiler hints) before this instruction?(default operand size-you know)
Anton.
St8ic

RE:mov dx, 1f6h

Post by St8ic »

no compiler hints, and 1f*h gets an error. Any ideas?
SystemHalted

RE:mov dx, 1f6h

Post by SystemHalted »

Did you try "mov dx, 01f6h" or "mov dx, 0x01f6"
GT

RE:mov dx, 1f6h

Post by GT »

The line works perfectly fine under NASM 0.98.38.
GT

RE:mov dx, 1f6h

Post by GT »

There are a number of Intel instructions that take byte sized offsets, such as a short Jcc (jump on condition code).  This code complains if you're trying to assemble one of those instructions but your offset is too big.

Note: it would never be called while assembling "mov dx,1f6h".  Since this assembles perfectly fine under NASM, I assume the poster's actual problem is with some other line of code.  Alas, not enough context was posted to determine where exactly the problem is...
Anton

RE:mov dx, 1f6h

Post by Anton »

Could you post the code around it(before and after)? It's hard to judge just by one instruction. :)
Anton
Post Reply