srec_fairchild(5)

๐Ÿ’– srec_fairchild โ€” Fairchild Fairbug file format ๐Ÿ’–

okay bestie, so this is the srec_fairchild page from the File Formats Manual โ€” it's literally all about the Fairchild Fairbug file format and I promise it's not as scary as it sounds ๐Ÿซถ


โœจ DESCRIPTION โœจ

so the Fairchild Fairbug format is iconic in the simplest way possible: it's all about 8-byte records ๐ŸŽ€ Your file kicks off with an address record and wraps up with an end-of-file record. that's the whole vibe check โ€” beginning, middle, end, slay.

ngl there are exactly three record types in this format, and here's the tea on each one ๐Ÿ‘‘


๐Ÿฆ‹ the address record

address records look like this, periodt:

โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ S โ”‚ nnnn โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”˜

and what it's giving is: the address for the data records that come after it. it's setting the stage, main character energy fr fr ๐Ÿ’…


๐ŸŒธ the data record

data records are built like this:

โ”Œโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”
โ”‚ X โ”‚ ffffffffffffffff โ”‚ c โ”‚
โ””โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”˜

okay so every single data record begins with an X and always contains 8 data bytes โ€” no more, no less, she does not budge ๐Ÿ˜ค

  • the ff characters are hexadecimal byte values (all 8 bytes of them)
  • every data byte is written out as 2 hexadecimal characters
  • and c is a hex digit that's the nibble-sum of the data bytes ๐Ÿงฎ

so yeah โ€” a 1-digit hexadecimal checksum follows the data in each data record. and what that checksum actually is? it's, in hexadecimal notation, the sum of the binary equivalents of the 16 digits in the record. and the half carry from the fourth bit is ignored โ€” like, just let it go bestie, we don't need it ๐Ÿ’€

okay this next part is lowkey a fun little quirk: the programmer ignores any character between a checksum and the start character of the next data record ๐ŸŽ€ The only exceptions? address characters and the asterisk character, which terminates the data transfer. so that dead space in between? it's free real estate โ€” you can literally drop comments in there and nobody cares ๐Ÿ“


๐Ÿงš the end-of-file record

the last record is just this:

โ”Œโ”€โ”€โ”€โ”
โ”‚ * โ”‚
โ””โ”€โ”€โ”€โ”˜

an asterisk and nothing else โญ and that's it, that's the whole goodbye โ€” it means end of file, curtain down, thank you for coming to my TED talk ๐Ÿ‘‘


๐Ÿ“ Size Multiplier

okay so real talk โ€” this format is not exactly compact ๐Ÿ˜ญ In general, binary data will expand in size by approximately 2.4 times when it's represented with this format. so like... she's pretty, but she is not efficient. know that going in ๐Ÿ’€


๐ŸŒˆ EXAMPLE ๐ŸŒˆ

here's a whole Fairchild Fairbug file, look at her go ๐Ÿ’–

It contains the data โ€œHello, World[rq] to be loaded at address 0x1000. and notice how the last record is padded with 0xFF bytes โ€” yes, she's padding, it's fine, it's aesthetic โœจ

S1000
X48656C6C6F2C2057C
X6F726C64210AFFFF3
*

see how the S1000 sets the address, the two X records carry the bytes, and that lonely * closes it out? chef's kiss, ate, no crumbs ๐Ÿซถ


okay the legal bit, but make it cute โ€” I still have to say all of it, so here we go:

  • srec_cat version 1.65
  • Copyright (C) 1998... Peter Miller

and ngl this part matters: 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. (yes, same command twice โ€” I don't make the rules, I just report them ๐Ÿ’…)


๐ŸŽ€ MAINTAINER ๐ŸŽ€

the people keeping this whole operation running, give them their flowers ๐ŸŒธ

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

bestie reminder: every record is 8 bytes, every data record starts with X and holds exactly 8 data bytes, the checksum is that 1-digit nibble-sum (half carry from the fourth bit, ignored, gone, bye ๐Ÿ‘‹), the * ends everything, and your file is gonna be about 2.4ร— bigger than the binary. that's the whole page, you're basically an expert now ๐Ÿ˜ญ๐Ÿ’–

and that's the page, bestie โ€” from the Reference Manual for SRecord, this very srec_fairchild(5) entry. mwah, go forth and encode ๐Ÿ’‹โœจ

๐Ÿ“ฆ where this page comes from