Output String Using Character Count (.Write/Writeln) - Motorola M68CPU32BUG User Manual

Debug monitor
Table of Contents

Advertisement

.WRITE
.WRITELN
5.2.23 Output String Using Character Count
SYSCALL
TRAP CODE: $0023
SYSCALL
TRAP CODE: $0024
.WRITE and .WRITELN format character strings with a count byte and output the string to the
default output port. After formatting, the count byte is the first byte in the string. The user passes
the starting address of the string. .WRITELN appends a <CR><LF> to the end of the string.
Entry Conditions:
Four bytes of parameters are positioned in the stack as follows:
SP ==>
Exit Conditions:
SP ==>
EXAMPLE
MESSAGE1
DC.B
MESSAGE2
DC.B
PEA
SYSCALL
PEA
SYSCALL
M68CPU32BUG/D REV 1
Output String Using Character Count
.WRITE
– Output string
.WRITELN
– Output string and <CR><LF>
Address of string.<long>
Top of stack (parameter bytes removed)
9,
8,
MESSAGE1(PC)
.WRITE
MESSAGE2(PC)
.WRITE
"MOTOROLA "
"QUALITY!"
Push address of string
Use TRAP #15 macro
Push address of other string
Invoke function again
5-29
SYSTEM CALLS
.WRITE
.WRITELN

Advertisement

Table of Contents
loading

Table of Contents