Description
Semester: V
Experiment No. 12: 8-bit arithmetic operations using 8051
12a) Addition
MOV R0, #00
MOV A, r1 ;input1
ADD A, r2 ;input2
JNC LABEL
INC R0
LABEL: MOV r4, a
MOV 03, R0 ;(mov r3, r0 is invalid)
HERE: SJMP HERE
12b) Subtraction
Hints:
Use SUBB instruction; clear carry flag before using it
No SUB instruction in 8051.
Take 2’s complement if carry is generated.
12c) Multiplication
Hints:
MUL AB (BA= A x B)
12d) Division
Hints:
DIV AB ( A / B; Quotient in A, Remainder in B)




Reviews
There are no reviews yet.