about summary refs log tree commit diff stats
path: root/subx/030---operands.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-08-30 01:15:45 -0700
committerKartik Agaram <vc@akkartik.com>2018-08-30 01:15:45 -0700
commitf1b3d7b96749165d771b279b56cc05447b7db3e0 (patch)
tree0b9ce4b47746827ac9703bdf10d4976c98ae058d /subx/030---operands.cc
parent51e3e6cec3aea2589513e946f187d9c4bc8eadb3 (diff)
downloadmu-f1b3d7b96749165d771b279b56cc05447b7db3e0.tar.gz
4527 - reading commandline arguments
The new example ex9 doesn't yet work natively.

In the process I've emulated the kernel's role in providing args, implemented
a couple of instructions acting on 8-bit operands (useful for ASCII string
operations), and begun the start of the standard library (ascii_length
is the same as strlen).

At the level of SubX we're just only going to support ASCII.
Diffstat (limited to 'subx/030---operands.cc')
-rw-r--r--subx/030---operands.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/subx/030---operands.cc b/subx/030---operands.cc
index aa3f2ded..3e103b66 100644
--- a/subx/030---operands.cc
+++ b/subx/030---operands.cc
@@ -271,6 +271,7 @@ word hex_byte_text(uint8_t val) {
 
 string hex_byte_to_string(uint8_t val) {
   ostringstream out;
+  // uint8_t prints without padding, but int8_t will expand to 32 bits again
   out << HEXBYTE << NUM(val);
   return out.str();
 }