From bf7fe756a175a90dd82e970e5d620c6d8c459c17 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 11 Mar 2023 16:24:25 -0500 Subject: u. um* --- msp430/alee-msp430.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'msp430/alee-msp430.cpp') diff --git a/msp430/alee-msp430.cpp b/msp430/alee-msp430.cpp index ca00026..0ec6c88 100644 --- a/msp430/alee-msp430.cpp +++ b/msp430/alee-msp430.cpp @@ -29,7 +29,7 @@ static char strbuf[32]; static void readchar(State& state); static void serput(int c); static void serputs(const char *s); -static void printint(int n, char *buf); +static void printint(DoubleCell n, char *buf); int main() { @@ -118,7 +118,7 @@ void serputs(const char *s) serput(*s++); } -void printint(int n, char *buf) +void printint(DoubleCell n, char *buf) { char *ptr = buf; bool neg = n < 0; @@ -146,13 +146,16 @@ void user_sys(State& state) printint(state.pop(), strbuf); break; case 1: - serput(state.pop()); + printint(static_cast(state.pop()), strbuf); break; case 2: + serput(state.pop()); + break; + case 3: { auto addr = state.pop(); *reinterpret_cast(addr) = state.pop(); } break; - case 3: + case 4: state.push(*reinterpret_cast(state.pop())); break; default: -- cgit v1.2.3