Amos Professional Manual  Contents  Index

Machine Code


PLOAD
instruction: load machine code directly into memory
Pload "filename",bank number

The PLOAD command reserves a memory bank and loads some machine code into it from disc. Specify the filename that contains the machine code file on disc, followed by the number of a new memory bank to be reserved for the program. If the bank number is negative, the number will be multiplied by -1, and the bank will be allocated using Chip memory.

Once machine code is loaded in this way, it is installed as a permanent memory bank, so whenever the current program is saved, the machine code is stored too. Also note that the machine code file can be saved onto disc as a standard ".Abk" file, then loaded directly into AMOS Professional Basic. After PLOAD has performed its work, the memory bank can be executed immediately! The following factors should be noted:

CALL
instruction: execute a machine code program from memory
Call address
Call address,parameters
Call bank
Call bank,parameters

The CALL instruction is used to run a machine code program straight from the Amiga's memory. You can specify either an absolute memory location or the number of a memory bank, previously installed using the PLOAD command.

On entry to the program, registers D0 to D7 and A0 to A2 will be loaded from values stored in the DREG and AREG functions. The assembly language program can change any 68000 registers it chooses. At the start of the routine, register A3 will point to the optional parameter list, which is explained next, and A5 will contain the address of the AMOS Professional data zone. When the routine has completed its task, you can return to Basic with a RTS.

After the memory location or bank number, a list of optional parameters may be given in the form of a list of values. These values will be taken from the AMOS Professional Basic program and pushed onto the A3 stack by the CALL command. They must be removed in reverse order, so the last value in the list will be the first on the stack. The format of a parameter depends on what type of variable they are, as follows:

Back    Next
14.A.14