breakintoprogram / agon-bbc-basic-adl

Official AGON QUARK Firmware: BASIC Interpreter (ADL version)
zlib License
16 stars 0 forks source link

HIMEM cannot be changed #18

Closed lennart-benschop closed 8 months ago

lennart-benschop commented 8 months ago

When I try to change HIMEM in ADL Basic it gives an error "No Room"

For example HIMEM=HIMEM-1000 or HIMEM=500000

The same statements do work in 16-bit BBC Basic.

It can be useful to set aside some RAM for another program, for data or for an additional edit buffer for the nano editor.

breakintoprogram commented 8 months ago

There is some 16-bit maths that got overlooked here in the function HIMEMV in exec.asm (~line 1423). EXPRI fetches the 24-bit value in 'LHL - need to stick 'L into the U byte of HL. Also the INC D on line 1427 to add 256 to the value fetched from FREE is now clumsy and will not always work.