flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
theguy
i'm wondering why this happens, if i
Code: push 0x89675414 mov eax,[esp-1] Then check the eax register with ollydbg it shows 67541400? Shouldn't it be 89675414? |
|||
![]() |
|
revolution
x86 uses a full-descending stack so to get the last value pushed you should do this:
Code: mov eax,[esp] |
|||
![]() |
|
theguy
Ok thank you, this noob appreciates it
|
|||
![]() |
|
JohnFound
And [esp-1] is incorrect always. If you want to get the previous pushed number you have to use [esp-4].
|
|||
![]() |
|
revolution
DOS386 wrote: Right. Since CPU architecture is bad ... 80386 and above still do use Byte AKA Octet as size unit, but they strongly prefer 32-bit processing. And I don't think that byte sized addressing is a flaw. It would be worse if we were forced to process EVERYTHING as 32-bit units. And becomes even more wasteful if 64-bit CPUs required 64-bit values for everything. Actually even 8-bits is a compromise because the x86 CPU can do single bit addressing and processing. |
|||
![]() |
|
l_inc
revolution
Quote: Actually even 8-bits is a compromise because the x86 CPU can do single bit addressing I don't think so. You can do bitwise arithmetics and introduce an artificial addressing scheme in form byte_address:bit_address, where byte_address is 32 to 64 bit long and bit_address is 3 bit long, but this cannot be viewed as a uniform addressing scheme, because the bit store ordering is completely transparent to the user with respect to the ISA. This differs to the byte addressing in standard 32 bit RISC architectures where native load-storing is 4-bytes wide and 4-bytes aligned, but the ISAs still allow bytewise load-storing, and this way the byte store ordering can be inferred from the returned byte value as well as affects the software logic in general (difference in endianness). That's why a byte is called to be the smallest addressable unit of memory. _________________ Faith is a superposition of knowledge and fallacy |
|||
![]() |
|
revolution
JohnFound wrote: If you want to get the previous pushed number you have to use [esp-4]. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.