Mini SubManual ahead:
Heater wrote:Interesting thread. I have not read all of it as it's getting rather long. So sorry if what I say has come up previously:
1) Assembly language, or should I say knowing a machine architecture and instruction set, is not "just another tool". It is the tool. Everything else rests on it. It's not like making a choice between C or Pascal or Python.
2) As such teaching assembler is important. I'm sure there will people wanting to invent new languages, compilers and tools in the future. They will need to be familiar with such things.
3) Assembler is not so hard. Kids were getting to grips with Z80 or 6502 assembler back in the 1980's. Why not now?
And ARM assembly is a thousand times simpler and more eloquent than those
4) I don't know so much about ARM assembler but if I was in a position to teach some assembler I would do it with something like a Propeller MCU from Parallax Inc. It is about the simplest most elegant assembly language ever. Being an MCU there is an immediate connection between outputting to a port and seeing that LED light up, which is always a good start.
If you like Propeller assembly you will love ARM assembly.
Where do you think that having every instruction be conditional came from? It is from the ARM.
Also on the ARM most instructions support a shift with zero overhead. And only the arm can do that as far as I know.
And the ARM allows you to specify if the flags are effected (sound famillier).
And here is the entire ARM instruction set(Ok there are a few not listed that have to do with things like floating point, and thumb.):
Code: Select all
AND ;Bitwize and.
EOR ;Bitwize Exclusive or.
RSB ;Reverse Subtract.
ADC ;Add with carry.
SBC ;Subtract with carry.
RSC ;Reverse subtract with carry.
TST ;Test bits (AND result not written).
TEQ ;Test for equilivence (EOR result not written).
CMN ;Compare Negated.
ORR ;Bitwize OR.
MOV ;Copy data between registors, or an immed to reg.
BIC ;Bit Clear.
MVN ;MOV negated.
MLA ;Multiply and acumulate.
BL ;Branch and link.
CDP ;Coprocessor Data Op.
LDC ;Load from Coprocessor.
LDM ;Load Multiple Registoes.
LDR ;Load Register.
LDRB ;Load Byte to Register.
MCR ;Coprocessor Registor Transfer (CP to ARM).
MRC ;Coprocessor Registor Transfer (ARM to CP).
MRS ;Move Status to Register.
MSR ;Move Register to status.
STC ;Coprocessor data transfer.
STM ;Store Multiple registers.
STR ;Store register.
STRB ;Store byte from Register.
SWI ;Software Interupt.
SWP ;Swap Register With Mem.
As you can see there are 36 ARM instructions. I do not count THUMB, and floating point is technicaly a coprocessor.
Also there are a few psudo instructions supported by most Assemblers for convenience:
Shifts are defined by the operand postfixes ROR, RRX, ASL, ASR, LSL, and LSR.
And the condition codes are:
Code: Select all
CS ;Carry set.
CC ;Carry Clear.
VS ;Overflow set.
VC ;Overflow Clear.
LS ;Lower or same.
LT ;Less than.
GT ;Greater than.
LE ;Less than or equal.
There are 16 user accassable registers, labeled R0 through r15, with R15 being the program counter.
So as you can see it probably would not take you long to learn the ARM. There are few addressing modes making it even simpler, and like the Propeller all instructions are exactly 32bits.