Re: newbie: MUL product




Brian asked:
[...]

Is little endian storage done on a byte by byte basis, a word by word
basis, or dword by dword?

Byte by byte.

If I understood the comment above correctly, you indicated that
writing ax to memory will write al then ah. Then, writing dx to the
same memory address (+ 2), will write dl, then dh. So that makes me
think that endian order is a byte by byte basis in memory, but all I
have to be concerned about is writing the low "register" first and the
high "register" last.... the processor will flip the bytes in the
individual registers automatically. Sound right?

Yes. Except there is no need to flip it
(the BUS and CPU architecur is designed that way).

x86 CPUs store data in an address powered order (little Endian)
[low byte at low address ...]

So you end up with:

xx00 al
xx01 ah
xx02 dl
xx03 dh

and can then read it with
MOV edx,[xx00]


JFYI: (not to add confusion yet)
A different story are "bits" in standard text-fonts
here the top-left dot is at bit 7 rather than at bit 0.
Perhaps this is just because stolen from Big Endian MAC :)
__
wolfgang





.



Relevant Pages

  • Re: Back to Being a Luddite (Oh Well)
    ... We had letter writing where you embedded the ... viruses in emails. ... CD- recorder "helpers" that sit in your system tray consuming memory ... system tray apps don't consume cycles. ...
    (comp.dcom.telecom)
  • Re: running Linux with no swap space (but lots of RAM)
    ... Some amount of caching is necessary to achieve such I/O scheduling. ... The amount of memory allocated to ... Someone who thinks writing to /dev/null would result in lots of data being ... TB of RAM and fits in an ATX case using no more than 550 watts of power. ...
    (comp.os.linux.development.system)
  • Re: Packed records not making sense
    ... next dword (size 4 ints) ... This makes memory access faster for some processor by "aligning" on ... > I was only able to get my app to read the source file ...
    (comp.lang.pascal.delphi.misc)
  • Re: Memory management and allocation
    ... > As I'm writing a piece of code that basically acts as a server and ... > memory management is a topic that is quite crucial. ... Or can I just allocate the variable ... Nor is it usually necessary to set the pointer to ...
    (comp.lang.c)
  • Re: Calling waveOut functions from Visual C++ 2005?
    ... DWORD dwParam1, DWORD dwParam2); ... static WAVEHDR* waveHeaderPtr; ... // Now prepare the header using waveOutPrepareHeader ... I am allocating memory for the wave samples using the C native malloc ...
    (microsoft.public.win32.programmer.mmedia)