Arm Assembly Programs
Arm Assembly Programs
Arm Assembly Programs
Before execution
40000000: 11 22 33 44
After execution
4000003F:11 22 33 44
TTL 16bitdatatrans
AREA Program, CODE, READONLY
ENTRY
START
LDRB R1, VALUE
STR R1, RESULT
SWI &11
VALUE DCW &C123
ALIGN
RESULT DCW 0
END
ARITHMETIC INSTRUCTIONS
Before execution
40000000: 11 22 33 44
40000004:55 66 77 88
After execution
40000008: CC AA 88 66
4. Addition of two 32 bit numbers and Store the result with Carry
in Memory
AREA Program, CODE, READONLY
ENTRY
start
MOV R0,#0x40000000
LDR R1,[R0]
ADD R0,R0,#04
LDR R2,[R0]
ADDS R1,R1,R2
ADD R0,R0,#04
STR R1,[R0]
EOR R1,R1,R1
ADC R1,R1,#0X00
ADD R0,R0,#04
STR R1,[R0]
SAME B SAME
END
Before execution
40000000: 11 22 33 44
40000004:55 66 77 88
After execution
40000008: CC AA 88 66
5. Addition of two 16 bit numbers
TTL 16bitadd
AREA Program, CODE, READONLY
ENTRY
START
VALUE1 DCW &C123
ALIGN
VALUE1 DCW &02AA
ALIGN
RESULT DCW 0
LDR R1, VALUE1
LDR R2, VALUE2
ADD R1, R1, R2
STR R1, RESULT
HERE
B HERE
END
Input R1:
Output R2:
TTL ONESCOMP