Skip to content

TRI-27 emulator: loader.load writes eight-byte words but run fetches four-byte units at pc * 4 #1166

Closed

Description

@dmitrii-f-t27

Where: loader.zig and the fetch in executor.zig at 976df51.

What happens. loader.load writes each code word into an eight-byte memory word from word 3 on, while run fetches four-byte units at pc * 4.

  • A loaded program executes a NOP between every two of its instructions.
  • Its absolute jump targets miss.
  • The path the owner's tests drive copies the file to byte 0 and starts at word 3, so the tests never see this.
  • loader.load is used only by tri_emu_main.zig, which has no build target.

Source: specs/isa/tri27_machine.t27, FINDINGS.

Expected. The loader and the fetch agree on the word size: one code word per fetch unit.

Vector. loader-entry in conformance/trinity/tri27_programs.json. After loader.load, six zero fetches run as NOP before the first real instruction.

Found while writing the S05 specs of #988 (gHashTag/t27#3581); until now it lived only in the spec's FINDINGS. The vectors are replayed by tools/trinity_tri27.py in gHashTag/t27. Tracked in #1164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions