assembly - Memory address wont load -
I'm trying to move the value 0 into an address stored in the ax (assuming it's still writable is).
MOV AX, 0EC7; Writing Write BYTE [ax], 0
But, nasm is giving me this error:
Error: Invalid Effective Address
Any ideas?
The 16-bit addressing mode is quite limited. You can create an (optional) offset (a simple number), plus an (optional) base register ( bx
or bp
), plus one (optional) index register ( C
or di
). Bus.
In 32-bit addressing mode, a register can be a base register and a register but esp
can be an index register 32-bit addressing by multiplying by the index register Introduces one (optional) scale (1, 2, 4, or 8) for.
[eax]
will work - even the assembler in the 16-bit code generates "Address Size Override Prefix" byte (0x67). If the value in the eax
is greater than the volume limit (usually 64k), an exception is generated (not handled in the actual dos - it is still hanging), so be careful with it.
Comments
Post a Comment