flat assembler
Message board for the users of flat assembler.

Index > Main > 250F00 vs 83E00F : same or not ??? AND AX,$0F ???

Author
Thread Post new topic Reply to topic
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 12 Jan 2007, 02:18
I got this (use16 code) from NDISASM:

250F00 and ax,0xf

Recompiled with FASM.

Disassembled again:

83E00F and ax,byte +0xf

Confused Confused Confused

What's the problem ? Why does FASM assemble to different code ?
What does the strange syntax "byte +0xf" mean ?

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 12 Jan 2007, 02:18
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 12 Jan 2007, 02:50
Means that FASM decided to use imm8 with sign extention instead of using an imm of the size of the destination operand or using the AND acum, imm encoding.

Your first encoding corresponds to this encoding:
25 iw AND AX, imm16 AX AND i mm16

The second to this one:
83 /4 ib AND r/m16,imm8 r/m16 AND imm8 (sign-extended)
Post 12 Jan 2007, 02:50
View user's profile Send private message Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22 12 Jan 2007, 03:01
83D00F also represents (and ax,0fh)
^D instead of E

hurray for CISC !!!
Post 12 Jan 2007, 03:01
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
El Tangas



Joined: 11 Oct 2003
Posts: 120
Location: Sunset Empire
El Tangas 13 Jan 2007, 19:48
There are a lot of redundant encodings in x86. Probably it's possible to have a good guess of which assembler was used to create the executable by carefully analising the encodings.
Post 13 Jan 2007, 19:48
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.