Skip to content

v0.6.0 - Console I/O System Calls

Choose a tag to compare

@kirisaki kirisaki released this 31 Oct 03:21
· 61 commits to main since this release

New Features

Console I/O System Calls

  • Add SYS_EMIT (0x30) - Output one character ( c -- )
  • Add SYS_KEY (0x31) - Input one character ( -- c )
  • Console I/O range reserved: 0x30-0x3F

HAL API Extensions

  • Add v4_hal_putc(char c) for character output
  • Add v4_hal_getc(char *out_c) for character input
  • Implement HAL wrapper bridge in src/hal_wrapper.cpp

Mock HAL Enhancements

  • Add console I/O mock with input injection and output capture
  • mock_hal_console_inject_input() for testing input
  • mock_hal_console_get_output() for verifying output

Tests

  • Add 3 new test cases for SYS_EMIT and SYS_KEY
  • All tests pass (13/13 with 46 assertions)

Implementation Details

  • SYS_EMIT: Pops character from data stack, outputs via HAL
  • SYS_KEY: Reads character from HAL, pushes to data stack with error code
  • Blocking I/O: v4_hal_getc() blocks until data available

Full Changelog

  • Add Console I/O SYS instructions (EMIT and KEY) (d99af3b)

Dependencies

  • Requires V4-hal >= 0.2.0 for console I/O support