Search found 8 matches

by twh1st
Tue Mar 17, 2009 11:11 pm
Forum: Programming
Topic: exomizer code example?
Replies: 0
Views: 3291

exomizer code example?

Hello *,

do you guys know the Exomizer? it is a great packing tool optimized for 6502 applications. it compresses executables as well as raw data.

http://hem.bredband.net/magli143/exo/

however, I failed to do some prototypes. I would like to create an example on how the Exomizer can be used to ...
by twh1st
Tue Feb 19, 2008 7:42 pm
Forum: Programming
Topic: 16bit inc/dec indirectly
Replies: 13
Views: 9696

kc5tja's TAX INX/DEX TXA is necessary if you're using the old NMOS 6502. If you're not using a Commodore 64 or something where you're stuck with NMOS, I always recommend using the CMOS 6502 instead, partly for the added instructions.


I'm coding with an Atari 8bit. I never heard of different 6502 ...
by twh1st
Tue Feb 19, 2008 7:37 pm
Forum: Programming
Topic: 16bit inc/dec indirectly
Replies: 13
Views: 9696

excellent!!! thank you guys!

btw, I forgot to copy'n'paste the "ldy #0" .. it was not meant to be set implicitly. :-)

grtx,
\twh
by twh1st
Mon Feb 18, 2008 10:22 pm
Forum: Programming
Topic: 16bit inc/dec indirectly
Replies: 13
Views: 9696

16bit inc/dec indirectly

Hey *,

how would you solve this problem.

i like to 16bit-INC/DEC a value stored under address ptr1 (zp).


clc
lda #1
adc (ptr1),y
sta (ptr1),y
bne *+9
ldy #1
sec
adc (ptr1),y
sta (ptr1),y

While INC looks kind of ok (but still I'm sure there would a better way) I have so my doubts ...
by twh1st
Thu Oct 04, 2007 9:30 pm
Forum: General Discussions
Topic: A very nice 6502
Replies: 2
Views: 3681

A very nice 6502

Hey *,

look here for a very nice 6502 unit :)

http://cgi.ebay.de/Prozessor-6502-Mikrocomputer-Evaluationssystem-Labor_W0QQitemZ120165816041QQcmdZViewItem?hash=item120165816041

grtx,
\twh

p.s.: i'm not related to this auction in this or the other way. it's just fascinating to see this kind of lab ...
by twh1st
Thu Oct 05, 2006 7:36 pm
Forum: Programming
Topic: rand() % 192
Replies: 10
Views: 8675


The expression 32 + rand () % 160 generates a number in the range 32 to 191 and not 32 to 160.

true that. I was wrong with my example. Thx for the correction :)

though nothing complicated, this is the generic version:


r = [rand() % (t-b)] + b


and here my version in 6502 assembler ...
by twh1st
Thu Oct 05, 2006 2:44 pm
Forum: Programming
Topic: rand() % 192
Replies: 10
Views: 8675

Re: rand() % 192


First of all, %192 will limit the range to 0-191, not 0 to 192, I think. Also, if you do that, the numbers in the range 0 to 63 are twice as likely to come up as the numbers in the range 64 to 191. But if thats really what you want you can do it like this: lda random
cmp limit
bcc -
sbc limit ...
by twh1st
Wed Oct 04, 2006 11:26 pm
Forum: Programming
Topic: rand() % 192
Replies: 10
Views: 8675

rand() % 192

Hello everbody,

Obviously I'm new to 6502 assembler. Maybe all too simple, but how do I translate this C-style line into 6502:


int i = rand() % 192


let's say I am able to produce a random 8bit number. I want to limit the max value of the randomly generated number to 192. So everything between ...