File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,11 @@ import (
9
9
10
10
// Constants definitions of IntelHex record types
11
11
const (
12
- _DATA_RECORD byte = 0 // Record with data bytes
13
- _EOF_RECORD byte = 1 // Record with end of file indicator
14
- _ADDRESS_RECORD byte = 4 // Record with extended linear address
15
- _START_RECORD byte = 5 // Record with start linear address
12
+ _DATA_RECORD byte = 0 // Record with data bytes
13
+ _EOF_RECORD byte = 1 // Record with end of file indicator
14
+ _EXTENDED_RECORD byte = 2
15
+ _ADDRESS_RECORD byte = 4 // Record with extended linear address
16
+ _START_RECORD byte = 5 // Record with start linear address
16
17
)
17
18
18
19
// Structure with binary data segment fields
@@ -222,6 +223,9 @@ func (m *Memory) parseIntelHexRecord(bytes []byte) error {
222
223
return newParseError (_RECORD_ERROR , err .Error (), m .lineNum )
223
224
}
224
225
m .eofFlag = true
226
+ case _EXTENDED_RECORD :
227
+ //Extended 8086 Segment Record
228
+ fallthrough
225
229
case _ADDRESS_RECORD :
226
230
m .extendedAddress , err = getExtendedAddress (bytes )
227
231
if err != nil {
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ func getExtendedAddress(bytes []byte) (adr uint32, err error) {
52
52
if binary .BigEndian .Uint16 (bytes [1 :3 ]) != 0 {
53
53
return 0 , errors .New ("incorrect address field in extended linear address line" )
54
54
}
55
- adr = uint32 (binary .BigEndian .Uint16 (bytes [4 :6 ])) << 16
55
+ adr = uint32 (binary .BigEndian .Uint16 (bytes [4 :6 ])) << ( 1 << bytes [ 3 ])
56
56
return adr , nil
57
57
}
58
58
You can’t perform that action at this time.
0 commit comments