8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly


Page Last Altered:

9620 LOMEM=

Submitted by Steve Fewell

Description:

Call routine &96B9 to Set BASIC Text Pointer B to BASIC Text Pointer A value, check that the next non-space character
is an "=", and issue 'Mistake' error if it isn't. Get Result of the expression at BASIC Text Pointer B. Check that the
statement terminates correctly (with a '<cr>', ':' or 'ELSE'), (issue 'Syntax error if not terminated correctly), and convert
the numeric result value to Integer (or issue 'Type mismatch' error if the value is a String).

Set LOMEM (&00-&01) to the Integer results 2 LSB bytes (&2A-&2B).
Set the Heap/VARTOP (&02-&03) to the LOMEM value.
Note: this will destroy any variables currently on the heap.

Call routine &BBBB to reset the Floating-Point addresses in page &07, and zero any non-resident variables (that
is all vaiables, except, @%, A% through to Z%) by clearing page &04 locations &0480 to &04FF.

Lastly, jump to &9005 to start processing the next program statement.


Disassembly for the LOMEM= routine

9620   032 185 150 20 B9 96 JSR &96B9 Ptr B = Ptr A; Check '='; Get result; Check end of statement & convert result to Integer
9623 * 165 042 A5 2A LDA &2A
9625   133 000 85 00 STA &00
9627   133 002 85 02 STA &02
9629 + 165 043 A5 2B LDA &2B
962B   133 001 85 01 STA &01
962D   133 003 85 03 STA &03
962F   032 187 187 20 BB BB JSR &BBBB Initialise page &07, clear non-resident variables (locations &0480-&04FF)
9632   128 007 80 07 BRA 7 --> &963B [JMP &9005] Process the next statement

 


 Back to 8BS
Or