This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

tracing out register values

how to trace the register values in a program using keil debug session

Parents Reply Children
  •         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
    
    

  • 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
    

  • Hai Sir..I am in need of your help....

    1. load address in 89c52

    2. load some values in At24c64

    3. read the loaded values in new location of 89c52

    4. display the read values through LED

    Please help me sir... please guide me to write asm code for this.. i dont have any idea about this...

  • please guide me to write asm code for this.. i dont have any idea about this

    if you do not have a clue, the only way to figure it out is to STUDY (sorry, I know that is a bad word)

    look at a few datasheets for I²C devices many have very explicit descriptions of the required signals and then start coding.

    OR - hire a consultant

    Erik

  • OK sir... how to get started to study. where i have to start first

  • Go get yourself a couple of books (text books, data manuals, asm subroutines, etc), on the topic area(s) that interest you and read them cover to cover. Studying takes time and effort, finding the information you need is part of the process. It's not about sitting in front of a teacher/lecturer or expecting to get a memory implant from a third party.

    Where do you start? Start with foundational information, start with material that given you an overview of how things function and interact. Microprocessors, assemblers, compilers, linkers, and loaders carry some pretty general concepts in computer science, it doesn't have to be 8051 specific to be useful or relevant.

    With a broad understanding of the processes involved you can focus in on specifics.

    It's not about rote learning of facts, but the mechanics and application of ideas and concepts.

  • for transferring data between 8952,program ram and data ram, first you should know the interfacing concept, those techniques are available in muhamed ali mazadi's book.