> Hmm. That depends on whether you want to include the > principals of assembly language or not. ARM assembly > language is just ... cruel, I think. I teach both PIC asm and ARM asm classes and if I had to pick the one that is cruel I would not hesitate one moment, and it would not be ARM! > (someone on a yahoo ARM > group pointed out that what would have been a MOVLW-like > instruction on most processors became one MOVLW-like > instructions and two ADDLW-like instructions when compiled > from C. But there is no law that you'd have to do the same when writing your own asm code! The reason is that ARM instructions are all 32 bit, so you can't load a 32 bit constant in one instruction. But comparing to a PIC MOVLW: you can load an 8-bit value in a single ARM instruction. Loading a 32 bit value can be done with an assembler pseudo-instruction, in gcc it would be: load r0, =123456 The effect is that 123456 is stored in code memory somewhere 'near' to this instruction, and the instyruction becomes a pc-relative indirect load. Compilers avoid this type of instruction, probably because they might not be able to find a suitable 'near' location. > It makes sense given the architecture, but... Eww! no, it makes sense for a compiler. Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist