flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3, 4 |
Author |
|
Madis731 12 Mar 2011, 18:22
Of course there are pros and cons for both, but Intel chose little-endian format because then you can read a byte and a qword (or any other size) from the same offset:
Code: ; data @ 1234h: 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 ... mov rax,[1234h] ; rax=0807060504030201h mov eax,[1234h] ; eax=04030201h mov ax,[1234h] ; ax=0201h mov al,[1234h] ; al=01h with each read from memory al (the least significant byte) will still be 01h - the value at the first byte read from 1234h. With big-endian format you'd have to read a qword from 1234h, dword from 1238h, ..., byte from 123Bh. I've gotten used to little-endian so much that I wouldn't know how to use the other one. |
|||
![]() |
|
Madis731 12 Mar 2011, 18:41
@Teehee: You must code different subroutines for RM and PM. You can't expect them to work universally. I don't know what's behind your calls, but you definitely need to think these through. You cannot just move them around from RM to PM and vice-versa.
|
|||
![]() |
|
Goto page Previous 1, 2, 3, 4 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.