f.f,---------------------------------------------------------------------------------,~ 107 Chapter 6 Communication Between BASIC and Assembly Language Summary: This chapter discusses the techniques used to pass information to and from assembly language programs. Calling assembly language routines and passing paramet- ers are presented, along with issues involved in using common. Applicable utilities are also discussed. Once assembly language programs have been written, they are executed using the ICALL statement. This statement is very similar to BASIC's CALL statement for subroutines.
In fact, the function it performs is nearly identical in effect - the only difference is that the target subroutine has been written in assembly language instead of in BASIC. The ICALL statement also provides a means to pass data between BASIC and assembly programs through its argu- ment list. Data can also be passed through common. The ICALL Statement There are two ways to execute an assembly language routine. One way is as an interrupt service routine when an interrupt occurs on the select code to which the service routine has been linked. This way is discussed in Chapter 7. The other way is through executing an ICALL statement, either in a BASIC program or from the keyboard.
The syntax of the statement is - I C:FH.-..i .... _ {routine name} [ ( {argument} L {argument} L ... J J ) J {routine name} is the name of the assembly language routine to be executed. {argument} is a data item which has the same characteristics as an argument in BASIC's CALL statement- there may be constants, variables, or expressions. (How these items correspond to instructions in the assembly language will be discussed shortly.)