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

Re: Date and time not updating in Applesoft BASIC program?



> But, I have another question as to where in memory to POKE the machine
> language routine, as I'm adding the clock routine to a program that I
> would guess is already using locations 768, 769, 770, etc., because
> when the program calls them later on, I get undesired results.
>
> How can I find out where in memory I can plug this machine language
> routine in?
>
> Brandon

Mostly it depends on what programs you are running since 7 short bytes
can go almost anywhere but still may get over written by ML code.

you can use any of these options;

if your binary listings are not using any zero page locations, then
poke the code into 6 to 12 ( $6 - $C)  - and only if you do not use
the applesoft reserved word USR in your programs.
if you are not using the hi-res screen then you can use 224 to 239
($E0-$EF) or 244 to 255 ($F4-$FF)
you can check the upper locations of page 3 from $3C8-$3CF but make
sure your binary listing does not reach that far first.
or you can poke the code just after the array storage space.  Since
this location can change, it has to be poked in each time.

10 TI = PEEK (109) + 256 * PEEK(110)
20 RESTORE : FOR I = 0 TO 6: READ J : POKE TI + I, J : NEXT: CALL TI :
RETURN
30 DATA 32,0,191,130,0,0,9

To update the time just use GOSUB 10 in your program.

And one last one is to save a dummy file to the RAMdisk since it has
no moving parts and is pretty fast.

50 PRINT CHR$(4) "BSAVE /RAM/DUMMY,A$300,L$1"    (this will also
update the clock)


Rob