break;
case 2: // Extended Segment Address
- throw new Exception("Intel-Hex Format - Typ 02 not supported yet");
+ executeIntelHexTyp02(b);
+ break;
case 3: // Start Segment Address Record
throw new Exception("Intel-Hex Format - Typ 03 not supported yet");
case 4: // Extended Linear Address Record
- throw new Exception("Intel-Hex Format - Typ 04 not supported yet");
+ executeIntelHexTyp04(b);
case 5: // Start Linear Address Record
throw new Exception("Intel-Hex Format - Typ 05 not supported yet");
memoryContent.setComplete(true);
}
+
+ private void executeIntelHexTyp02 (int [] b) throws Exception {
+ if (b[3] != 2) {
+ throw new RuntimeException("Falscher Typ");
+ }
+ int b4 = (int)b[4]; if (b4 < 0) b4 += 256;
+ int b5 = (int)b[5]; if (b5 < 0) b5 += 256;
+ this.offset = (b4 * 256 + b5) << 4;
+ }
+
+ private void executeIntelHexTyp04 (int [] b) throws Exception {
+ if (b[3] != 4) {
+ throw new RuntimeException("Falscher Typ");
+ }
+ int b4 = (int)b[4]; if (b4 < 0) b4 += 256;
+ int b5 = (int)b[5]; if (b5 < 0) b5 += 256;
+ this.offset = (b4 * 256 + b5) << 16;
+ }
@Override
public String toString()