Re: maybe a bit OT: EEPROMs and PCs
- From: Jure Sah <jure.sah@xxxxxxxxxxxxxx>
- Date: Sat, 13 Aug 2005 19:40:56 +0200
Herbert Kleebauer wrote:
Indead. This is the most important innovation introduced by NASM, and all of the actual Assemblers conform to this new and clean definition of the syntax basics.
If the above examples are correct, then MASM/TASM does it the correct way and the NASM/FASM form is completely illogical. We have a register set (let's use the names r0, r1, r2 ...) and a set of memory locations (m0, m1, m2, ..)
Now, a "mov r0,r1" moves the content of register 1
into register 0 (if we use the illogical "dest,src" form).
If it should be logical, then a "mov r0,m4" has to move the content of memory location 4 into register 0.
Oh, would you people stop arguing for once! =))
There is only one logical way to have things and it is the way they are done in binaries or as close as possible, because the things making it all work are called logic circuts and they just can't work when the input is illogically organized.
And then there is the diffirence between universal logic and human common sense (which isn't even global for one).
Now Intel don't uses r0,r1, .. but AL, DL, ... and the memory locations are numbers only without an "m" prefix, so we get:
mov al,dl ; move content of dl into al mov al,4 ; move content of memory location 4 into al
If you want to move the number 4 into al, you have to explicitly say so:
mov al,#4
But to use the word "offset" instead of a simple symbol like # is also illogical. If I want to load the constant number 4 into al, what has this to do with an "offset"?
There are only a few specifics in ASM that don't corespond to the underlying instructions directly. That's what makes ASM such a great thing to program in and that is why I need to use it to fill a BIOS chip.
Once you realize that in reality, there is no computer's number "4", there is only one long stream of 1s and 0s that is organized meaningfully by offsets, ranges and terminators, it becomes preety clear that "mov al,4" means absolutely nothing, unless you want your assembler to either guess or read your mind. In the end you'll have to allocate your memory space where you will put that 4 in a way that it can be recgotnized as "numerical value of four" (db I guess) and then provide that thing into your register, in effect using the offset and viola.
Go figure.
-- Model: INFJ Primary function: Coprocessor Secondary function: Cluster commander
Yes I'm a therian: http://www.wikitherian.org
Creationism & Darwin: "The bible says humans were supposed to use animals to do work for them and I like to work so I must be an animal!" .
- Follow-Ups:
- Re: maybe a bit OT: EEPROMs and PCs
- From: wolfgang kern
- Re: maybe a bit OT: EEPROMs and PCs
- From: Herbert Kleebauer
- Re: maybe a bit OT: EEPROMs and PCs
- References:
- maybe a bit OT: EEPROMs and PCs
- From: Jure Sah
- Re: maybe a bit OT: EEPROMs and PCs
- From: wolfgang kern
- Re: maybe a bit OT: EEPROMs and PCs
- From: Jure Sah
- Re: maybe a bit OT: EEPROMs and PCs
- From: wolfgang kern
- Re: maybe a bit OT: EEPROMs and PCs
- From: Jure Sah
- Re: maybe a bit OT: EEPROMs and PCs
- From: Frank Kotler
- Re: maybe a bit OT: EEPROMs and PCs
- From: Jure Sah
- Re: maybe a bit OT: EEPROMs and PCs
- From: Frank Kotler
- Re: maybe a bit OT: EEPROMs and PCs
- From: Betov
- Re: maybe a bit OT: EEPROMs and PCs
- From: Herbert Kleebauer
- maybe a bit OT: EEPROMs and PCs
- Prev by Date: Re: Go to CLAX and enjoy the difference
- Next by Date: Re: compare
- Previous by thread: Re: maybe a bit OT: EEPROMs and PCs
- Next by thread: Re: maybe a bit OT: EEPROMs and PCs
- Index(es):
Relevant Pages
|