User manual

Table Of Contents
SYSTEM CALLS
M68CPU32BUG/D REV 1 5-18
.READLN Read Line to Fixed-Length Buffer .READLN
5.2.14 Read Line to Fixed-Length Buffer
SYSCALL .READLN
TRAP CODE: $0004
Reads a string of characters from the default input port. Characters echo to the default output
port. A string consists of a count byte followed by the characters read from the input. The count
byte indicates the number of characters read from the input as well as the number of characters in
the input string, excluding carriage return <CR> and line feed <LF>. A string may be as many as
254 characters.
Entry Conditions:
SP ==> Address of input buffer <long>
Exit Conditions:
SP ==> Top of stack
The first byte in the buffer indicates the string length.
EXAMPLE
If A0 points to a 256 byte buffer;
PEA (A0)
Long buffer address
SYSCALL .READLN
And read a line from the default input port
NOTE
The caller must allocate 256 bytes for a buffer. Input are limited to
254 characters. <CR> and <LF> are sent to default output
following echo of the input. See Terminal Input/Output Control
character processing as described in Chapter 1.
SYSTEM CALLS
M68CPU32BUG/D REV 1 5-15
.OUTCHR Output Character Routine .OUTCHR
5.2.11 Output Character Routine
SYSCALL .OUTCHR
TRAP CODE: $0020
Outputs a character to the default output port.
Entry Conditions:
SP ==> Character <byte>
Word fill <byte> (Placed automatically by the MCU)
Exit Conditions:
SP ==> Top of stack
Character is sent to the default I/O port.
EXAMPLE
MOVE.B D0,-(A7)
Send character in D0
SYSCALL .OUTCHR
To default output port
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...