flat assembler
Message board for the users of flat assembler.

Index > Main > F3 prexif for ins/outs ???

Author
Thread Post new topic Reply to topic
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 22 Jun 2010, 18:46
f2 = rep in case of ins/outs
f2 = repz in stos/lods/movs
f3 = repnz in scas/movs

ins/outs dont use f3 prefix be definition.


ollydbg and fasm allow encoding of f# prefix. is that a bug?
ollydbg doesnt allow repz, but allow repnz and rep, wtf?!
Post 22 Jun 2010, 18:46
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 22 Jun 2010, 19:39
fasm does not perform any kind of validation on prefixes, things like "lock fs rep xor eax, eax" are accepted and interpreted in the same way like this:
Code:
lock
fs
rep
xor eax, eax    


BTW, I think you have your prefixes wrong, F3 is for REP and REPE/REPZ, and F2 for REPNE/REPNZ
Post 22 Jun 2010, 19:39
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 22 Jun 2010, 20:00
LocoDelAssembly wrote:
fasm does not perform any kind of validation on prefixes…
And it probably shouldn't. I've heard about "rep ret" AMD optimization, should FASM disallow it?
Post 22 Jun 2010, 20:00
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 22 Jun 2010, 20:49
I don't know, but I'm sure it is not a bug as I understand it as part of fasm's syntax. However, since you're allowed to insert prefixes as instructions (like DOS's Debug program), maybe it should and also ensure the instruction size is not exceeding the limit by introducing too many prefixes (not taking into account previous assembled lines that may have left prefixes with no instruction at the end).
Post 22 Jun 2010, 20:49
View user's profile Send private message Reply with quote
b1528932



Joined: 21 May 2010
Posts: 287
b1528932 22 Jun 2010, 21:17
ok ur right

its very confusing, many mnemonics may correspont to 1 opcode, and many opcodes may correspont to 1 mniemonc.

ehh...
Post 22 Jun 2010, 21:17
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 22 Jun 2010, 21:39
LocoDelAssembly wrote:
However, since you're allowed to insert prefixes as instructions (like DOS's Debug program), maybe it should and also ensure the instruction size is not exceeding the limit by introducing too many prefixes (not taking into account previous assembled lines that may have left prefixes with no instruction at the end).
I don't think that FASM should question sanity of the programmer. ;-)
b1528932 wrote:
its very confusing, many mnemonics may correspont to 1 opcode, and many opcodes may correspont to 1 mniemonc.
2+2 has the same numerical value as 4 does, isn't it confusing? Mnemonics are just devices to simplify coding, not to improve understanding of processor architecture.
Post 22 Jun 2010, 21:39
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.