¡Esta es una revisión vieja del documento!
Introducción a las instrucciones ARM
Vamos a introducir brevemente en el conjunto de instrucciones de ARM y su uso general. Es importante para nosotros entender cómo funciona ensamblador, cómo se conectan las instrucciones y parámetros entre sí y qué se puede lograr al combinarlos.
Como hemos mencionado, el lenguaje ensamblador se compone de instrucciones, que son los bloques de construcción principales. Las instrucciones ARM generalmente van seguidas de uno o dos operandos y generalmente usan la siguiente plantilla:
MNEMONICO{S}{condition} {Rd}, Operand1, Operand2
¿Que significa mnemónico? https://es.wikipedia.org/wiki/Mnem%C3%B3nico
Dada la flexibilidad del conjunto de instrucciones ARM, no todas las instrucciones usan todos los campos provistos en la plantilla. Sin embargo, el propósito de los campos en la plantilla se describe a continuación:
MNEMONICO - Short name (mnemonic) of the instruction
{S} - An optional suffix. If S is specified, the condition flags are updated on the result of the operation
{condition} - Condition that is needed to be met in order for the instruction to be executed
{Rd} - Register (destination) for storing the result of the instruction
Operand1 - First operand. Either a register or an immediate value
Operand2 - Second (flexible) operand. Can be an immediate value (number) or a register with an optional shift
Mientras que los campos MNEMONICO, S, Rd y Operand1 son sencillos, la condición y los campos Operand2 requieren un poco más de aclaración. El campo de condición está estrechamente relacionado con el valor del registro CPSR, o para ser precisos, valores de bits específicos dentro del registro. El operando2 se llama operando flexible, porque podemos usarlo de varias formas: como valor inmediato (con un conjunto limitado de valores), registro o registro con shift. Por ejemplo, podemos usar estas expresiones como Operand2:
#123 - Immediate value (with limited set of values). Rx - Register x (like R1, R2, R3 ...) Rx, ASR n - Register x with arithmetic shift right by n bits (1 = n = 32) Rx, LSL n - Register x with logical shift left by n bits (0 = n = 31) Rx, LSR n - Register x with logical shift right by n bits (1 = n = 32) Rx, ROR n - Register x with rotate right by n bits (1 = n = 31) Rx, RRX - Register x with rotate right by one bit, with extend
Como un ejemplo rápido de cómo se ven los diferentes tipos de instrucciones, veamos la siguiente lista.
ADD R0, R1, R2 - Adds contents of R1 (Operand1) and R2 (Operand2 in a form of register) and stores the result into R0 (Rd) ADD R0, R1, #2 - Adds contents of R1 (Operand1) and the value 2 (Operand2 in a form of an immediate value) and stores the result into R0 (Rd) MOVLE R0, #5 - Moves number 5 (Operand2, because the compiler treats it as MOVLE R0, R0, #5) to R0 (Rd) ONLY if the condition LE (Less Than or Equal) is satisfied MOV R0, R1, LSL #1 - Moves the contents of R1 (Operand2 in a form of register with logical shift left) shifted left by one bit to R0 (Rd). So if R1 had value 2, it gets shifted left by one bit and becomes 4. 4 is then moved to R0.
you see this when javscript or css is not working correct