flat assembler
Message board for the users of flat assembler.

Index > Main > poor intel documentation

Author
Thread Post new topic Reply to topic
Ali.Z



Joined: 08 Jan 2018
Posts: 362
Ali.Z
Code:
somewhere:
xor ecx,ecx
loop somewhere    


intel clearly said "decrement counter and then check if counter is 0" so that means if ecx is 0 already it should loop.
and thats fine, and we all know this.

however in intel's code samples, representing x86 asm in C\CPP intel represented the loop instruction in a wrong way.
saying that it first check if the counter is 0 and if its not it takes the loop, so thats probably a mistake made by intel.

_________________
Asm For Wise Humans
Post 11 Oct 2019, 15:56
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17476
Location: In your JS exploiting you and your system
revolution
One way to be sure is to test it and see which of the two descriptions actually happens.
Post 11 Oct 2019, 16:13
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 776
Location: Belarus
DimonSoft
First one.

I wouldn’t tell C/C++ examples serious while talking about instructions. After all, they’re not documentation and are rarely written by people who actually spen much time using the instructions directly.
Post 11 Oct 2019, 19:50
View user's profile Send private message Visit poster's website Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 362
Ali.Z
i know its the first one, im just saying there are some mistakes.

_________________
Asm For Wise Humans
Post 12 Oct 2019, 06:05
View user's profile Send private message Reply with quote
fpissarra



Joined: 10 Apr 2019
Posts: 64
fpissarra
Where are you getting the Intel C/C++ equivalent code? It is not in Intel 64 and IA-32 Architectures Software Development Manual Vol 2. There, the behavior of the instruction is well defined in pseudo-code.
Post 12 Oct 2019, 13:24
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.