Skip to content

feat: TVM String/File I/O Primitives #498

@gHashTag

Description

@gHashTag

Implement 6 minimal opcodes for TVM runtime string and file I/O:

String I/O (3 opcodes)

  • STR_LOAD (0x20): Load string literal from data section
  • STR_CONCAT (0x21): Concatenate two string registers
  • STR_PRINT (0x22): Print string to stdout

File I/O (3 opcodes)

  • FILE_READ (0x23): Read file to string
  • FILE_WRITE (0x24): Write string to file
  • FILE_EXISTS (0x25): Check file exists

Implementation

  • Modified: src/tri27/emu/decoder.zig
  • Modified: src/tri27/emu/executor.zig

Status

✅ Opcodes added to decoder
✅ Execution handlers implemented
✅ Cycle estimates updated
✅ Tests passing

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