737c974400
- Split tests/ (libc feature tests) and examples/ (real apps); shared
app.mk in repo root, was examples/example.mk
- libc/io/* split into libc/{conio,env,errno,file,mouse,string,sys,
time,video}/ — clearer module boundaries
- New examples/mdview/: markdown viewer (Phases 1-5 + light nested
lists). Headers (H1-H4), HR, ulist/olist/quote with nesting via
leading spaces, fenced code blocks, inline emphasis (bold/italic/
underscore/code), wrap/unwrap mode with soft wrap (F2), horizontal
pan (← →) with '>' truncation indicator
- libc additions: scroll() in conio (ESTEX SCROLL), strlwr/strupr,
gets() test
- Makefile updates across tests/ for the new shared app.mk path
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
24 lines
476 B
C
24 lines
476 B
C
/*
|
|
* getchar via ESTEX RST 10h.
|
|
*
|
|
* ESTEX 0x30 (WAITKEY): blocks until a key, returns
|
|
* A = scan code, D = position code, E = ASCII,
|
|
* C = mode flags, B = shift flags.
|
|
*
|
|
* IX is preserved (RST 10h clobbers it; callers rely on it as frame pointer).
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
int getchar(void) __naked
|
|
{
|
|
__asm
|
|
push ix
|
|
ld c, #0x30 ; ESTEX WAITKEY
|
|
rst #0x10
|
|
pop ix
|
|
ld d, #0
|
|
ret
|
|
__endasm;
|
|
}
|