-1

Is this a hardware, logic gate determination or a software determination? Where specifically does the syntax get determined and how?

So for instance

mov ax, 1234h

How would u implement the syntax here? So if I wanted it to look like

Mov[ax]1234h

How would I make it readable to the computer? In other words is this something that can be changed via software or is it physically determined?

user3929948
  • 37
  • 1
  • 6
  • 1
    It's unclear what you mean. The syntax of the assembly source file is determined by the assembler program that processes it. – Jester Feb 15 '16 at 20:41
  • 1
    ...and that syntax will vary between assemblers. – Weather Vane Feb 15 '16 at 20:45
  • Possible duplicate of [Are Instruction set architecture binary (not readable) or human-readable?](http://stackoverflow.com/questions/35235216/are-instruction-set-architecture-binary-not-readable-or-human-readable) – Martin Zabel Feb 15 '16 at 21:42
  • read the asm tag wiki http://stackoverflow.com/tags/assembly/info. It pretty much explains what an assembler is. – Peter Cordes Feb 15 '16 at 23:09
  • What determines the syntax of a assembly language? What part don't u understand? – user3929948 May 28 '18 at 21:26

1 Answers1

3

It's determined by the assemblers, that is, software.

For x86, there exist two conventional syntaxes: AT&T and Intel syntax. While the former is used in GNU as and the GNU toolchain and programs built with it in general, the Intel syntax is the syntax described in the Intel Manual and used in products by Intel.
These syntaxes are determined by the assemblers, which translate instructions to machine code. Theoretically speaking, I could invent a new syntax, write an assembler for it (or alter the grammar of an already existing one), and use it.

The hardware does not know about the assembly syntax. It can only process the bits and bytes an instruction represents. nop, for example, corresponds to 0x90 = 0b10010000. You could write entire programs like Counterstrike using just these binary codes, so no assembler is actually needed.

cadaniluk
  • 15,027
  • 2
  • 39
  • 67