Date : Sat, 30 Jul 1994 20:19:55 +0100 (BST)
From : clr1@...
Subject: I'm back! Did you miss me? ;-)
I'm going to reply to this message becasue there's a whole load of bits
to include but I haven't actually read the ones after this yet so excuse
me if I say something that's been covered. BTW, thanks to Stephen Quan
for the opcode table; I'm going to go over my 6502 and check them all soon.
> I am afraid, it means taking over control and leaving practically nothing
> in C. This is Chris Rae's method of using the Pascal Compiler. Under,
> Turbo Pascal, I suspect he did something like
>
> Program MyEmulator;
> Begin
> ASM
> /* all ASM stuff goes in here. */
> END;
> End.
Exactly right for those of you who are interested; except I think the
procedure's called Emulate6502...
> So I have decided that :
>
> SI = beeb PC
> AX = opcode (actually AH=0, AL=opcode)
> BH = beeb A
> BL = beeb X
> CH = beeb Y
> CL = beeb S
> DX = unused.
The system I have used (and it's working pretty well) is at the moment:
AL = used for arithmetic
AH = carry and zero flags (from PC flags)
BL = next instruction opcode
BH = unused (needs to be zero for opcode lookup table)
CL = A
CH = X
DL = BBC flags
DH = Y
DS = BBC memory segment
SI = PC
ES = unused
DI = BBC stack pointer
These are tried and tested (I've changed them about a few times and this
is the best set) and my 6502 is nearly working.
> > If I could use assembly in the macros of my code it would enable, amongst
> > other things, the use of using the 386 status register as discussed in
earlier
> > threads.
Is that my thread? I am using the PC status register; not the 386 one -
works on 8086 mode too. I'm not being pedantic; I'm just wondering if
you've got the wrong end of my stick.
+-------------------+-------------------------------------------------+
| /-- |_| /-- | (~ | "And the driving is like the driving of Jehu, |
| \-- | | | | _) | the son of Nimshi, for he drives furiously." |
+-------------------+-------------------- Second Book of Kings 9 v20 -+