Re: maybe a bit OT: EEPROMs and PCs
- From: "wolfgang kern" <nowhere@xxxxxxxxxxx>
- Date: Sat, 13 Aug 2005 22:44:53 +0200
Herbert replied after Betov, Frank, Jure and me
[about logic in syntax..]
| 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, ..)
I fully agree for the usage of register-numbers rather than names.
But I recommend the numbering by their physical order
(ie: in the order 'pushad' put registers onto stack)
| Now, a "mov r0,r1" moves the content of register 1
| into register 0 (if we use the illogical "dest,src" form).
Ok the source/destination order can be considered as personal
preference and I can't find too much logic in in the AT&T version:
ground school pupils calculate: 1+2=3
scientist use : x=a+b
| If it should be logical, then a "mov r0,m4" has to move the
| content of memory location 4 into register 0.
The 'm' sounds also logical,
BUT as we got that many addressing modes which can imply up to
two registers (16/32/64 bit), plus a scale, plus a segment,
plus a 8,16,+/-32 bit displacement or just an immediate memory
(seg:)offset, I don't see square brackets as a fault here
(not to mention that my keyboard got square brackets as prime keys).
| 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
mov al,4 ;means an immediate value on all 'not that weird' assemblers :)
| If you want to move the number 4 into al, you have to
| explicitly say so:
| mov al,#4
This seems to be reversed HLA/gcc syntax :)
I think only MASM break the standard expections,
I'd like to see:
mov al,[4] ;load rb0 from [DS:0004] ;"DS: implied"
rb0=[4]
mov al,4 'load rb0 with immediate value 04
rb0=4
Herbert, I know your preference for having the size cast in
the operation rather than with the operands, but I found it
more convenient and less confusing to use:
rqa=ZxD Sw[rip+..] ;movsx r10 word[rip+..] ;high dword quietly zeroed
rwc=Srb7 ;movsx r12w,dil ;high dword unaffected
I think your solution for Sx/Zx isn't too 'easy readable'.
| 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"?
Fully agree.
| > Hopefully, the "confusion" is now... gone.
| Not as long as this NASM syntax exist (to which "all of the
| actual Assemblers conform to").
Perhaps I didn't look close enough on NASM, but I have no problems
with memory operands in square brackets or with a single byte identifier
like RosAsm uses with the $-character
Rene, JFYI (I don't have a 'paragraph'-character on my keyboard),
and I'm not sure about many outside France got one :)
__
wolfgang
.
- Follow-Ups:
- Re: maybe a bit OT: EEPROMs and PCs
- From: Betov
- 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: maybe a bit OT: EEPROMs and PCs
- 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
|