A82: Re: Squares and random numbers
[Prev][Next][Index][Thread]
A82: Re: Squares and random numbers
Drawing a rectangle in the graph mem could be done like this ( I guess) :
DR:
LD HL,GRAPH_MEM
LD DE,GRAPH_MEM+1
LD A,$FF
LD (HL),A
LD BC,11
LDIR
LD A,128
LD HL,GRAPH_MEM+12
LD DE,12
LD B,62
L1:
LD (HL),A
ADD HL,DE
DJNZ L1
LD A,1
LD HL,GRAPH_MEM+12+11
LD B,62
L2:
LD (HL),A
ADD HL,DE
DJNZ L2
LD HL,GRAPH_MEM+63*12
LD DE,GRAPH_MEM+63*12+1
LD A,$FF
LD (HL),A
LD BC,11
LDIR
RET
(I just wrote this down without testing it, but I think it works. You can
always try to compile it).
Most random numbers are generated using the random number routine found in
ZTetris, or similar routines (one will be included in Ash 3.1).
Dines
-----Original Message-----
From: Vimm <vimm@earthlink.net>
To: assembly-82@lists.ticalc.org <assembly-82@lists.ticalc.org>
Date: Monday, October 19, 1998 7:53 PM
Subject: A82: Squares and random numbers
>
>Hello, Mr. Assembly newbie here again. I think I've figured out the
>basics, but now I want to get into the graphics. I seem to learn the
>best from disecting examples, so could someone give me an example of a
>program that would draw a square on the graph? Also, I hear there's no
>clear way to generate random numbers, so could someone tell me what
>would be the best way (or just a good way) for me to generate 10 random
>numbers from 1-13? Thanks for the help!
>
> Vimm
>
Follow-Ups: