LAB 3 Introduction to Assembly programming1
LAB 3 Introduction to Assembly programming1
INTRODUCTION TO
ASSEMBLY
PROGRAMMING
OBJECTIVE
To develop basic concepts of assembly programming
END }
TO ACCESS GENERAL PURPOSE REGISTERS (R0-R7)
ORG 0
END
TO WRITE (OUTPUT) DATA ON I/O PORTS (P0-
P3)
ORG 0
END
TO READ (INPUT) DATA FROM I/O PORTS (P0-
P3)
ORG 0
MOV R0, P1 ; R0 = P1
MOV R1, P3 ; R1 = P3
MOV P2, P0 ; P2 = P0
END
TO ACCESS INDIVIDUAL BITS OF I/O PORTS
(P0-P3)
ORG 0
END
ADDITION
ADD A, <scr-byte> ; Add scr-byte to ‘A’ and
; saves result in ‘A’
ORG 0
END
EXERCISE I
a. Write a program which read port 1 and 2, add them
and then show the result on port 0.
b. Design proteus simulation for the above program
and test your program on it.
EXERCISE II
a. Write a program which read values from port1,
port2 and port3, add them and display result on port
0.
b. Design a proteus simulation for the above program.