6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Jul 07, 2024 10:51 am

All times are UTC




Post new topic Reply to topic  [ 56 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
PostPosted: Sun Oct 16, 2016 8:11 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8464
Location: Southern California
BigDumbDinosaur wrote:
However, a year or two later when you revisit the function, such as to add features, you'll be glad you committed your thoughts at the time to "paper."

<snip>

and when the occasion arose in which I would have to maintain a program I had written long ago I didn't have to rely on memory to figure out why I wrote things the way I did.

Yep. "Self-documenting code" does not mean you don't have to comment. It just helps. Even if the code is very clear about what it's doing, it does not tell why you chose to do it that way. The comments are not optional. There have been times that I looked at something and thought, "Wow, there's a better way to do that!" and then after wasting a lot of time on it, came full circle because I re-discovered why it had to be done the way it was and not the way I thought was better. Comments would have saved the time.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 18, 2016 6:47 pm 
Offline

Joined: Fri Nov 18, 2016 6:35 pm
Posts: 7
Interesting reading.

My longest ever 6502 program was just over 5,000 lines. It was a game written originally in ODS (Ocean Development System) a cross assembler that used a C128 in 80 column mode to target a C64 using the user port to transfer the code. I had some friends in the industry way back when I got this from, and after using Turbo Assembler on the C64 this made things a lot easier/faster. I think this was maybe a precursor to PDS but im not 100% sure.

I recently wrote a small python script to convert the tokenised source code from ODS to plain text. If anyone is interested pm and ill send it to you.

There was a cartridge in the back of the C64 that held the program that managed the file transfer from ODS on the C128. This is lost now, and if I can ever be bothered I might write some code to try and get it working again.

I found my original source code and I had converted it across to Laser Genius assembler so I could link the multiple source files to generate the final program.

Comments are a thing I thought were unnecessary :) Looking at some of my old source code I havent a clue what is going on, wish I had commented it. Let me know if you want to see what 5000+ lines of uncommented code looks like :)


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 18, 2016 8:20 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3366
Location: Ontario, Canada
deanflyer wrote:
There was a cartridge in the back of the C64 that held the program that managed the file transfer from ODS on the C128. This is lost now, and if I can ever be bothered I might write some code to try and get it working again.
Welcome, deanflyer. :) Is this this cartridge a proprietary product? I don't recall hearing about such a thing, although I may easily have missed it.

deanflyer wrote:
Let me know if you want to see what 5000+ lines of uncommented code looks like :)
Um, well, it's very generous of you to offer, I'm sure! Um... :roll:

J. :D

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 18, 2016 8:35 pm 
Offline

Joined: Fri Nov 18, 2016 6:35 pm
Posts: 7
It was proprietary, part of the ODS system, although the cartridge I had was just a hacked CBM cartridge with a dump of the EPROM.


Top
 Profile  
Reply with quote  
PostPosted: Sat Nov 19, 2016 6:01 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8254
Location: Midwestern USA
deanflyer wrote:
Let me know if you want to see what 5000+ lines of uncommented code looks like :)

Uh...been there, don't want to go back. :cry:

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 16, 2017 5:48 am 
Offline

Joined: Tue Jun 08, 2004 11:51 pm
Posts: 213
I'd never done much 6502. Over the years, I'd just never
got around to the 6502.
Just recently, I wanted to get my KIM-1 working and that started
me on my KIM debug kit. It required writing code snippits to test
different functions on the KIM's circuits.
While looking through things, I came across someone that said that
QuickSort was known as the fastest sort. I knew that was wrong so
I sat down to write a distribution sort for 1K 16bit integers. It had a lot
of bugs. But luckily, another friend was able to find them and clean
my code up.
It is still a large program for me to write in an assembly language that
I'd never had much experience in.
You can critique it in the sort thread recently posted.
Use the last code posted as that is believed to be bug free.
The fellow that debugged it didn't really understand what the
program does.
Dwight


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 17, 2017 10:44 pm 
Offline

Joined: Tue Jan 17, 2017 10:39 pm
Posts: 1
Mine was an extention to Microsoft Basic 1.0 on the UK101 which required 2 8K roms when assembled. It was written on a PDP/11 using the Kim1 Assembler program and added over 70 different commands to the on board basic.

Regards

Rich


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 18, 2017 2:47 am 
Offline

Joined: Tue Jun 08, 2004 11:51 pm
Posts: 213
I think, more interesting would be how much functionality
in a small program space.
Something like most efficient use of space.
Dwight


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 18, 2017 3:39 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3366
Location: Ontario, Canada
Interesting point, Dwight.

Welcome, Rich6502 !

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 18, 2017 2:27 pm 
Offline

Joined: Tue Nov 01, 2016 12:28 pm
Posts: 59
BigDumbDinosaur wrote:
deanflyer wrote:
Let me know if you want to see what 5000+ lines of uncommented code looks like :)

Uh...been there, don't want to go back. :cry:


I printed the disassembly of the C64 rom and started to read through it to reverse engineer it myself. Would have been in the last 80's because we could just get on the internet and download it. Basically reading through half a box of printer paper of uncommented code and referencing what snippets were documented in the programmers reference guide and trying to document it myself.

I don't think I ever finished writing more than a few pages of code myself, project ADD I guess.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 19, 2017 12:14 am 
Offline
User avatar

Joined: Mon Jan 09, 2017 10:16 pm
Posts: 14
Location: Mexico, Mexico
My biggest 6502 project would be my Space Raid game for Atari 2600, circa 2013, it accounts for 5102 lines.

_________________
Author, IOCCC+JS1K winner, Princess Quest in Evercade Intellivision, MSX/Atari/CV/Intellivision/SMS game dev, Knight of boot sector games, IntyBASIC creator.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 56 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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: