flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Roman
I try compile in 64 bits jcxz and JECXZ and get error
illegal instruction. Op code E3h |
|||
![]() |
|
Ali.Z
jcxz cannot be encoded in long-mode.
the default is jrcxz in long-mode. jecxz is supported by using address size prefix. _________________ Asm For Wise Humans |
|||
![]() |
|
Roman
Funny but asm op. code the same.
A mean jrcxz and jecxz have op. code 0E3h |
|||
![]() |
|
revolution
In 64-bit there is no jcxz, The binary code it used for jecxz instead. This is known as a "promoted" instruction, because the base case is jrcxz.
The is the same for pop and push. The same binary code is used for 64-bits push/pop as that used for 32-bit mode. Meaning there is no 32-bit push/pop at all in 64-bit mode. |
|||
![]() |
|
Furs
Yeah, but jcxz is 16-bit, not 32-bit, so it's not the same as push/pop situation.
|
|||
![]() |
|
revolution
Yes, you are correct. I could have made that clearer.
|
|||
![]() |
|
Tomasz Grysztar
This all traces back to how 386 used special prefix rules for LOOP/JCXZ family of instructions. The choice of CX or ECX was controlled (unusually) by 67h prefix, while 66h prefix controlled the size of target address computation. You can easily test all the combinations:
Code: format PE at 400000h jecxz dword 401000h ; E3 jecxz word 1000h ; 66 E3 jcxz dword 401000h ; 67 E3 jcxz word 1000h ; 66 67 E3 In long mode the 67h prefix was kept, this time choosing between RCX and ECX, while 66h was discontinued, as obviously it would be quite useless. |
|||
![]() |
|
l4m2
So db 4x has totally no effect on E3, right?
|
|||
![]() |
|
Ali.Z
no, because *CX register is used implicitly.
_________________ Asm For Wise Humans |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.