how to trace the register values in a program using keil debug session
even a 3grade kid knows how to use the search engines. (i doubt you'll even understand the heading and the point i am trying to make here)
i dnt know how to use the breakpoints to trace reg values
1.after clicking stop/start debug session 2.click view 3.click register window
use # symbol while loading values use correct destination address for this command "cjne r0,#00" then analyse the program well while posting the commends next time follow instruction given below "tips for posting message"
push 00h push 01h mov a,49h mov b,#0ah mul ab add a,48h mov b,#3ch mul ab mov 38h,a mov r0,b cjne r0,#00,gothr sjmp gothr1 gothr: mov a,r0 gothr1: add a,#00h mov r0,a mov a,47h mov b,#0ah mul ab add a,46h add a,38h jnc gothr2 push 0e0h mov a,r0 add a,#01h mov r0,a pop 0e0h gothr2: mov r1,a mov a,r1 add a,#00h mov r1,a pop 01h pop 00h ret
Now am i right sir? Thanks for helping me sir. Am new to this. could u plz explain that coding now?
write the objective of this code, then i ll try to explain
logic for storing the clock timings(eg., 12.00 o'clock) in memory
49h -> hr's msb 48h -> hr's lsb 47h -> min's msb 46h -> min's lsb
i could not understand your program about what kind of option you are trying to use but here it is my program execute it it will work.in this program you need to adjust the time value,then i hope it will work as nice clock...
;port p1 for sevent segmet data and p3 for multplexing four seven segment LED ORG 00H ;As using interrupt jump to general purpose starts at 30h LJMP MAIN ; jump to main program ORG 0BH ;timoer 0 interrupt serice vector LJMP prog ;jump to execute the necessary condition on ehalf of timer interrupt 0 ORG 30H ;start of general purpose ram MOV R2,#0 ;initializing r2,r3,r4,r5 as we are usin four digit MOV R3,#0 ; MOV R4,#0 ; MOV R5,#0 ; MOV A,#0 MAIN: MOV TMOD,#00000001B ;timer 0 mode MOV IE,#10000010B ;timer 0 interrupt enabling MOV TH0,#0H ;actually timer must be initialzed for 60 seconds but here i ve used an approximate value MOV TL0,#01H ; SETB TR0 ;timer run MOV DPTR,#DAT L1: MOV P3,#00000001H ;actally you need to show the time by using LED know,to make all the LED glow for appropriate time MOV R0,#46H ;copying from the required memory location MOV A,@R0 ;copyig from r0 to a MOVC A,@A+DPTR MOV P1,A ; copying from a to p1 MOV P3,#00000010B MOV R0,#47H MOV A,@R0 MOVC A,@A+DPTR MOV P1,A MOV P3,#00000100B MOV R0,#48H MOV A,@R0 MOVC A,@A+DPTR MOV P1,A MOV P3,#00001000B MOV R0,#49H MOV A,@R0 MOVC A,@A+DPTR MOV P1,A SJMP L1 prog: MOV TH0,#00H ; again timer setup MOV TL0,#01H CLR TF0 SETB TR0 INC R2 MOV R1,#46H MOV A,R2 MOV @R1,A CJNE R2,#10,L2 MOV R2,#0 INC R3 MOV R1,#47H MOV A,R3 MOV @R1,A CJNE R3,#10,L2 MOV R3,#0 INC R4 MOV A,R4 MOV R1,#48H MOV @R1,A CJNE R4,#10,L2 MOV R4,#0 INC R5 MOV R1,#48H MOV A,R5 MOV @R1,A CJNE R5,#10,L2 MOV R2,#0 MOV R3,#0 MOV R4,#0 MOV R5,#0 L2: RETI DAT: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,98H END
Hi sir...... Could u please tell where i can get more sample 8051 asm programs.
use google,there are many pages for that, but try to develop your own program
I searched sir but i didn't get more sample programs
Hi sir. i need to trasfer the datas between 89c51 & eeprom(24c64). please help me to write asm programs to transfer datas between them
You will find a lot of examples of 8051 assembler programs implementing I2C in software, for any I2C device, like serial eeproms. Learning actually means to start doing things on yourself.