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.
Attempting to code a password secure OS.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
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,
and
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 .
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
Quote:
I'm not coding in a macro assembler, please, I don't like them.
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,
and
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 .
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
Quote:
I'm not coding in a macro assembler, please, I don't like them.
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.
-
Nightmaretony
- In Memoriam
- Posts: 618
- Joined: 27 Jun 2003
- Location: Meadowbrook
- Contact:
Saustin wrote:
What assembler do you recommend, by the way?
Link:
http://www.hytherion.com/beattidp/comput/x65tools/
HTH,
--Martin
Martin Penny
.sig in beta - full release to follow.
.sig in beta - full release to follow.
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.
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.
- BitWise
- In Memoriam
- Posts: 996
- Joined: 02 Mar 2004
- Location: Berkshire, UK
- Contact:
Saustin wrote:
What assembler do you recommend, by the way?
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
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