flat assembler
Message board for the users of flat assembler.

Index > Main > (XCHG AX, BX) == (XCHG BX, AX)?

Author
Thread Post new topic Reply to topic
StrenoJr



Joined: 13 Mar 2014
Posts: 22
Location: Slovakia
StrenoJr 18 Aug 2014, 19:55
Hello.
I will start directly with some code.
Code:
xchg ax, bx
xchg bx, ax    
Debugger (GRDB) said that both of these instructions are "0x93".
Does fasm compile these instructions as 0x93 or is it physically the same instruction?
Thanks for reading.
Post 18 Aug 2014, 19:55
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 18 Aug 2014, 20:00
Yes it is physically the same instruction.

Code:
Code    Mnemonic        Description
90 + rw         XCHG AX, r16    Exchange r16 with AX
90 + rw         XCHG r16, AX    Exchange AX with r16
90 + rd         XCHG EAX, r32   Exchange r32 with EAX
90 + rd         XCHG r32, EAX   Exchange EAX with r32
86 / r  XCHG r/m8, r8   Exchange r8 (byte register) with byte from r/m8
86 / r  XCHG r8, r/m8   Exchange byte from r/m8 with r8 (byte register)
87 / r  XCHG r/m16, r16         Exchange r16 with word from r/m16
87 / r  XCHG r16, r/m16         Exchange word from r/m16 with r16
87 / r  XCHG r/m32, r32         Exchange r32 with doubleword from r/m32
87 / r  XCHG r32, r/m32         Exchange doubleword from r/m32 with r32
    

_________________
smaller is better
Post 18 Aug 2014, 20:00
View user's profile Send private message Reply with quote
StrenoJr



Joined: 13 Mar 2014
Posts: 22
Location: Slovakia
StrenoJr 18 Aug 2014, 20:05
Thanks for the fast reply.
Post 18 Aug 2014, 20:05
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.