Motorola M68CPU32BUG Manuel d'utilisateur Page 115

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 196
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 114
SYSTEM CALLS
M68CPU32BUG/D REV 1 5-1
CHAPTER 5
SYSTEM CALLS
5.1 INTRODUCTION
This chapter describes the CPU32Bug TRAP #15 handler, which allows system calls from user
programs. System calls access selected functional routines contained within CPU32Bug,
including input and output routines. TRAP #15 also transfers control back to CPU32Bug at the
end of a user program (refer to the .RETURN function, paragraph 5.2.16).
In the descriptions of some input and output functions, reference is made to the default input port
or the default output port. After power-up or reset, the default input and output port is port 0 (the
BCC terminal port).
5.1.1 Executing System Calls Through TRAP #15
To execute a system call from a user program simply insert a TRAP #15 instruction into the
source program. The code corresponding to the particular system routine is specified in the word
following the TRAP opcode, as shown in the following example.
Format in user program:
TRAP #15 System call to CPU32Bug
DC.W $xxxx Routine being requested (xxxx = code)
In some of the examples shown in the following descriptions, a SYSCALL macro is used with
the Motorola Macro Assembler (M68MASM) for MS-DOS/PC-DOS machines. This macro
automatically assembles the TRAP #15 call followed by the define constant for the function
code. The SYSCALL macro is:
SYSCALL MACRO
TRAP #15
DC.W \1
ENDM
The CPU32Bug input default is hexadecimal, while other assemblers default to decimal. When
programming a CPU32Bug assembler TRAP function it is best to use the SYSCALL macro to
make the conversion.
Using the SYSCALL macro, the system call appears in the user program as:
SYSCALL <routine name>
Vue de la page 114
1 2 ... 110 111 112 113 114 115 116 117 118 119 120 ... 195 196

Commentaires sur ces manuels

Pas de commentaire