Presentation is loading. Please wait.

Presentation is loading. Please wait.

Table Construction.

Similar presentations


Presentation on theme: "Table Construction."— Presentation transcript:

1 Table Construction

2 Program name: Show the hexadecimal value of the R1 register on the leftmost two 7-segment displays.asm ; Title: Show the hexadecimal value of the R1 register on the leftmost two 7-segment displays ; Description: Show the value of the high nibble of R1 on the 7-segment display 3 and that of the low nibble of R1 on the 7-segment display 2. ; Note: a logic 0 lights a display segment. start: MOV DPH,#HIGH(table_of_number_to_7_segment_code) MOV DPL,#LOW(table_of_number_to_7_segment_code) repeat: MOV A,R1 MOV B,A ; To show the low nibble ANL A,# B MOVC MOV P1,# B ; to prevent trasient light SETB P3.4 ; | CLR P3.3 ; | enable display 1 MOV P1,A CALL DELAY ; To show the high nibble MOV A,B RR A MOV P1,# B ; to prevent trasient ligh SETB P3.3 ; | enable display 0 CALL DELAY JMP repeat ; a crude delay delay: MOV R0, #200 DJNZ R0, $ RET table_of_number_to_7_segment_code: db B ; 0 db B ; 1 db B ; 2 db B ; 3 db B ; 4 db B ; 5 db B ; 6 db B ; 7 db B ; 8 db B ; 9 db B ; A db B ; B db B ; C db B ; D db B ; E db B ; F

3 8051 Instruction: MOVC Instructions OpCode Bytes Cycles Flags
MOVC 0x93 1 2 None MOVC 0x83 Description: MOVC moves a byte from Code Memory into the Accumulator. The Code Memory address from which the byte will be moved is calculated by summing the value of the Accumulator with either DPTR or the Program Counter (PC). In the case of the Program Counter, PC is first incremented by 1 before being summed with the Accumulator. See Also: MOV, MOVX, Instruction Set Operation: MOVC Function: Move Code Byte to Accumulator Syntax: MOVC

4 begins.

5 begins.

6 begins.

7 begins.


Download ppt "Table Construction."

Similar presentations


Ads by Google