diff --git a/src/bdos.rs b/src/bdos.rs index 5adb532..d26e933 100644 --- a/src/bdos.rs +++ b/src/bdos.rs @@ -133,7 +133,7 @@ impl Bdos { }, 3 => { // A_READ - Reader input // Use the console as the reader - res8 = Some(bdos_console::read(env)) + res8 = Some(bdos_console::read_reader(env)) }, 4 => { // A_WRITE - Punch output // Use the console as the punch diff --git a/src/bdos_console.rs b/src/bdos_console.rs index e024b22..c088f94 100644 --- a/src/bdos_console.rs +++ b/src/bdos_console.rs @@ -23,6 +23,13 @@ pub fn write(env: &mut BdosEnvironment, ch: u8) { env.bios.write(ch); } +pub fn read_reader(env: &mut BdosEnvironment) -> u8 { + // The Reader Input function reads the next character from the logical reader + // into register A. Control does not return until the character has been read. + let ch = env.bios.read(); + ch +} + pub fn write_string(env: &mut BdosEnvironment, address: u16) { // The Print String function sends the character string stored in memory at // the location given by DE to the console device, until a $ is encountered