flat assembler
Message board for the users of flat assembler.
Index
> Windows > Direction flag problem |
Author |
|
bitRAKE 06 Apr 2013, 11:13
There are a couple things to note: first is that EDI will move one byte lower than you expect. This is because the order of operations are reversed from the forward direction method: compare, de-increment - verses - increment, compare.
It is also important to prevent buffer under-run. Commonly, this is done like so: Code: db "\" pMyPath db "PathFileName",0 Otherwise, algorithm seemed to work in debugger. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
06 Apr 2013, 11:13 |
|
AsmGuru62 07 Apr 2013, 01:48
Isn't the lines:
Code: @@: ... je @f jmp @b @@: ... same as these lines? Code: @@: ... jne @b ; --> no need for that --> @@: ... |
|||
07 Apr 2013, 01:48 |
|
sinsi 07 Apr 2013, 03:00
Don't forget that Windows expects the direction flag to be clear, so if you call a Windows function after that code it may crash. If you use STD you should always finish with CLD.
|
|||
07 Apr 2013, 03:00 |
|
marcinzabrze12 07 Apr 2013, 11:32
sinsi wrote: Don't forget that Windows expects the direction flag to be clear, so if you call a Windows function after that code it may crash. If you use STD you should always finish with CLD. THANK YOU. I just do not know it and i was meed this problem many times before. Realy problems with optimization are important too but it doesn't meaning when function crasheed. |
|||
07 Apr 2013, 11:32 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.