[Coco] Random Numbers in 6809 assembly
Roger Taylor
rtaylor at bayou.com
Thu Dec 30 14:53:26 EST 2004
At 04:41 AM 12/30/2004, you wrote:
>Please also note that I'm using good-old fashioned disk edtasm, as for some
>reason portal-9 doesn't cooperate with my computer, and when I use cm.exe I
>cant import the binaries properly to virtual coco disks.. life's tough :P
>
>If anyone can help with a random number generating routine, it would be
>wonderful!
>
>Thanks
>David R
What problems are you having with Portal-9? This is probably something
you're overlooking.
Make sure you enter a filename into the "output filename" field in the left
panel, so that the IDE can control what CCASM outputs as the binary
program's filename. This way, the same name can be passed to the
IMGTOOL.EXE utility which will import the file onto the virtual
disk. Otherwise, entering no name in the "output filename" field will
cause CCASM to create a default filename for the output file. This is
usually {sourcefile}.bin, but we need to force a name so that all involved
tools are aware.
Generating a psuedo-random number sequence can be as easy as choosing a
starting number (0-65535), then for each generation, do something like LDD
SEED, multiply x 13709, ADDD #13849, STD SEED. The seed can also be a CPU
address, like the start of the ROM memory, and you can peek each address
for your random number, but perform other actions on the values.
--
Roger Taylor
More information about the Coco
mailing list