Motorola M68CPU32BUG Uživatelský manuál Strana 58

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 98
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 57
ASSEMBLER/DISASSEMBLER
M68CPU32BUG/D 4-12
4.3.3 Entering Branch and Jump Addresses
When entering a source line containing a branch instruction (BRA, BGT, BEQ, etc) do not enter
the offset to the branch’s destination in the instruction operand field. The offset is calculated by
the assembler. The user must append the appropriate size extension to the branch instruction.
To reference a current location in an operand expression use the asterisk (*) character.
EXAMPLES
0000D000 6000BF68 BRA *-4096
0000D000 60FE BRA.B *
0000D000 4EF90000 D000 JMP *
0000D000 4EF00130 0000D000 JMP (*,A0,D0)
In the case of forward branches or jumps, the absolute address of the destination may be
unknown as the program is being entered. The user may enter an asterisk (*) for branch to self in
order to reserve space. After the actual address is discovered, the line containing the branch
instruction can be re-entered using the correct value. Enter branch sizes ’B’ or ’W’, as opposed to
’’S’’ and ’’L’’.
4.3.4 Assembler Output/Program Listings
Use the MD (Memory Display) command with the ;DI option to obtain a listing of the program.
The MD command requires the starting address and a line count or ending address to be entered
in the command line. When the ;DI option is executed with a line count, the number of
instructions disassembled and displayed is equal to the line count.
Note again, that the listing may not correspond exactly to the program as entered. As discussed in
paragraph 4.2.1.3, the disassembler displays in signed hexadecimal any number it interprets as an
offset of an address register; all other numbers are displayed in unsigned hexadecimal.
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>
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...
Zobrazit stránku 57
1 2 ... 53 54 55 56 57 58 59 60 61 62 63 ... 97 98

Komentáře k této Příručce

Žádné komentáře