#229 √ resolved
Peter Johnson

ISA non-complaint instructions

Reported by Peter Johnson | June 28th, 2011 @ 06:40 AM | in 1.2.0 (closed)

Originally posted on Trac by sirus@haxsys.net
Original Trac Ticket

  Description

The following instructions according to the Intel ISA should assemble but do not:

lfs RAX, tword [RBX] ;( error : invalid size for operand 1)
lgs RAX, tword [RBX] ;( error : invalid size for operand 1)
lss RAX, tword [RBX] ;( error : invalid size for operand 1)

movsx RAX, BH ;( error : cannot use A/B/C/DH with instruction needing REX)
movzx RAX, BH ;( error : cannot use A/B/C/DH with instruction needing REX)

Trac Attachments

h3. Trac Comments
comment:1

              Changed 11 hours ago by peter@tortall.net


For lfs/lgs/lss, you're right, they should indeed support 64-bit destinations and currently don't.  I'll get this fixed.

"movsx/movzx reg64, ah/bh/ch/dh" is not legal.  There's an explicit exception for this case in the Intel ISA manual: "In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix is used: AH, BH, CH, DH."  The REX prefix is needed to activate the 64-bit operand size (for reg64) so it's not legal to combine a reg64 destination with a ah/bh/ch/dh source.  The technical reason for this is when REX is used, it remaps the bit patterns used for ah/bh/ch/dh to instead mean sil,dil,bpl,spl (the low 8 bits of rsi,rdi,rbp,rsp respectively).

comment:2

              Changed 11 hours ago by sirus@haxsys.net


Ah you are correct there. My mistake about the movsx/movzx.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket

Tags