Date : Mon, 08 Aug 1994 09:56:11 EST
From : Stephen Quan <quan@...>
Subject: more on emulator implementation.
This is extracted from 1-1 email between me a Chris Rae:
Chris Rae writes :
> Re LODSB vs LAHF - don't worry about questioning my logic! The only way
> programs progress is by having their logic questioned. I never really
> meant that my way was the "correct" way and yours wasn't; we've really
> just chosen different ways of going about things. BTW, how *do* you
> handle the flags?
Ok, what I have done (at it is in operation now). Is design not 1 emulator
but 16 emulators. In other words, I have 16 256-branching loops and so
forth. Each emulator for every combination of N,V,Z and C. I have called
my emulators N0V0Z0C0 .... N1V1Z1C1. For instance, say if I had to
implement SEC for one of my emulators, e.g.
N0V0Z0C0_SEC:
jmp N0V0Z0C1
For more complex instructions :
N0V0Z0C0_INX:
inc cl (or whatever register that holds X)
js N1V0Z0C0
jnz N0V0Z0C0
jmp N0V0Z1C0
So you see, I am really using the PC's status registers after all.
--
Stephen Quan (quan@... ), SysAdmin, Analyst/Programmer.
Centre for Spatial Information Studies, University of Tasmania, Hobart.
GPO BOX 252C, Australia, 7001. Local Tel: (002) 202898 Fax: (002) 240282
International Callers use +6102 instead of (002).