Welcome to #MOVember, one asm MOV instruction each day.
The Motorola MC68000 has a BEAST of a MOV instruction.
Official assembler mnemonic: MOVE. Refreshingly clear!
You could move to and from registers and/or memory. 8-, 16-, 32- data sizes. Post increment, predecrement. Including memory-to-memory moves (*Ferris Bueller soundtrack voice*: Oh Yeah).
`*d++ = *s++` is a single instruction in 68000.
Officially destination on the right: MOVE A7,D0 copies the A7 register to D0
Please
Day 2. The 8086 (which, sadly, we can't ignore)
The 8086 MOV can move data from register to register, and to and from memory.
Addressing modes are generous: register, indexed, displacement; all encoded with a confusing array of segment selectors and prefix bytes.
This MOV is the most frequent instruction in my (64-bit) implementation of Forth. By a long way.
MOV itself can’t do memory to memory moves, but stick around and we may learn of its super duper stringy cousins.
Day 3 of #MOVember and the grandad of many popular modern CPUs: Intel 8080.
Such a cute ISA, more regular than everything after. 7 (8-bit) registers, A B C D E H L, and you can MOV between any of them:
MOV x, y
A "pseudo register" M can be used to move data to and from the external memory location pointed to by the HL pair. MOV M, M was banned so the HALT instruction could be encoded.
Actually LDAX and STAX can also be used to move A to (BC) and (DE), but that's really MOV in disguise.
Day 4 of #MOVember
Just as the 8086 inherited from the 8080, the 68000 inherited from the PDP-11.
The PDP-11 has a mediocre 8 registers, but makes excellent use of 12 addressing modes.
The modes were orthogonal in two senses: any register; any instruction.
In truth there are 8 addressing modes.
The PC is one of the registers.
An additional 4 modes (PC-relative) are in fact 4 of the regular modes, but using register 7 (PC) as the base.
Destination on right, like the 68000
MOV ss, dd
Day 5 of #MOVember
The Z80 powered my first computer (ZX81), and was the first machine code that i learnt.
When is a MOV not a MOV? When it's a LD! The Z80 is a compatible extension of 8080 that, for copyright, has a different assembler syntax.
MOV, STAX, LDAX, MVI, and others have all been unified as LD (load).
A is the best register, and supports the most addressing modes:
LD A, reg ; from register
LD A, (HL|BC|DE|IX+dd|IY+dd) ; indirect
LA A, (nn) ; external addr
and the reverse.
@drj of all the different processor instruction sets I’ve forgotten, the Z80 was the easiest to pick up and then forget. And the 68000 was the one I wished I’d spent more time using.
The 8051 is probably the one most seared in my memory as I had to write code for it before the assembler arrived (i
n the post fro the US I think).