I found missing one instruction after SETB P3.3 instruction in the source code of , this instruction is ANL A, R2 ; Get lower half(4h)of A, (#55 of Ch.2PPT) Please insetrt it or recopy source code...

1 answer below »

I found missing one instruction after SETB P3.3 instruction in the source code of , this instruction is

ANL A, R2 ; Get lower half(4h)of A, (#55 of Ch.2PPT)

Please insetrt it or recopy source code from updated Project 2 Supplement Material from BB.

The correct source code is below:

; Project 2Ans combining Project 1 with project 2

; system clock 100.0 Mhz, Update Freq. 1000

; from Project 1, calculate XXXXXXXXXX/5 + 12*3 - 20 =36d (24h)

MOV A,#13 ;|

MOV B,#5 ;|

DIV AB ;|

MOV R0,A ;|

MOV A,#18 ;|

ADD A,R0 ;|

MOV R0,A ;|

MOV A, #12 ;|

MOV B,#3 ;|

MUL AB ;|

ADD A,R0 ;|

MOV R0,#20 ;|

SUBB A,R0 ;| Result of Project 1 = 24h

; Load seg. code of Hex to data memory

MOV 30H, #11111111B ; STORE SEG CODE FOR "0"

MOV 31H, #11111001B ; STORE SEG CODE FOR "1"

MOV 32H, #10100100B ; STORE SEG CODE FOR "2"

MOV 33H, #10110000B ; STORE SEG CODE FOR "3"

MOV 34H, #10011001B ; STORE SEG CODE FOR "4"

MOV 35H, #10010010B ; STORE SEG CODE FOR "5"

MOV 36H, #10000010B ; STORE SEG CODE FOR "6"

MOV 37H, #11111000B ; STORE SEG CODE FOR "7"

MOV 38H, #10000000B ; STORE SEG CODE FOR "8"

MOV 39H, #10010000B ; STORE SEG CODE FOR "9"

MOV 3AH, #10001000B ; STORE SEG CODE FOR "A"

MOV 3BH, #10000011B ; STORE SEG CODE FOR "b"

MOV 3CH, #11000110B ; STORE SEG CODE FOR "C"

MOV 3DH, #10100001B ; STORE SEG CODE FOR "d"

MOV 3EH, #10000110B ; STORE SEG CODE FOR "E"

MOV 3FH, #10001110B ; STORE SEG CODE FOR "F"

MOV R2, #00001111B ; R2 IS a MASK

; MOV A, #11101111B ; ASSUME A = EFh for debug Proj.2 code

MOV B, A ; SAVE A IN B (24h)

START:

SETB P3.4

CLR P3.3 ; Lower half of A dispalys at position 2

ANL A, R2 ; Get lower half(4h)of A, (#55 of Ch.2PPT)

ADD A,#00110000B ; access seg. code in data memory

MOV R1, A

MOV A, @R1 ; indirect mode to load seg. code to A

MOV P1, A ; seg. code of lower half of A in P1

CALL DELAY

MOV A,B ; A = B = 24h

SWAP A ; for displaying hither half of A,(#55 of Ch.2PPT)

MOV B,A ; save 42h in B

SETB P3.3 ; Higher half of A dispalys at position 2 ANL A, R2 ; get lower half of A (2h)

ANL A, R2 ; Get lower half(4h)of A, (#55 of Ch.2PPT)

ADD A,#00110000B ; access seg. code in data memory

MOV R1, A

MOV A, @R1 ; indirect mode to load seg. code to A

MOV P1, A ; seg. code of lower half of A in P1

CALL DELAY

MOV A,B ;

SWAP A ; back original value of A = 24h

MOV B,A ; save 24h in B

JMP START ; repeat

DELAY: ; make delay

MOV R0,#200 ; delay 200 Clock cycles

DJNZ R0,$

RET

Answered 1 days AfterMay 08, 2021

Solution

Gaurav Gupta answered on May 09 2021
20 Votes

This file is...

Submit New Assignment

Copy and Paste Your Assignment Here