| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Mul-table challenge
I was just coding another multiplication and once again I had to code a mul-table generator. Somehow I felt like doing it as small as possible and settle this forever. The routine should create:
- function: int((x*x)/4)
- x = 0 to 511
- two tables: 512 low bytes and 512 high bytes
- no dependencies on previous zeropage or register settings
So far I managed to do it in 54 bytes (RTS not included), is anyone able to do a smaller version?
EDIT:
53 bytes now :) |
|
... 41 posts hidden. Click here to view all posts.... |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote: Ok 43 bytes now here... getting closer :)
:)
I just noticed I don't clear the decimal mode flag, but I'm guessing you don't either, right?
I wonder how different our routines can be if they are this close in size? It will be very interresting to compare. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Nopes, don't clear the decimal flag either. BTW: 38 bytes now :) |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote: Nopes, don't clear the decimal flag either. BTW: 38 bytes now :)
Ok... time to get back to the code then! ;) Good thing I have fresh coffee! |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
37 bytes... |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
36... |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Quote: 36...
You're scaring me... :) You are not depending on basic or kernal, are you? |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
No basic or kernal used :) |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
37 bytes... :) Must think out of the box, must think out of the box... |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
I have to leave soon, should I post the 36 byte version? |
| |
tlr
Registered: Sep 2003 Posts: 1790 |
Sure! I'll post my 37 byte version, we can compare for fun, and someone else may shorten them further. ;) |
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next |