Results 1 to 12 of 12

Thread: Hex file memory address question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Question Hex file memory address question

    hello everyone ....can u Help me again Please

    i have this .hex file that contains

    :020003001616C0
    :0200050019DE02
    :0200070022478E
    :101AB100D2B3C2B4121B58121B58121B5875A0384C
    :101AC100C2B3D2B3121B5875A038C2B3D2B3121B22
    :101AD1005275A038C2B3D2B3121B5275A038C2B32B
    .
    .
    .
    .
    :10112C00D083D082E493F208740193F20874029392
    :09113C00F208740393F2740473C9
    :061145008A838982E47335
    :00000011FC

    is it possible to determine the memory address?

    for example i want to go at the address
    Const START_AD = &HF400
    is it possible to determine where is this address in the hex file above?

    if possible can u help me do it?
    Last edited by VBcielle; Dec 2nd, 2004 at 01:48 AM.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    not if you don't know what the starting address is.
    Old Core-Dumps used to spit out all the memory in a machine. You would have to find the starting address for your program, then find the crash address, and examine code there to check the data that was being passed to your program.

    What produced the output? You could use an API to get memory contents.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326
    thanks David

    How about this what if the .hex file is uploaded then converted to a binary file like this

    ADDR 0 1 2 3 4 5 6 7- 8 9 A B C D E F

    0000 02 00 0E 16 16 19 DE 22 47 32 FF 02 09 D6 78 FF
    0010 E4 F6 D8 FD 75 81 38 02 0B 06 FF 02 00 09 FF FF
    0020 FF FF FF 02 19 03 FF FF FF FF FF 02 13 58 78 20
    .
    .
    .
    2380 00 D2 93 22 20 20 20 20 20 20 20 20 00 FF FF FF
    2390 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    23A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    23B0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF


    will i be able to to know where is &HAA for example?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Hex file memory address question

    hello people is my post above possible? i think not

  5. #5
    New Member
    Join Date
    Dec 2004
    Location
    Lovely Earth
    Posts
    5

    Re: Hex file memory address question

    VBCielle:

    You are in front of the Intel Hex Code format.
    Your line:
    :020003001616C0
    :020003001616C0
    means
    : -Starts new line
    02 -Two bytes of data on this line,
    0003 -Starting at address 0003h, (See how next line starts at address 0005h=0003h+2)
    00 -Line contains Data bytes, (01h is Control Data)
    16 -First byte of data
    16 -Second byte of data
    C0 -Checksum (sum all bytes and divide them by 100h and you will get zero residue, though there's something wrong with your first line, second is ok....)

    Regards

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Hex file memory address question

    Quote Originally Posted by Amaury
    VBCielle:

    You are in front of the Intel Hex Code format.
    Your line:
    :020003001616C0
    :020003001616C0
    means
    : -Starts new line
    02 -Two bytes of data on this line,
    0003 -Starting at address 0003h, (See how next line starts at address 0005h=0003h+2)
    00 -Line contains Data bytes, (01h is Control Data)
    16 -First byte of data
    16 -Second byte of data
    C0 -Checksum (sum all bytes and divide them by 100h and you will get zero residue, though there's something wrong with your first line, second is ok....)

    Regards
    hi Amaury thanks you're an angel i think you are right this is an intel hex format. You are right theres something wrong with my first line at the part of the checksum i changed the hex ...

    thanks thats enlightening...will you help me again i have this question
    from this intel hex format

    :020003001616C0
    :0200050019DE02
    :0200070022478E
    :101AB100D2B3C2B4121B58121B58121B5875A0384C
    :101AC100C2B3D2B3121B5875A038C2B3D2B3121B22
    :101AD1005275A038C2B3D2B3121B5275A038C2B32B
    .
    .
    .
    .
    :10112C00D083D082E493F208740193F20874029392
    :09113C00F208740393F2740473C9
    :061145008A838982E47335
    :00000011FC

    will i be able to insert a hex file at the end of this file or at the maximum address?
    will i declare Const START_AD = &H1145 as the maximum address in VBcode base on the intel hex given?

    and if i insert a hex file at the maximum address then send this in mscomm into a hardware will it be able to program all the hex file including the one i inserted?

    Please help , im sorry im not really familiar with these
    Last edited by VBcielle; Dec 8th, 2004 at 04:06 AM.

  7. #7
    New Member
    Join Date
    Dec 2004
    Location
    Lovely Earth
    Posts
    5

    Re: Hex file memory address question

    I would insert either one line or multiple lines just before the last line ":00000011FC", just make sure the addresses you are inserting do not overlap with the ones in your original code, for example in your code the highest address used is :
    101AD1005275A038C2B3D2B3121B5275A038C2B32B, so the next available address would be &H1AE1 since there are &H10 bytes of data starting from the &H1AD1 address, BUT... it is probably used in the part of the code you chopped....
    Verify all your code to find the highest address used, it won't necessarily be at the very last line.
    If your addresses don't overlap, all the original and inserted code will be programmed in your hardware, again, make sure about the checksum bytes, or you'll get an error when transferring the code to your hardware.
    It will probably work in your application if all this code is data, but if it is actual code or instructions for some microcontroller you'd need a way to tell the microcontroller how to jump to that new piece of code.

    Have Fun.

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Hex file memory address question

    Quote Originally Posted by Amaury
    I would insert either one line or multiple lines just before the last line ":00000011FC", just make sure the addresses you are inserting do not overlap with the ones in your original code, for example in your code the highest address used is :
    101AD1005275A038C2B3D2B3121B5275A038C2B32B, so the next available address would be &H1AE1 since there are &H10 bytes of data starting from the &H1AD1 address, BUT... it is probably used in the part of the code you chopped....
    Verify all your code to find the highest address used, it won't necessarily be at the very last line.
    If your addresses don't overlap, all the original and inserted code will be programmed in your hardware, again, make sure about the checksum bytes, or you'll get an error when transferring the code to your hardware.
    It will probably work in your application if all this code is data, but if it is actual code or instructions for some microcontroller you'd need a way to tell the microcontroller how to jump to that new piece of code.

    Have Fun.
    Hi amaury
    thanks you are very Helpful, i hope u wont get tired helping me....err can u help me further
    this is also related to my previous post it's like this
    im making a project that will program datas (the intel hex i gave u above)
    into an equipment using MSCOM but aside from hex given above i have to insert
    postal zipcode into the intel hex before programming all the intel hex..
    can u help me? i was told to program all the intel hex i have to insert the zipzone in the address Const START_AD = &HF400

    i uploaded some part of my program..
    this is the part where zipzone chart is pasted in the Vb project then parse
    then converted into Hex...

    my problem is how to insert the zipzone and program it by byte, im sorry if i have a vague explanation
    on the uploaded program can u help me how to do this? or can u check if im doing okie in the part readzipzone function...HELP
    Last edited by VBcielle; Dec 14th, 2004 at 03:07 AM.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Hex file memory address question

    To all gurus modeartors experts etc....hope you'll notice my post and you can help...i need a hand desperately

    i have this attached program that will convert this values:
    Zipcode
    5
    9
    13
    24
    26
    39
    49
    67
    76
    77
    79
    89

    Zone
    2
    7
    1
    2
    3
    2
    3
    2
    2
    3
    2
    3


    [/QUOTE]

    into an intel hex like this in the link ?
    http://www.keil.com/support/docs/1584.htm

    the result of the program is this

    :06303338383035C2
    :06303339373036C1
    :06303431303035D0
    :06303431323034CF
    :06303431343035CC
    :06303431363034CB
    :06303431383035C8
    :06303432373035C8
    :06303434393034C5
    :06303435323035CA
    :06303435383034C5


    but there is still lacking and still have errors like the address, dta record type should be in the result...i dont know can u help me debug and add whats missing.. the result should be like this

    :10246200464C5549442050524F46494C4500464C33

    where:

    10 is the number of data bytes in the record.
    2462 is the address where the data are to be located in memory.
    00 is the record type 00 (a data record).
    464C...464C is the data.
    33 is the checksum of the record.
    Last edited by VBcielle; Jan 4th, 2005 at 03:58 AM.

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Hex file memory address question

    can anyone help me Please...no ones answering help!!!

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Hex file memory address question

    I tried to paste some data in from your text file, but it kept displaying an error. Not much to do, until you explain how it will work.

    What kind of equipment is it? There may be another solution to your problem.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2004
    Location
    San Isidro
    Posts
    326

    Re: Hex file memory address question

    Quote Originally Posted by dglienna
    I tried to paste some data in from your text file, but it kept displaying an error. Not much to do, until you explain how it will work.

    What kind of equipment is it? There may be another solution to your problem.

    Hello David you said you tried to paste some data in my text file and it displays error....Well you have to copy all the contents of the text file and paste it all in the VB form...Please Help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width