# \[ANN\] intel\_hex.1.0

**URL:** <https://discuss.ocaml.org/t/ann-intel-hex-1-0/18628>\
**Category:** Community\
**Created:** [October 21, 2026, 2:36pm UTC](https://discuss.ocaml.org/t/ann-intel-hex-1-0/18628 "2026-10-21T14:36:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dx3mod](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dx3mod/32/6740_2.png) [@dx3mod](https://discuss.ocaml.org/u/dx3mod)\
**Post date:** [October 21, 2026, 2:36pm UTC](https://discuss.ocaml.org/t/ann-intel-hex-1-0/18628/1 "2026-10-21T14:36:25Z")

</div>

Yo!

I am happy to announce the first major release of the [Intel HEX manipulation library](https://github.com/dx3mod/intel_hex).

Intel HEX format is commonly used to represent compiled program code and data that is loaded into a microcontroller, flash memory, or ROM in embedded systems programming.

And now you can work with it in pure OCaml!

### Changes

- Redesign API;
- Added `Memory` module to process memory images of your firmwares;
- Instead of using the `ohex` package, we start use [hexen](https://discuss.ocaml.org/t/ann-hexen-0-1/18627/1) for encoding and decoding hexadecimals;

### In use

The library provides a simple API for parsing and creating Intel HEX files. To create an Intel HEX file, you can use the following code:

```ocaml
Intel_hex.Record.
[
  Extended_linear_address 0x0F;
  Data (0x0000, "Hello ");
  Data (0x0007, "World!");
  End_of_file;
]
|> Intel_hex.Object.to_string
|> print_endline

```

```plaintext
:02000004000FEB
:0600000048656C6C6F20E6
:06000700576F726C6421CA
:00000001FF

```

And to parse a string containing an Intel HEX file:

```ocaml
":0600000048656C6C6F20E6\n:06000700576F726C6421CA"
|> Intel_hex.Object.of_string
(* - : Intel_hex.Object.t =
  [ Intel_hex.Record.Data (0, "Hello "); 
    Intel_hex.Record.Data (7, "World!") ] *)

```

However, the library also provides a module for working with memory images built from Intel HEX files or other sources.

```ocaml
Intel_hex.Memory.of_string ~block_size:6 "Hello World!"
(* - : Intel_hex.Memory.t =
 [ Intel_hex.Memory.Segment(0x0000, "Hello ");
   Intel_hex.Memory.Segment(0x0006, "World!") ] *)

```

For more details, see the [API reference](https://ocaml.org/p/intel_hex/latest/doc/index.html).
