Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/16/07 18:52
Modified:
  12/16/07 18:53

Read: times


 
#148342 - Maybe an example will help
Responding to: ???'s previous message
Shehryar,

Perhaps a small example will help make this clear. Here is a simple 8051 program:
                ORG     0
START:
                MOV     A,#12h
                JMP     START
                END
Like all good 8051 programs, it starts at address 0 in the code memory space. Here is the output from the assembler:
   11  0000                           ORG     0
   12  0000           START:
   13  0000 7412                      MOV     A,#12h
   14  0002 80FC                      JMP     START
   15  0004                           END
It shows that the program consists of four bytes, starting at address zero, and that their values are (in hex) 74, 12, 80, and FC.

Now here is the corresponding Intel HEX file:
:04000000741280FCFA
:00000001FF
This link tells how to decode it:

http://www.8052.com/tutintel.phtml

Based on the information there, we see that the second line is just an end of file marker. We don't need to worry about it. The first line contains the good stuff, as follows:
: 04 00 0000 74 12 80 FC FA
   |  |    | -----------  |
   |  |    |      |       +--- The checksum
   |  |    |      +----------- The four data bytes (they match the assembler output)
   |  |    +------------------ Address of the first byte (0000 in our example)
   |  +----------------------- Record type (00 = normal data)
   +-------------------------- Number of data bytes in this record
So in the end, your code memory needs to contain four bytes of data: 74h in location 0, 12h in location 1, 80h in location 2, and FCh in location 3.

You have to decode the hex file as shown above in order to find out what binary data goes into memory, but once that binary data is in the memory, that's it -- it's ready to execute.

-- Russ


List of 59 messages in thread
TopicAuthorDate
Executing from External Ram ; THE SEQUEL            01/01/70 00:00      
   You need to think more precisely            01/01/70 00:00      
      the whole thing seems like nonsense!            01/01/70 00:00      
         Why process the Intel-HEX file locally?            01/01/70 00:00      
            ????            01/01/70 00:00      
               Andy is right            01/01/70 00:00      
                  It was actually Richard's idea            01/01/70 00:00      
                     Thanx Richards            01/01/70 00:00      
         I was just referring to a PERFORMANCE METRIC            01/01/70 00:00      
            No PC involved??            01/01/70 00:00      
               PC involved            01/01/70 00:00      
      I Apologize for the Confusion, Andy            01/01/70 00:00      
         Don't apologise to me            01/01/70 00:00      
            Please Elaborate; ANDY, Eric, Richard and Reza            01/01/70 00:00      
               Maybe an example will help            01/01/70 00:00      
                  Russ have you done this before?            01/01/70 00:00      
                     Done what before?            01/01/70 00:00      
                        Yes            01/01/70 00:00      
                           Yes            01/01/70 00:00      
                               :-)            01/01/70 00:00      
                              Think Basic-52            01/01/70 00:00      
                                 RAM IIRC?            01/01/70 00:00      
                                    IIRC            01/01/70 00:00      
                                       :-), Not your Fault            01/01/70 00:00      
               Files            01/01/70 00:00      
                  YES the Content!!            01/01/70 00:00      
   I\'m greatly impressed!!!!            01/01/70 00:00      
      Thanks a lot Reza.            01/01/70 00:00      
         Atmel            01/01/70 00:00      
            :-)            01/01/70 00:00      
               OMG! is your OS 8bit?            01/01/70 00:00      
                  Well!, THIS is a VERY BIG ISSUE            01/01/70 00:00      
            no, dont            01/01/70 00:00      
               ERIC, you have amazed me!!!            01/01/70 00:00      
               Can you give me a rough estimate ? Eric            01/01/70 00:00      
                  I have no idea            01/01/70 00:00      
                     ARM Book?            01/01/70 00:00      
                  $1.50USD ARM            01/01/70 00:00      
                     Of course it is, however            01/01/70 00:00      
         Price issue            01/01/70 00:00      
   Why 3 MCUs?            01/01/70 00:00      
      The Reasons            01/01/70 00:00      
         AVRs won't have this problem            01/01/70 00:00      
            OK            01/01/70 00:00      
               Changing processor            01/01/70 00:00      
                  My two cents            01/01/70 00:00      
                  ARM is the right choice for the project of this Sc            01/01/70 00:00      
            I'd be VERY careful using ATMEL!            01/01/70 00:00      
               prototype testing is necessary            01/01/70 00:00      
                  Yes, you have to test them under extremes            01/01/70 00:00      
               Richards, can you suggest an alternative?            01/01/70 00:00      
                  NXP            01/01/70 00:00      
                  In short ...            01/01/70 00:00      
            Neither would a comparable 8051!            01/01/70 00:00      
               8051 is not french wrench            01/01/70 00:00      
                  AVR can't execute from external RAM            01/01/70 00:00      
                     Russell Bull is right            01/01/70 00:00      
                        just like any other uC            01/01/70 00:00      
   Started Again after the holidays            01/01/70 00:00      

Back to Subject List