srec_aomf(5)

πŸ’– srec_aomf(5) β€” Intel Absolute Object Module Format πŸ’–

okay bestie, this is srec_aomf(5) from the File Formats Manual β€” the Intel Absolute Object Module Format page. Buckle up, we're doing 8051 record layouts and honestly it's iconic 🫢


🌸 NAME 🌸

srec_aomf β€” Intel Absolute Object Module Format


✨ DESCRIPTION ✨

okay so AOMF β€” the Absolute Object Module Format β€” is literally a subset of the 8051 OMF. The structure of an absolute object file (meaning the order of the records in it) is similar to that of a relocatable object file. But there are three main differences, and they matter:

  1. an absolute object file contains one module only
  2. not all the records can appear in the absolute file
  3. the records can contain only absolute information

periodt. πŸ’…


🧬 Generic Record Format 🧬

Every record starts with a record type that tells you what kind of record it is, plus a record length that contains the number of bytes in the record, exclusive of the first two fields. The record ends with a checksum byte which contains the 2s complement of the sum (modulo 256) of all other bytes in the record. Therefore the sum (modulo 256) of all bytes in the record is zero. Cute, right? 😌

The record length includes the payload and checksum fields, but excludes the type and length fields.

All 16‐bit fields are little‐endian. no cap.

                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                      β”‚ REC     β”‚ Record  β”‚ Payload β”‚ CHK     β”‚
                      β”‚ TYP     β”‚ Length  β”‚         β”‚ SUM     β”‚
                      β”‚ 8 bits  β”‚ 16 bits β”‚         β”‚ 8 bits  β”‚
                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Here are some of the relevant record types:

  • 0x01 β€” Scope Definition Record
  • 0x02 β€” Module Start Record
  • 0x04 β€” Module End Record
  • 0x06 β€” Content Record
  • 0x0E β€” Segment Definition Record
  • 0x12 β€” Debug Items Record
  • 0x16 β€” Public Definition Record
  • 0x18 β€” External Definition Record

Names are not stored as C strings. Names are stored as a length byte followed by the contents. not me expecting C strings πŸ’€


πŸ—οΈ Structure πŸ—οΈ

An AOMF file consists of a module header record (0x02), followed by one or more content (0x06), scope (0x01) or debug (0x12) records, and ends in a module end record (0x04).

The records with the following types are extraneous (they may appear in the file but are ignored): 0x0E, 0x16 and 0x18 (definition records). All records which are not part of the AOMF and are not extraneous are considered erroneous.

bestie, if a record is not part of AOMF and is not one of those extraneous ones, it's erroneous. full stop πŸ›‘

πŸš€ Module Header Record πŸš€

            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚  REC    β”‚ Record  β”‚ Module  β”‚ TRN ID  β”‚ zero    β”‚ CHK     β”‚
            β”‚  TYP    β”‚ Length  β”‚ Name    β”‚ 8 bits  β”‚ 8 bits  β”‚ SUM     β”‚
            β”‚  0x02   β”‚ 16 bits β”‚         β”‚         β”‚         β”‚ 8 bits  β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Each module must start with a module header record. It is used to identify the module for the RL51 and other future processors of 8051 object files. In addition to the Module Name, the record contains:

TRN ID β€” The byte identifies the program which has generated this module:

  • 0xFD β€” ASM51
  • 0xFE β€” PL/M-51
  • 0xFF β€” RL51.

πŸ›‘ Module End Record πŸ›‘

       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚  REC    β”‚ Record  β”‚ Module  β”‚ zero    β”‚ REG     β”‚ zero    β”‚ CHK     β”‚
       β”‚  TYP    β”‚ Length  β”‚ Name    β”‚ 16 bits β”‚ MSK     β”‚ 8 bits  β”‚ SUM     β”‚
       β”‚  0x04   β”‚ 16 bits β”‚         β”‚         β”‚ 8 bits  β”‚         β”‚ 8 bits  β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

This record ends the module sequence and contains the following information: characteristics.

MODULE NAME β€” The name of the module is given here for a consistency check. It must match the name given in the Module Header Record.

REGISTER MASK (REG MSK) β€” The field contains a bit for each of the four register banks. Each bit, when set, specifies that the corresponding bank is used by the module:

  • Bit 0 (the least significant bit) β€” bank #0.
  • Bit 1 β€” bank #1.
  • Bit 2 β€” bank #2.
  • Bit 3 β€” bank #3.

πŸ“¦ Content Record πŸ“¦

            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
            β”‚  REC    β”‚ Record  β”‚ SEG ID  β”‚ Offset  β”‚  DATA   β”‚ CHK     β”‚
            β”‚  TYP    β”‚ Length  β”‚ 8 bits  β”‚ 16 bits β”‚         β”‚ SUM     β”‚
            β”‚  0x06   β”‚ 16 bits β”‚         β”‚         β”‚         β”‚ 8 bits  β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

This record provides one or more bytes of contiguous data, from which a portion of a memory image may be constructed.

SEG ID β€” This field must be zero.

OFFSET β€” Gives the absolute address of the first byte of data in the record, within the CODE address space.

DATA β€” A sequence of data bytes to be loaded from OFFSET to OFFSET+RECORDLENGTHβˆ’5.


πŸ“ Size Multiplier πŸ“

In general, raw binary data will expand in size by approximately 1.02 times when represented with this format. tiny glow-up, honestly ✨


🌈 SOURCE 🌈


srec_cat version 1.65

Copyright (C) 1998... Peter Miller

The srec_cat program comes with ABSOLUTELY NO WARRANTY; for details use the 'srec_cat -VERSion License' command. This is free software and you are welcome to redistribute it under certain conditions; for details use the 'srec_cat -VERSion License' command.


🫢 MAINTAINER 🫢

  • Scott Finneran β€” E‐Mail: scottfinneran@yahoo.com.au
  • Peter Miller β€” E‐Mail: pmiller@opensource.org.au

✨ later bestie β€” this page is from the SRecord Reference Manual, page srec_aomf(5), with srec_cat version 1.65 energy. the footer has no date listed, so I'm absolutely not inventing one πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from