microprocessor laboratory 2: logical instructions

13

Upload: arkhom-jodtang

Post on 17-Aug-2015

133 views

Category:

Education


2 download

TRANSCRIPT

• Observation of Carry Flag

Solution

• ANL R2, R5• ANL R5, R2• ANL Rn, Rn

• ANL A, Rn • MOV A, R2• ANL A, R5

Solution

MOV A, R2ANL A, R5MOV R5, A

MOV A, R1ANL A, R4MOV R4, A

MOV A, R0ANL A, R3MOV R3, A

Entering Test Data (1)

• ; Write Test Data in the Code• MOV R0, #95H• MOV R1, #0EEH• MOV R2, #12H• MOV R3, #75H• MOV R4, #52H• MOV R5, #0F3H• ; Start your process• MOV A, R2• ANL A, R5

Entering Test Data (2)

Assign before Run the code In the Simulation software

Lab 2.4 Circuit Simulation 13. Use Circuit simulation software to simulate the MCS51 system circuit following

condition,a) Microcontroller MCS51 as a main processor

b) Port 1 and Port 3 as the input port, by each port connect to 8-bits Dip Switchc) Run the program for AND port 1 and Port 3

ORG 00HLoop:

MOV A,P1ANL A, P3

MOV P2,A ; Display to Port2JMP Loop

END

d) Display by Active High LED on port 2