[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: And now, from the author of the DOS Disk post, a post that actually relates to this newsgroup.



In article <1e17yeq.16d8k6h1ff8ugwN%dempson@actrix.gen.nz>,
dempson@actrix.gen.nz (David Empson) wrote:

> Jon Bettencourt <jonINTERNETrelayCHAT@napaVALLEYnet.CLARInet> wrote:
> 
> > Is there any way to compile an Applesoft BASIC file to machine language?
> > Either a BIN file or a SYS file; BIN would probably be easier to do.
> 
> There was the ancient TASC compiler, which worked under DOS 3.3.
> 
> > I tried the Beagle BASIC Compiler, but it seems to only compile COM files,
> 
> Is this 'COM' a ProDOS file type?  According to the file type notes,
> 'COM' is file type $59, and is described as a "Communications file",
> with an application-specific auxiliary type.  None of these had been
> defined as of the last publication of the file type notes.

No. This COM is of type $FA.

> I've never used Beagle Basic, but it might be using this filetype for
> some kind of special binary image file which needs to be used in
> conjunctin with a front end or runtime engine.
> 
> > which, when transfered to another disk, result in Integer BASIC files.
> 
> What other disk?  Do you mean a DOS 3.3 disk or another ProDOS disk?
 
Either one.

> > Here is the short program I want to compile:
> > 
> > 10 FOR X = 8192 TO 16383 : R = INT(RND(1)*256) : POKE X,R : NEXT X
> > 
> > It fills page 1 of Hi-Res graphics with TV static. This happens very
> > slowly. I know it can be done faster, after all there is a routine to
> > clear the screen.
> 
> A compiled version of this wouldn't be much faster, because most of the
> wasted time is due to dealing with floating point numbers.
>
> A better idea would be to come up with a simple and fast random number
> generator written in assembly language, and add some wrapper code which
> fills the screen with random data.  The wrapper code could even be a
> BASIC program, if the overhead wasn't too much.
> 
> For example, there was a series of articles published in "The
> Sourceror's Apprentice" many years ago, which described a cyclic
> shift/XOR-based random number generator.  It generates 8-bit random
> numbers from a 32-bit seed variable, and has a repeat period of 2^32-1
> (4194962795).  The seed can be any value except zero, and could be
> derived from memory locations $4E and $4F, which are incremented
> continuously while the system is waiting for a keypress (with the
> standard monitor routines, as used by GET and INPUT from BASIC).

I don't want to have it wait until a keypress. I just want to get a random
number. Might there be any memory location that is always changing that I
can use as a random number?

> I've used this algorithm on various other processors, and it seems to
> work well, as long as it is seeded correctly.
> 
> I'll have to do a fair amount of digging to find the original 6502
> version of the code.

-- 
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
jonrelay@napanet.net                             jrelay.cjb.net
An Apple II fanatic since 1998!              S0.5 LIS+++! M1987
"I can't stand to see you so miserable, Lis. Unless it's from
a rubber spider down your dress. Hmm... that gives me an idea. 
(Pulls out tape recorder) Note for later: put rubber spider down
Lisa's dress. He he he he he."

 *_     Syntax Error: an error on a criminal's tax record.
   |    Bad Subscript: a criminal reading a book on a subway.
  ---   Unimplemented Trap: when a bear trap isn't set up 
 |' ,|  properly and thus does not work.
  ---   Overflow: too many ice cubes.      <Can't Restart>

Please remove capital letters from my e-mail address to respond.