flat assembler
Message board for the users of flat assembler.
Index
> Main > Relative Mov |
Author |
|
LocoDelAssembly 15 Feb 2014, 22:48
Code: mov al, [moffs8] mov ax, [moffs16] mov [moffs8], al mov [moffs16], ax . . . moffs8 db ? moffs16 db ? |
|||
15 Feb 2014, 22:48 |
|
alwaysnub 16 Feb 2014, 00:53
@ LocoDelAssembly
No. That makes the opcodes have an encoding of: mov r8,r/m8 mov r16,r/m16 mov r/m8,r8 mov r/m16,r16 I need an encoding with moffs. Read the Documentation for the mov instruction. The 64-ia-32-architectures software developer manual states that moffs is (A simple memory variable (memory offset). The actual address is given by a simple offset relative to the segment base. No ModR/M byte is used in the instruction. The number shown with moffs indicates its size.) |
|||
16 Feb 2014, 00:53 |
|
LocoDelAssembly 16 Feb 2014, 01:25
Same source (except I changed one "db" to "dw" and commented the periods), assembled, generated fas file and then ran through listing tool:
Code: 00000000: A0 0C 00 mov al, [moffs8] 00000003: A1 0D 00 mov ax, [moffs16] 00000006: A2 0C 00 mov [moffs8], al 00000009: A3 0D 00 mov [moffs16], ax ;. ;. ;. moffs8 db ? moffs16 dw ? |
|||
16 Feb 2014, 01:25 |
|
alwaysnub 16 Feb 2014, 01:34
Ok, after retesting, i found that it works if you are using use32 or use16 bit modes, but it does not give me the desired encoding in use64 mode.
Perhaps there's a way to force the moffs encoding in 64-bit mode? |
|||
16 Feb 2014, 01:34 |
|
revolution 16 Feb 2014, 02:17
alwaysnub wrote: Ok, after retesting, i found that it works if you are using use32 or use16 bit modes, but it does not give me the desired encoding in use64 mode. Code: use64 mov al, [qword moffs8] mov ax, [qword moffs16] mov [qword moffs8], al mov [qword moffs16], ax moffs8 db ? moffs16 dw ? |
|||
16 Feb 2014, 02:17 |
|
alwaysnub 16 Feb 2014, 02:22
Cool, that did it. Thanks guys.
|
|||
16 Feb 2014, 02:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.