#19 code \3[456] probably needs to be split

closed-accepted
None
7
2002-05-30
2002-05-27
Anonymous
No

The \3[456] codes switch between word and dword, based on address size.

They are used for far JMPs and far CALLs, the A0-A3 MOVs, and the 68 PUSH imm.

While the displacements of those MOVs do depend of the address size, the offsets
of those far JMPs and far CALLs, as well as the immediate of that PUSH do depend
on operand size, not address size.

The following example demonstrates the problem for the far JMPs and far CALLs:

; assemble this with -f obj

label:

bits 16
call far dword label
; emits 66h, but word offset

bits 32
call far word label
; emits 66h, but dword offset

To fix this problem, I suggest to clone \4[456] from \3[456], so that one of the two can
look at address size, and the other one at operand size.

PS: The 68 PUSH imm case doesn't show up, because it is preceded by an explicit
imm16 case and an explicit imm32 case in the instruction database -- and those two
go through a different set of codes.

Discussion

  • H. Peter Anvin

    H. Peter Anvin - 2002-05-27

    Logged In: YES
    user_id=58697

    Bug confirmed. Patch forwarded to mailing list.

     
  • H. Peter Anvin

    H. Peter Anvin - 2002-05-27
    • priority: 5 --> 7
    • assigned_to: nobody --> hpa
    • status: open --> pending-accepted
     
  • H. Peter Anvin

    H. Peter Anvin - 2002-05-27
    • status: pending-accepted --> open-accepted
     
  • H. Peter Anvin

    H. Peter Anvin - 2002-05-30

    Logged In: YES
    user_id=58697

    Fix checked into CVS.

     
  • H. Peter Anvin

    H. Peter Anvin - 2002-05-30
    • status: open-accepted --> closed-accepted
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks