Read String Into Variable-Length Buffer (.Readstr) - Motorola M68CPU32BUG User Manual

Debug monitor
Table of Contents

Advertisement

.READSTR
5.2.15 Read String Into Variable-Length Buffer
SYSCALL
TRAP CODE: $0003
Reads a string of characters from the default input port into a buffer. The first byte in the buffer
defines the maximum number of characters that can be written to the buffer. The buffer's size
should be no less than the first byte + 2. The maximum number of characters written to a buffer
is 254 characters, making the maximum buffer size 256. On exit, the count byte defines the
number of characters in the buffer. Enter a carriage return (<CR>) and line feed (<LF>) to
terminate the input. The characters echo to the default output port. <CR> is not echoed.
Entry Conditions:
SP ==>
Exit Conditions:
SP ==>
EXAMPLE
If A0 contains the string buffer address;
PEA
(A0)
TRAP
#15
DC.W
3
This routine allows the caller to define the maximum character
input length (254 characters). If more than 254 characters are
entered, then the buffer input is truncated. See Terminal
Input/Output Control character processing as described in Chapter
1.
M68CPU32BUG/D REV 1
Read String Into Variable-Length Buffer
.READSTR
Address of input buffer <long>
Top of stack
The count byte containing the number of bytes in the buffer.
Push buffer address
(May also invoke by SYSCALL
macro (''SYSCALL .READSTR'')
NOTE
5-19
SYSTEM CALLS
.READSTR

Advertisement

Table of Contents
loading

Table of Contents