Jump to content

Hexadecimal: Difference between revisions

From EDM2
mNo edit summary
m Reiknir moved page Hex to Hexadecimal
(No difference)

Revision as of 18:31, 14 February 2016

Base 16, also known as Hexadecimal or Hex is a numbering system that has a radix of 16 and therefore a natural encoding for 16 bit systems and processors, and commonly used to represent values for 32, 64 and 128 bit systems as well.

Hex file format

An plain text file that uses hexadecimal values to store machine language code in, it was a common way to store data and executables in the early days of personal computing computing when operating systems were less common than simple loaders and machine code monitors, but in modern day use it is primarily used for files that need to be loaded directly into a memory address such as files to be loaded into microcontrollers, firmware files and so on.

Intel hex files

By far the most common of these is the Intel Hex (ihex) format although other formats did exist at one point in time. The intel format is very simple and is just a sequence of lines like this one:

:10012000194E79234623965778239EDA3F01B2CAA7

Which represent the following:

Start code Byte count Address Record type Data Checksum
: 10 0120 00 19 4E 79 23 46 23 96 57 78 23 9E DA 3F 01 B2 CA A7
Semicolon 2 hex digits representing the number of bytes in data field. Max 0xFF (255) 4 hex digits representing 16-bit beginning memory address offset See below Sequence of bytes Two's complement of all hex numbers in the line added together
Record types
  • 00 Data
  • 01 End Of File
  • 02 Extended Segment Address
  • 03 Start Segment Address
  • 04 Extended Linear Address
  • 05 Start Linear Address

The last line in the file must always be record type 01 which represents "End Of File" or

:00000001FF

OS/2 text editors with Hex file support

  • jEdit - Java based - Hex file syntax highlighting built in - Current.