home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!newshost!rpb
- From: rpb@psy.ox.ac.uk (Ray Bellis)
- Newsgroups: comp.sys.m6809
- Subject: Re: PD m6809 asm/disasm/sim
- Message-ID: <RPB.93Jan22121602@brain.psy.ox.ac.uk>
- Date: 22 Jan 93 12:16:02 GMT
- References: <C0v2us.3Ko@shograf.com> <RPB.93Jan16141030@brain.psy.ox.ac.uk>
- <74017@cup.portal.com>
- Organization: Dept. of Experimental Psychology, Oxford, England.
- Lines: 69
- In-reply-to: blackbelt@cup.portal.com's message of 21 Jan 93 03:13:19 GMT
-
- In article <74017@cup.portal.com> blackbelt@cup.portal.com (Ben - Williams) writes:
-
- flags &= ~(V)[D
-
- darn line noise... one more time
-
- flags &= ~(V);
- flags |= vtable[(operand1 << 8)+operand2]; and you've got it.
-
- if you need carry, you add that too. :^)
- Or, you can use two tables, based on whether you have carry or not.
-
- you really only need 8k of memory per table, but your effciency falls
- out the window.
-
- I'm using a function like the following to do an entire `adc' along
- with the `h' bit:
-
- adc(Byte& x)
- {
- Byte m = fetch_operand();
-
- {
- Byte t = (x & 0x0f) + (m & 0x0f) + cc.bit.c;
- cc.bit.h = btst(t, 4);
- }
-
- {
- Byte t = (x & 0x7f) + (m & 0x7f) + cc.bit.c;
- cc.bit.v = btst(t, 7);
- }
-
- {
- Word t = (Word)x + m + cc.bit.c;
- cc.bit.c = btst(t, 16);
- x = (Byte)t;
- }
-
- cc.bit.v ^= cc.bit.c; // V = Cout7 XOR Cout6
- cc.bit.z = !x;
- cc.bit.n = btst(x, 7);
- }
-
- This works, but needs a fair bit of CPU time to calculate. I've
- implemented all of the address mode decoding and now I'm in the
- process of writing functions like the above for every instruction.
-
- I wrote a simple loop:
-
- start addb #$01
- bne start
- adda #$01
- bne start
- *halt*
-
- and got around 450,000 `read accesses' per second on a SPARC IPX.
-
- Ray.
-
-
-
- --
- ------------------------------------------------------------------------------
- R. P. Bellis E-Mail: <rpb@psy.ox.ac.uk>
- Dept. of Experimental Psychology Whois: (RB83)
- University of Oxford Tel: +44 865 271419
- South Parks Road Fax: +44 865 310447
- Oxford OX1 3UD
- ------------------------------------------------------------------------------
-