PostHeaderIcon ATtiny88A: Where the Program Starts and What That Fixes

An image has no index. There are no function names, no section headers, no entry in a table that says where anything is. There is one fixed point: address zero, where the processor begins after reset.

Everything else in the file is found by starting there and following. That makes the first instruction structurally the most important bytes in the dump, and it makes a wrong reading of it expensive — every conclusion downstream inherits the error.

What the first words contain

The reset vector is a jump, and on this architecture an absolute jump occupies two words: the opcode with low target bits, then the high bits. Decoding it gives two facts immediately:

  • The instruction is a jump, which confirms the image starts where it should.
  • The target is an address, which is where the program actually begins.

That second fact is the map. The target is typically just past the interrupt vector table, but not always: a build that places a large table or a constant block immediately after the vectors will have its first real instruction much further along. Either way, the target is where to start reading.

What the vector table contributes

Between address zero and the target sit the interrupt vectors, one slot each. They are jumps too, and their targets point at the handlers.

Reading them in order produces a compact description of how the firmware is organised:

What the vectors say What it implies
All point to one address Interrupts enabled but mostly unhandled
Each points somewhere distinct Event-driven design, handlers matter
Several point just past the table Handlers are inline, immediately after
All point into a single region A dispatcher reads a flag and branches

The fourth pattern is common in compact firmware and it means the real logic is in the dispatcher, not in the handlers. Knowing that saves reading each handler separately.

Why the entry point matters for a reconstruction

A reconstruction that starts reading at the wrong place produces code that is internally consistent and externally wrong. It compiles, it disassembles plausibly, and it omits whatever came before the starting point — usually the initialisation sequence, which is where the design’s assumptions are stated.

Initialisation is the most informative part of a small program. It sets the clock, the port directions, the peripheral enables, and the initial state of every output. A reconstruction that skips it produces a functional description with no context, and the context is what a customer usually needs.

What “program” means on a part with no boot section

There is no second container here. The whole array is the program: vectors, initialisation, application, and whatever constant data the build placed at the end.

That rules out two questions that arise on larger parts — whether a bootloader is present, and whether part of the logic lives in a protected region. Neither applies. The image is one thing, and if it is readable it is complete.

It also means there is no self-programming path. The device cannot rewrite itself, so any field update happens through the programming pins. That is a design constraint worth noting in a report, because it explains why the product has a header.

The reading sequence

  1. Signature, fuses, lock byte. Fuses first, because a clock that is not there produces silence.
  2. Array read, verified page by page.
  3. Decode the reset vector: confirm the jump and record the target.
  4. Walk the vector table at the documented spacing, recording each target.
  5. Begin the reconstruction at the target from step 3, not at address zero.

Step 5 is the discipline that keeps the work honest. Reading from zero means reading data as code, and data decoded as instructions is the most common source of confident nonsense in this work.

Related notes

FAQ

Is the program always at address zero? The vector is. The code it jumps to is usually a short distance later.

Can the vector be redirected? Not on this family. There is no boot section and no redirection fuse.

Why decode the vector before reading code? Because it is the only fixed reference in the image. Everything else is relative to it.

What if the first word is not a jump? Then the read is misaligned, or the image is not what it appears to be. Both are worth resolving before going further.

Conclusion

An image is a graph with one known node. Decoding the reset vector finds the second node, and the vector table describes the shape around it. Starting the reconstruction from that point rather than from address zero is what separates a description of the program from a description of the file.

Comments are closed.