Commit Graph

3 Commits

Author SHA1 Message Date
Kartik Agaram e07a3f2886 4537
Streamline the factorial function; we don't need to save a stack variable
into a register before operating on it. All instructions can take a stack
variable directly.

In the process we found two bugs:

a) Opcode f7 was not implemented correctly. It was internally consistent
but I'd never validated it against a natively running program. Turns out
it encodes multiple instructions, not just 'not'.

b) The way we look up imm32 operands was sometimes reading them before
disp8/disp32 operands.
2018-09-07 22:19:13 -07:00
Kartik Agaram f1b3d7b967 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.
2018-08-30 01:15:45 -07:00
Kartik Agaram a066ad7ed7 4469 2018-08-03 23:42:37 -07:00