TIS-100

TIS-100

View Stats:
rebb Jun 1, 2015 @ 3:28pm
Inverting SRC/DST System ?
I havent worked much with actual assembly myself ( other than some ARB shader programs ), but isn't most assembly of the format <Instruction> <Dest> <Source> ?

In this game it seems to be the other way around. Would it make sense to offer an "inverted mode", so people can use some of the "muscle memory" they may learn from this game to use on actual assembly more easily ?

Just a random thought.
Last edited by rebb; Jun 1, 2015 @ 3:30pm
< >
Showing 1-15 of 16 comments
Sheets Jun 1, 2015 @ 3:34pm 
Both forms are common. Most of the assembly I've written, even for Intel platforms, has the destination last (AT&T syntax.)
rebb Jun 1, 2015 @ 3:40pm 
Oh ok, thanks for clearing that up :) *crawls back under noob rock*
rebb, I'm with you. I'm used to the destination being on the left/first
ej Jun 5, 2015 @ 8:38am 
This syntax doesn't look like AT&T, except in operand order and AT&T syntax is much less popular.
My "muscle memory" is creating many frustrations due to this. I still write MOV incorrectly nearly all the time.
kschang77 Jun 6, 2015 @ 8:54pm 
It's "Intel Style" vs. "AT&T Style" (which has nothing to do with Big Endian vs. Little Endian)

Gamil Jun 7, 2015 @ 2:42am 
I've never seen asm with dst last.

That said, it was easy enough to switch gears.
Rhong Jun 7, 2015 @ 5:28am 
I've seen both. For example, on 68000 processors, it's move <src>,<dst>. PCs use Intel's architecture, though, and for some reason Intel decided to use the mov <dst>, <src> order.
dunbaratu Jun 7, 2015 @ 8:40am 
Originally posted by Tenjoy:
I've seen both. For example, on 68000 processors, it's move <src>,<dst>. PCs use Intel's architecture, though, and for some reason Intel decided to use the mov <dst>, <src> order.
Uhm. Doesn't the actual machine language underneath the hood not matter at all here? The assembly langauge syntax is an abstraction of the machine language opcodes anyway, so one person could write a 68000 assembler one way and someone else could write a 68000 assembler the other way around, and have both mapping to the same ML codes under the hood. The machine langauge isn't thinking in terms of "left" and "right" operands, but in terms of "lower addressed operand" and "higher addressed operand". Whether the person who wrote the ASM language chose to make the operand in the lower memory location be on the left or on the right is up to them.

tl;dr - It's who wrote the assembler that chooses, not who designed the chip. You can have two different assemblers targeting the same chips's opcodes.
Last edited by dunbaratu; Jun 7, 2015 @ 8:42am
Rhong Jun 7, 2015 @ 9:14am 
Originally posted by madings:
It's who wrote the assembler that chooses, not who designed the chip. You can have two different assemblers targeting the same chips's opcodes.
In theory, yes. But usually the processor's maker prefers one way to write the instructions, and most, if not all assemblers follow that.

If you check Intel's official documentation for their processors, you'll find that they use <dst>, <src> order. Motorola uses <src>, <dst> instead. So that's what you'll find in most assemblers targeting these respective chips.

Sorry for any confusion.
ej Jun 8, 2015 @ 8:16am 
With this chip binary representaton of data and opcodes is completely abstracted, by the way.
<dst> <src> also matches parameter order in many C library functions, such as strcpy
It is the dominating syntax for x86. x86-64. (AT&T several times more rare) Also on non-x86 Intel CPUs.
It is also used in most popular assemblers for Z80, ARM, MIPS, IBM Power, Atmel AVR, etc. etc.
More complex with CDC assember or 6502, because in these one of the operands is typically encoded in instruction mnemonic, no matter is it is source or destination. These can be called order-agnostic But more frequently it is destination anyway.
And AT&T is simply ugly, less readable.
ralferoo Jun 11, 2015 @ 2:53pm 
How about having something like "MOV src,dst" and a synonym "LD dst,src" or some such?
Pretty much every puzzle I realise after the first run I've put the operands in the wrong order at least once.
Teybeo Jun 19, 2015 @ 1:21pm 
Even though i'm used to DST, SRC C functions, i really prefer the SRC, DST because it follows the (western) left-to-right text order so it can be read "Move this SRC data to DST location" without the overhead of mentally reversing the order.
ej Jun 19, 2015 @ 1:33pm 
But if you imagine '=' instead of ',' ...
desertbilly Jun 19, 2015 @ 3:03pm 
I predate all this AT+T / GAS mumbo jumbo. I was writing code in the 1960s on IBM 360 mainframes in assembly. Back then it was Destination, Source. I have no trouble flipping it around though.
< >
Showing 1-15 of 16 comments
Per page: 1530 50

Date Posted: Jun 1, 2015 @ 3:28pm
Posts: 16