6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 2:37 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Sep 28, 2008 6:53 am 
Offline

Joined: Sun Sep 28, 2008 6:48 am
Posts: 3
I'm making a Operating System as my first project in 6502 Commodore asembly.

I have ran into a stump..
I know how to:
Grab input, Print output, and all that good stuff.

However, I'm trying to make a password protection part, and idiodically I thought of a simple code, which doesn't work.


I'm not coding in a macro assembler, please, I don't like them.

So, how can I get a word [over atleast 5 letters], store them at a location in the RAM, then compare them?



Offtopic:
How could I make a random number generator, aswell? Mucho gracias.
- Saustin.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 28, 2008 7:33 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
That's a pretty general question. Maybe you should post your code and let the forum members inspect it. A couple of ways to do it are at http://6502.org/source/strings/patmatch.htm and http://6502.org/source/strings/comparisons.html on this web site. I have not looked at them in any detail. You may be able to shorten them for your application.

There's a random-number generator at http://6502.org/source/integers/random/random.html also on this website, from Bruce who's very good at algorithms. It looks like he has various versions there.

You say however,
Quote:
I'm making a Operating System as my first project in 6502 Commodore asembly

and
Quote:
I'm not coding in a macro assembler, please, I don't like them.

Are you just hand-assembling? That's actually good for beginners; but to get to projects of any substantial size, you will eventually have to use an assembler. A macroassembler does not mean you have to use macros, but writing and using them effectively raises the level of the language to the next step, making code more efficient, more manageable and maintainable, and more bug-free, without penalties in run speed or code size. I give a couple examples of macros in my tips at viewtopic.php?p=2341#2341 .


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 28, 2008 8:07 am 
Offline

Joined: Sun Sep 28, 2008 6:48 am
Posts: 3
GARTHWILSON wrote:
That's a pretty general question. Maybe you should post your code and let the forum members inspect it. A couple of ways to do it are at http://6502.org/source/strings/patmatch.htm and http://6502.org/source/strings/comparisons.html on this web site. I have not looked at them in any detail. You may be able to shorten them for your application.

There's a random-number generator at http://6502.org/source/integers/random/random.html also on this website, from Bruce who's very good at algorithms. It looks like he has various versions there.

You say however,
Quote:
I'm making a Operating System as my first project in 6502 Commodore asembly

and
Quote:
I'm not coding in a macro assembler, please, I don't like them.

Are you just hand-assembling? That's actually good for beginners; but to get to projects of any substantial size, you will eventually have to use an assembler. A macroassembler does not mean you have to use macros, but writing and using them effectively raises the level of the language to the next step, making code more efficient, more manageable and maintainable, and more bug-free, without penalties in run speed or code size. I give a couple examples of macros in my tips at viewtopic.php?p=2341#2341 .


Mighty thanks for the fast response, and yes, I'm quite a beginner.
Thanks for those 3 links, they look quite good. I guess Jim Butterfield's book won't teach you all of that, will it? Not really.
By the way, as my assembler if you think I was POKEing each byte into memory, that'd be kind of sad, I was actually using my C-128's [yes it's a emulator] with it's monitor to do that.

What assembler do you recommend, by the way?

Again, thanks. I will look into using a different form of assembler.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 28, 2008 7:53 pm 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
My personal favorite is the Mike Kowalski assembler. It is a freebie linked in here. I've been doing a pinball program with it.

_________________
"My biggest dream in life? Building black plywood Habitrails"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 28, 2008 7:53 pm 
Offline

Joined: Tue Sep 24, 2002 4:56 pm
Posts: 50
Location: Essex, UK
Saustin wrote:
What assembler do you recommend, by the way?


I've been making use of Douglas Beattie's "MAS65" assembler - at least, the DOS version of it, as I can get it to run in a command window under Windows XP.

Link:
http://www.hytherion.com/beattidp/comput/x65tools/

HTH,

--Martin

_________________
Martin Penny

.sig in beta - full release to follow.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Sep 28, 2008 8:26 pm 
Offline

Joined: Sun Sep 28, 2008 6:48 am
Posts: 3
Thanks guys. :o


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 29, 2008 3:18 am 
Offline
User avatar

Joined: Thu Mar 11, 2004 7:42 am
Posts: 362
GARTHWILSON wrote:
There's a random-number generator at http://6502.org/source/integers/random/random.html also on this website, from Bruce who's very good at algorithms. It looks like he has various versions there.


I should point out that even though there are several routines, it's only one type of generator, specifically a linear congruential generator. The routines give you many ways to use the generator, whether you're looking for small space, fast speed, 8 or 16-bit random integers, or something that can be used from EhBASIC.

In addition to my routines, among the many fine items on Lee Davison's website are a couple of routines for a different type of generator, an LFSR. They are at:

http://members.lycos.co.uk/leeedavison/ ... /prng.html

Not to hijack the thread, but I was recently monkeying around with a variation on the LFSR / combined Tausworthe theme, in an attempt to address the limitations of just a plain old LFSR. The result has a several nice features: all 2^32 values are equally likely, it's easy to seed, its period can be made very long (over 2^6972593, though you need more than 64k to hold that much state, so you'd probably go with a 65816 there), it makes efficient use of state, and it is extremely fast. I've only worked out a small amount of the theory (enough to support my previous claims), but the result of the initial experiments were astonishingly (to me) promising. I have not yet subjected it to any of the various randomness statistical test suites out there, but I've grabbed a few of them from the web (NIST, L'Ecuyer, Diehard), and I'd like try them sometime.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Sep 29, 2008 12:20 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Saustin wrote:
What assembler do you recommend, by the way?

I wrote my own macro-assembler/linker/librarian package in Java a while back when XP's second support pack broke DOS compatibility. It supports the 6502/65C02/65816 and a few other variants.

http://www.obelisk.demon.co.uk/files/6502.zip

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


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

All times are UTC


Who is online

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