https://github.com/ikskuh/zig-ihex
An intel hex loader written in Zig
https://github.com/ikskuh/zig-ihex
ihex intel-hex zig zig-package ziglang
Last synced: about 2 months ago
JSON representation
An intel hex loader written in Zig
- Host: GitHub
- URL: https://github.com/ikskuh/zig-ihex
- Owner: ikskuh
- License: mit
- Created: 2020-04-18T19:44:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-08-31T06:04:50.000Z (2 months ago)
- Last Synced: 2025-08-31T08:21:52.370Z (2 months ago)
- Topics: ihex, intel-hex, zig, zig-package, ziglang
- Language: Zig
- Size: 2.18 MB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zig Intel Hex parser
A loader for the [Intel Hex](https://en.wikipedia.org/wiki/Intel_HEX) format used in embedded
development.
## Features
- Supports all 6 record types
- Raw record parser (`parseRaw`)
- User-friendly preprocessor (`parseData`)
- Pedantic and lax parsing
## Example
```zig
fn processData(x: void, offset: u32, data: []const u8) !void {
std.debug.warn("read slice @ 0x{x}: {x}\n", .{ offset, data });
}
pub fn main() !void {
var file = try std.fs.cwd().openFile("data/example.ihex", .{ .read = true, .write = false });
defer file.close();
const entry_point = try ihex.parseData(file.reader(), ihex.ParseMode{ .pedantic = true }, {}, error{}, processData);
if (entry_point) |ep| {
std.debug.warn("entry point: 0x{x}\n", .{ep});
}
}
```