Re: maybe a bit OT: EEPROMs and PCs



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



.



Relevant Pages

  • Re: HLA History
    ... No, not like Motorola syntax. ... and RAX all overlap in the register space. ... Now granted, the x86 instruction set, as defined by Intel, ... > contain size, anyway...not that if in the mnemonics, then it doesn't need ...
    (alt.lang.asm)
  • Re: again, external symbols in hla
    ... The processor doesn't use any names, it is the Intel assembler syntax ... The encoding of the instruction has nothing to do with the symbolic ... chosen assembly syntax is a pure mess. ... of a register, then list is the symbolic name of a memory location. ...
    (alt.lang.asm)
  • Re: 0x8024D007, automatic update service starting, REGSVR32 wuauen
    ... Yes, when I try to register wuaueng.dll, I get the same error (Invalid ... access to memory location) as when I try to start the BITS service. ... When I try to register wuaueng.dll by using the command REGSVR32 ... That would hopefully expose the source of the failure. ...
    (microsoft.public.windowsupdate)
  • Re: Betovs notation
    ... >> base on the same awful syntax with just a few improvements. ... and the destination is register 3. ... In the assembler source code ... the segment override should be written where it belongs: ...
    (alt.lang.asm)
  • Re: Tornado Computer Unit - Any info around?
    ... Now the following commands work: ... ADD (subtracts or adds a memory location to ... CLRA (clear accumulator) ... LDI (load index register, the next instruction is ...
    (rec.aviation.military)