Computer Old Farts Forum
 help / color / mirror / Atom feed
* [COFF] Pointers for maths routines in "assembly"
@ 2020-05-25  4:27 wkt
  2020-05-25  5:22 ` ralph
  2020-05-25  9:12 ` dfawcus+lists-coff
  0 siblings, 2 replies; 3+ messages in thread
From: wkt @ 2020-05-25  4:27 UTC (permalink / raw)

Hi all, I have a strange question and I'm looking for pointers.

Assume that you can multiply two 8-bit values in hardware and get a 16-bit
result (e.g. ROM lookup table). It's straightforward to use this to multiply
two 16-bit values:

        AABB *
        PPPP = BB*DD
      QQQQ00 = BB*CC
      RRRR00 = AA*DD
    SSSS0000 = AA*CC
 32-bit result

But if the hardware can only provide the low eight bits of the 8-bit by
8-bit multiply, is it still possible to do a 16-bit by 16-bit multiply?

Next question, is it possible to do 16-bit division when the hardware
can only do 8-bit divided by 8-bit. Ditto 16-bit modulo with only 8-bit

Yes, I could sit down and nut it all out from scratch, but I assume that
somewhere this has already been done and I could use the results.

Thanks in advance for any pointers.

** Back story. I'm designing an 8-bit TTL CPU which has 8-bit multiply, divide
and modulo in a ROM table. I'd like to write subroutines to do 16-bit and
32-bit integer maths.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-25  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25  4:27 [COFF] Pointers for maths routines in "assembly" wkt
2020-05-25  5:22 ` ralph
2020-05-25  9:12 ` dfawcus+lists-coff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).