Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Mul-table challenge
2005-10-17 13:26
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....
 
2005-10-17 17:27
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.
2005-10-17 17:30
Graham
Account closed

Registered: Dec 2002
Posts: 990
Nopes, don't clear the decimal flag either. BTW: 38 bytes now :)
2005-10-17 17:39
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!
2005-10-17 18:01
Graham
Account closed

Registered: Dec 2002
Posts: 990
37 bytes...
2005-10-17 18:06
Graham
Account closed

Registered: Dec 2002
Posts: 990
36...
2005-10-17 18:20
tlr

Registered: Sep 2003
Posts: 1790
Quote: 36...

You're scaring me... :) You are not depending on basic or kernal, are you?
2005-10-17 18:23
Graham
Account closed

Registered: Dec 2002
Posts: 990
No basic or kernal used :)
2005-10-17 18:29
tlr

Registered: Sep 2003
Posts: 1790
37 bytes... :) Must think out of the box, must think out of the box...
2005-10-17 18:31
Graham
Account closed

Registered: Dec 2002
Posts: 990
I have to leave soon, should I post the 36 byte version?
2005-10-17 18:37
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Knut Clausen/SHAPE/F..
Sillicon/Unreal
The Human Co../Maste..
Dr.Science/Atlantis
Malmix/Fatzone
ΛΛdZ
Peacemaker/CENSOR/Hi..
t0m3000/hf^boom!^ibx
Scrap/Genesis Project
kbs/Pht/Lxt
MCM/ONSLAUGHT
Conjuror
leonofsgr/Singular C..
Guests online: 135
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.065 sec.