From e07a3f2886b117970b3cd58f7cd6806cbfe5cc4a Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 7 Sep 2018 22:13:10 -0700 Subject: 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. --- subx/apps/factorial | Bin 156 -> 157 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'subx/apps/factorial') diff --git a/subx/apps/factorial b/subx/apps/factorial index daea2cf4..d9501e23 100755 Binary files a/subx/apps/factorial and b/subx/apps/factorial differ -- cgit 1.4.1-2-gfad0