Search found 68 matches

by qwertyface
04 Nov 2021, 18:43
Forum: Hardware and software hacking
Topic: Implementing a faster multiplication routine
Replies: 25
Views: 11219

Re: Implementing a faster multiplication routine

This sounds like Amdhal's Law paying a practical visit, optimising only one part of an algorithm can often have surprising results such as this. But when you sit down and think about what is going on, it starts to make sense. I think it's very generous of you all to assume that my code didn't just ...
by qwertyface
04 Nov 2021, 15:24
Forum: Hardware and software hacking
Topic: Implementing a faster multiplication routine
Replies: 25
Views: 11219

Re: Implementing a faster multiplication routine

Speaking of the "weird instruction," [if (A != 0) PC = hi(PC)|A], that is $hEE. I found that on this site: https://www.iwriteiam.nl/PGigatron.html That's actually the site that I refer to all the time when writing native code, but for obvious reasons I tend to look at the smaller list of ...
by qwertyface
04 Nov 2021, 09:02
Forum: Hardware and software hacking
Topic: Implementing a faster multiplication routine
Replies: 25
Views: 11219

Re: Implementing a faster multiplication routine

Thinking more about it, your multiplication is 120 cycles long, therefore it runs once per usable scanline. The loop above runs 9 time and needs at least one scanline per iteration. Even if it were written in native code, one would not do more than two iterations per scanline. So your multplication...
by qwertyface
03 Nov 2021, 16:17
Forum: Hardware and software hacking
Topic: Implementing a faster multiplication routine
Replies: 25
Views: 11219

Re: Implementing a faster multiplication routine

Part 2: 7-bit to 8-bit and a Slow Fast Mandelbrot I had written a multiplication routine that could multiply two 7-bit numbers, giving a 14-bit result, but it seemed to me like really what I should expose to vCPU is a routine that multiplies two bytes, and returns a 16-bit result. This would be a m...
by qwertyface
21 Oct 2021, 12:10
Forum: Hardware and software hacking
Topic: Implementing a faster multiplication routine
Replies: 25
Views: 11219

Re: Implementing a faster multiplication routine

Thanks, it gets more interesting.
by qwertyface
20 Oct 2021, 21:31
Forum: Hardware and software hacking
Topic: Implementing a faster multiplication routine
Replies: 25
Views: 11219

Re: Implementing a faster multiplication routine

Part 1: bne ac When I looked at 6502 implementations of the Quarter-Square algorithm, what I found was that they tended to use four pages for their lookup tables (1 KiB). This allows them to multiply any two bytes - two pages would hold the high and low bytes for the quarter-squares 0-255, and two ...
by qwertyface
20 Oct 2021, 16:18
Forum: Hardware and software hacking
Topic: Implementing a faster multiplication routine
Replies: 25
Views: 11219

Implementing a faster multiplication routine

Part 0: It was known to the ancient Babylonians Hi All, For some reason I found myself reading the Wikipedia article Multiplication Algorithm earlier in the year, and came across Quarter Square Multiplication . The idea is that if you have a table of floored quartered square numbers (0, 0, 1, 2, 4,...
by qwertyface
05 Jul 2021, 13:04
Forum: Hardware and software hacking
Topic: Additional facilities for native code programming / a new SYS function calling convention
Replies: 3
Views: 2539

Re: Additional facilities for native code programming / a new SYS function calling convention

Thanks for taking the time to reply - I'm glad that you don't think my thoughts are completely crazy! I still want to have a play with this idea, but it's about three down on my stack of Gigatron things I want to do. I see a couple of major issues with the approach I described above: If we imagine t...
by qwertyface
24 Jun 2021, 12:09
Forum: Hardware and software hacking
Topic: Additional facilities for native code programming / a new SYS function calling convention
Replies: 3
Views: 2539

Additional facilities for native code programming / a new SYS function calling convention

Hi everyone, I've been pondering a bit on the native-code / SYS function interface, and if and how it could be changed to support a more structured style of native-code programming. I'm largely just writing this to get these ideas out of my head (where they've been quite distracting). I think this i...
by qwertyface
22 Jun 2021, 08:12
Forum: Hardware and software hacking
Topic: New vCPU instructions 2.0
Replies: 95
Views: 51910

Re: New vCPU instructions 2.0

Yes, I think to do both bytes and the transfer in 30 is not possible. If you could do it in two-phases it should work (but how would you dispatch to different code the on the second and subsequent calls?). My implementation of Arithmetic shift-right is 45 excluding the cost of dispatch and I thought...