Skip to content

Wrong block size when there is a jump in segment address #9

@sresam89

Description

@sresam89

We have a hex file that has data record with same baseSegment address
image

The file has address jumps between sectors but has same baseSegment address
image

Current class file has implementation for getting the segment info gives the correct number of segment address using getSegmentinfo(). "2" in our case, x00010000 and x00030000. The class also gives the block size for each segment address which are 47892 and 65536.

The class file while calculating the block size is assuming the start of the address is always "x0000", takes the last address in the sector (which is "x0001BB14") as its block-size (which is 47892 in our case). This calculation would be wrong as the start address is not zero always (like in our x3000xxxx sector and between our x1000xxxx sectors where it-jumps/start-with-non-zero address). These jumps should be taken into account.
image

If we do consider the jumps and non-zero-start-address, actual block-size should be 40992 (including the address jumps) for the first segment and 1024 for the second segment.

Each sector calculation is done as below
sectorStartAddresses: x00010000 totalSectordataLength: x2ec
sectorStartAddresses: x00011000 dataLength: x238
sectorStartAddresses: x00012000 dataLength: x378
sectorStartAddresses: x00012380 dataLength: x8544
sectorStartAddresses: x0001a8c8 dataLength: xfdc
sectorStartAddresses: x0001b8a8 dataLength: x1fc
sectorStartAddresses: x0001baa8 dataLength: x64
sectorStartAddresses: x0001bb10 dataLength: x4

Hoping to collaborate and make this code work for both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions