6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 6:44 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Jun 12, 2022 7:22 pm 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
Hi there, can someone identify where this code snippet came from? Is it public domain? (It didn't look easy to contact Frantic through codebase64 and I'm not part of the C64 scene).

https://codebase64.org/doku.php?id=base ... t&do=admin

It apparently was originally posted here on 6502.org

Could it be the routine BigDumbDinosaur wrote in 1990? (viewtopic.php?f=2&t=6838#p88009)


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 8:09 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Klaus posts a similar bit of code here, adapted from a reference page here, where "Greg" exhibits a routine derived from one in "the 6502 Software Design book by Leo J. Scanlon" (a 1980 book, archived here.)


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 8:36 pm 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895

It looks similar to code presented by dclxvi back in 2005 in this post.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 9:11 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Hmm, that code uses PHA and PLA which the others don't...


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 9:15 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1485
Location: Scotland
jeffythedragonslayer wrote:
Hi there, can someone identify where this code snippet came from? Is it public domain? (It didn't look easy to contact Frantic through codebase64 and I'm not part of the C64 scene).

https://codebase64.org/doku.php?id=base ... t&do=admin

It apparently was originally posted here on 6502.org

Could it be the routine BigDumbDinosaur wrote in 1990? (viewtopic.php?f=2&t=6838#p88009)


It's fairly much generic and very similar to the initial multiplication code I used in my Ruby BCPL code (32x32 bit multiply to get a 64-bit result - it's extendable with ease)

This is where I got my initial code version from: https://llx.com/Neil/a2/mult.html (about half way down the page) which is more or less the same as that.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 9:30 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Certainly the plan of attack is fairly generic. But I see Neil's version uses TAY and TYA - presumably much like Bruce's PHA and PLA - which the others don't.

Also, at the second label, some of the code uses LSR and some uses ROR for the first shift. And some will store after that first shift while others don't store until just before the final return.

So at a forensic level, there are some small choices which are being made differently.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 12, 2022 11:19 pm 
Offline

Joined: Sun Oct 03, 2021 2:17 am
Posts: 114
Thanks. I had seen http://www.6502.org/source/integers/32muldiv.htm before but the way the comment at the top of the snippet on codebase64.org was worded, it sounded like there was a 16-bit multiply with 32-bit product on this site somewhere it was copied from. Based on the similar label names, variable names, and code structure, I believe this codebase64 snippet is a modified version of the 32-bit multiply with 64-bit product by Greg. I have also ordered the Scanlon book to see what the original routine looks like.

A google search of "site:http://6502.org/source/ license" came up with zilch for me, and only one page of results for "site:http://6502.org/source/ copyright" so it is not always easy to tell if something in the source code repository is an orphaned work or public domain or what. Have you considered having adding a note at the top of that page about suggesting licenses when people email contributions? Github does a good job of suggesting people add licenses to their repository for example, so it's usually pretty easy for me to tell how I can use a repo.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron