Professional Documents
Culture Documents
ARM has 37 registers in total, all of which are 32 bits long. 1 dedicated program counter, 1
dedicated current program status register, 5 dedicated saved program status registers and 30
general purpose registers. However, these are arranged into several banks. with the accessible
bank being governed by the processor mode. Each mode can access. A particular set of r0-r12
registers a particular r13 (the stack pointer) and r14 (link register), r15 (the program counter,
cpsr (the current program status register) and privileged modes can also access particular spsr
(saved program status register).
B. Describe the following shifting ARM instructions with example: LSL, LSR, ASR, ROR
LSL – LSL means Logical Shift Left. left shifts effectively multiply the content of a register
by 2s where is the shift amount.
EXMAPLE: MOV R0, R0, LSL 7
LSR – LSR means logical shift right. Right shifts behave like diving the contents of a register
by 2s where s is the shift amount.
EXAMPLE: MOV R0, R0, LSR 2
896
ASR – ASR means Arithmetic shift right . Arithmetic shift right behave like diving the
contents of a register by 2s where s is the shift amount.
EXAMPLE : MOV R0, R0, ASR 2
ROR – ROR means rotate right shift. Rotating shifts have no arithmetic analogy. However ,
the don’t lose bits like both logical and arithmetic shifts
EXMAPLE : MOV R0, R0, R0R 2
C. Explain following instruction set in ARM: Arithmetic instructions, Logical Instruction and
Branch Instructions
Arithmetic instructions – Only processor and registers are involved with the purposes. The
Arithmetic instructions define the set of operations performed by the processor Arithmetic
Logic Unit (ALU).
Logical Instruction – ARM logical operations include AND, ORR (OR), EOR (XOR), and
BIC (bit clear). Perform the Boolean operation on the pair or operands and are useful for bit
masking purposes, for an example clear status bit or change interrupt masks in CPSR.
The Arm Processor contains Z, N ,C and V flags which are updated by execution of data
processing instructions. Condition code for the flags, N= Negative result from ALU flag, Z =
Zero results from ALU flag, C= ALU operation Carried out, V = ALU operation overflowed.
Z (Zero) flag is set when the result of an instruction has a zero value or when a comparison of
two data returns an equal result. Then N (Negative) flag, this flag is set when the result of an
instruction has a negative value. The C (Carry ) flag will be set if the result of an unsigned
operation overflows the 32-bit result register. Lastly The V(Overflow) flag operates in the
same way as the C flag, but for signed operations.
A call subroutine is a set of instructions that are used repeatedly in a program, which can be
referred to Subroutine . Only one copy of this instruction is stored in the memory. When
subroutine is needed it can be called many times during the execution of a program.
INSTRUCTION
NEXT INSTRUCTION
REFERENCES
1) https://padlet.com/norsyira/my-verilog-uprocessor-zicutmysp8m
2) https://youtu.be/ibh4tadjUaw
3) https://youtu.be/Q4qu4ADTy9Q
4) https://youtu.be/xt2Q9n1Udb4
5) http://www.csbio.unc.edu/mcmillan/Comp411F18/Lecture07.pdf
6) https://youtu.be/X560ZGrZ2qc
7) https://www.geeksforgeeks.org/subroutine-subroutine-nesting-and-stack-memory/
8) https://www.keil.com/pack/doc/CMSIS/General/html/index.html
9) https://padlet.com/norsyira/my-verilog-uprocessor-zicutmysp8m/wish/379177555