[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Whatever happened to...
David.Empson@bbs.actrix.gen.nz writes:
>2. Are you changing HIMEM? If so, don't. If you need to protect part
>of the computer's memory from BASIC's variables, try changing LOMEM
>instead, and putting the data below that. If you really have to change
>HIMEM, make sure you set it to a multiple of 256, and don't set it any
>higher than it is already.
>Also note that if you move HIMEM down and put any data above it,
>BASIC.SYSTEM might move it in order to allocate a file buffer (not sure
>about this).
No, just don't altogether. Chances are BASIC.System will screw you up (or
BASIC will get confused which is even worse)
There is GETBUFR and FREBUFR if you need memory in the high area. Here:
Allocate lda #numpages
jsr $bef5
bcs error
sta address+1
lda #0
sta address
rts
error oops
Dealloc lda $befb
pha
lda address+1
clc
adc #numpages
sta $befb
jsr $bef8
pla
sta $befb
rts
Note that using this method you must deallocate buffers in the same order as
they were allocated in.
______________________________________________________________________
|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~|
| Phillip Vandry | Vandry@Cam.Org | II the future! | II 1993! |
|________________|________________|________________|___________________|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~