1 / 17

Embedded Systems Imbibing skill sets to beat the competition

Embedded Systems Imbibing skill sets to beat the competition. Prolific Systems and Technologies Pvt Ltd. ; MOVC A,@A+DPTR ;----------------------------------------------------------- MOV A,#06 MOV DPTR,#DISP_LUT MOVC A,@A+DPTR MOV P0,A JMP $ DISP_LUT: ; -abcdefgd-

tegan
Télécharger la présentation

Embedded Systems Imbibing skill sets to beat the competition

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Embedded Systems Imbibing skill sets to beat the competition Prolific Systems and Technologies Pvt Ltd

  2. ; MOVC A,@A+DPTR ;----------------------------------------------------------- MOV A,#06 MOV DPTR,#DISP_LUT MOVC A,@A+DPTR MOV P0,A JMP $ DISP_LUT: ; -abcdefgd- DB 11111100b ;0 DB 01100000b ;1 DB 11011010b ;2 DB 11110010b ;3 DB 01100110b ;4 DB 10110110b ;5 DB 10111110b ;6 DB 11100000b ;7 DB 11111110b ;8 DB 11100110b ;9 Seven Segment Display dp Po 0 a g Po 1 f f b Po 2 8 0 5 1 e g Po 3 d Po 4 c Po 5 e c b Po 6 d a Po 7

  3. ; PROGRAM TO FIND SQUARE OF NO. ; MOVC A,@A+PC ;---------------------------------------------------------------- ORG 0000h MOV A,#05 CALL SQR JMP $ SQR: INC A MOVC A,@A+PC RET DB 00 DB 01 DB 04 DB 09 DB 16 DB 25 DB 36 DB 49 DB 64 DB 81

  4. Arithmetic

  5. Call and Jump

  6. CJNE CJNE A, #05, CHK_GT ;-------------------------------------- ; A=5 MOV P0,#0FH JMP $ ;-------------------------------------- CHK_GT: JC IS_LESS ;-------------------------------------- ;A>5 MOV P0,#0FFH JMP $ ;-------------------------------------- A<5 IS_LESS: MOV P0,#00H JMP $ ;--------------------------- N A>5 Y PRINT A>5 N A<5 Y RET PRINT A=5 PRINT A<5 RET RET

  7. CJNE A>5 N Y PRINT A<=5 PRINT A>5 CJNE A,#05+1, $+3 JNC IS_GT ;----------------------------------------- ;A<=5 MOV P0,#0FH JMP $ ;---------------------------------------- ;A>5 IS_GT: MOV P0,#0FFH JMP $ ;----------------------------------------

  8. CJNE A<5 N Y PRINT A>=5 PRINT A<5 CJNE A,#05, $+3 JC IS_LESS ;----------------------------------------- ;A>=5 MOV P0,#0FH JMP $ ;---------------------------------------- ;A<5 IS_LESS: MOV P0,#00H JMP $ ;----------------------------------------

  9. DJNZ EX. 1 MOV COUNT, #10 MOV A,#00H ;-------------------------------- L2: CALL DISP_A INC A DJNZ COUNT,L2 JMP $

  10. DJNZ EX.2 Copy data from memory location 30h – 34h to memory location 40h--44h . MOV COUNT,#05H MOV R0,#30 MOV R1,#40 L1: MOV A,@R0 MOV @R1,A INC R0 INC R1 DJNZ COUNT,L1

  11. DJNZ EX.3 Wait_5ms: Machine Cycle MOV COUNT1,#100d 1 LAB1: MOV COUNT2,#23d 1 DJNZ COUNT2,$ 2 DJNZ COUNT1,LAB1 2 RET 2

  12. The inner most instruction:(djnz count2 $) 2*23*1.085=49.91microsec. The lab1 loop: 100*49.91microsec=4999microsec~4.9millisec Now considering overhead: (mov count2,#23d and djnz count1$) 3*100*1.085=325.25microsec So 4999+325.25=5324.25microsec~5.3millisec Plus 3*1.085=3.255:(mov count1,#100d and ret) Thus 5324.25+3.255=5327.50~5.3millisec

  13. Logic

  14. Thank You Shashidhar kalluri

More Related