8-Bit Software

The BBC and Master Computer Public Domain Library

Back to 8BS Or Back to Disassembly


Page Last Altered:

96E4 PROC

Submitted by Steve Fewell

Description:

Set the BASIC Text Pointer B to the BASIC Text Pointer A value (so that both pointers now point to the location after
the PROC-Keyword.
Set A to #&F2 (the PROC-token value), so that the &B019 (FN) routine will know that we are handling a PROCedure
call.

Call the FN routine (&B019) to evaluate the subroutine name and carry out the call to the subroutine.

Now, the PROCedure has been executed, and the BASIC and 6502 stacks have been restored to their original states (before
the call).
Call routine &9B96 to check for the end of Statement ('Syntax error' is issued if the statement end was not found)
as the program statement must be terminated by ':', carriage return or 'ELSE-token' character.

Jump to &9005 to start executing the next program statement (after the PROC call).


Disassembly for the PROC routine

96E4   165 011 A5 0B LDA &0B
96E6   133 025 85 19 STA &19
96E8   165 012 A5 0C LDA &0C
96EA   133 026 85 1A STA &1A
96EC   165 010 A5 0A LDA &0A
96EE   133 027 85 1B STA &1B
96F0   169 242 A9 F2 LDA#&F2
96F2   032 025 176 20 19 B0 JSR &B019 FN (main FN/PROC routine)
96F5   032 150 155 20 96 9B JSR &9B96 Check for end of Statement (PTR B) ('Syntax error' if end not found)
96F8 L 076 005 144 4C 05 90 JMP &9005 Continue running program (execute next statement)

 


 Back to 8BS
Or