Sim68K Text I/O

TRAP #15 is used for I/O.  Put the task number in D0.

 Task

  0  Display string at (A1), D1.W bytes long (max 255) with carriage return and line feed (CR, LF). (see task 13)
  1  Display string at (A1), D1.W bytes long (max 255) without CR, LF. (see task 14)
  2  Read string from keyboard and store at (A1), NULL terminated, length retuned in D1.W (max 80)
  3  Display signed number in D1.L in decimal in smallest field. (see task 15 & 20)
  4  Read a number from the keyboard into D1.L.
  5  Read single character from the keyboard into D1.B.
  6  Display single character in D1.B. 
  7

 Set D1.B to 1 if keyboard input is pending, otherwise set to 0.
 Use code 5 to read pending key.

  8  Return time in hundredths of a second since midnight in D1.L.
  9  Terminate the program. (Halts the simulator)
 10

 Print the NULL terminated string at (A1) to the default printer. (Not Teesside compatible.)

 Always send a Form Feed character to end printing. (See below.)

 11

 Position the cursor at ROW, COL.

    The high byte of D1.W holds the COL number (0-79),  

    The low byte holds the ROW number (0-31).

    0,0 is top left 79,31 is the bottom right. 

    Out of range coordinates are ignored. 

 Clear Screen : Set D1.W to $FF00.

 12

 Keyboard Echo.

    D1.B = 0 to turn off keyboard echo.

    D1.B = non zero to enable it (default).

    Echo is restored on 'Reset' or when a new file is loaded.

 13  Display the NULL terminated string at (A1) with CR, LF.
 14  Display the NULL terminated string at (A1) without CR, LF.
 15

 Display the unsigned number in D1.L converted to number base (2 through 36) contained in D2.B.

    For example, to display D1.L in base16 put 16 in D2.B
 Values of D2.B outside the range 2 to 36 inclusive are ignored.

 16  Adjust display properties
    D1.B = 0 to turn off the display of the input prompt.
    D1.B = 1 to turn on the display of the input prompt. (default)
    D1.B = 2 do not display a line feed when Enter pressed during Trap task #2 input
    D1.B = 3 display a line feed when Enter key pressed during Trap task #2 input (default)
 Other values of D1 reserved for future use.
 Input prompt display is enabled by default and by 'Reset' or when a new file is loaded.
 17

 Combination of Trap codes 14 & 3.

 Display the NULL terminated string at (A1) without CR, LF then

 Display the decimal number in D1.L.

 18  Combination of Trap codes 14 & 4.
 Display the NULL terminated string at (A1) without CR, LF then
 Read a number from the keyboard into D1.L.
 19  Returns current state of up to 4 specified keys or returns key scan code.
  Pre: D1.L = four 1-byte key codes
  Post: D1.L contains four 1-byte Booleans.
           $FF = corresponding key is pressed, $00 = corresponding key not pressed.
  Pre: D1.L = $00000000
  Post: D1.B contains key code of last key pressed
 20  Display signed number in D1.L in decimal in field D2.B columns wide.
 21  Set Font Color
  D1.L = color as $00BBGGRR
             BB is amount of blue from $00 to $FF
             GG is amount of green from $00 to $FF
             RR is amount of red from $00 to $FF
  D2.B = style by bits,  0 = off, 1 = on
             bit0 is Bold
             bit1 is Italic
             bit2 is Underline
             bit3 is StrikeOut
 22

  Read char at Row,Col of text screen.
  Pre: D1.L = High 16 bits = Row
                    Low 16 bits = Col
  Post: D1.B contains ASCII code of character.


Task numbers 0 - 9 and 11 - 12 are compatible with the Teesside simulator.

 The following control characters are supported:
BS
  EQU  $08   Backspace
HT  EQU  $09   Tab (horizontal 5 characters)
LF  EQU  $0A   New line (line feed)
VT  EQU  $0B   Vertical tab (4 lines)
FF  EQU  $0C   Form Feed (Always end printing with a Form Feed.)
CR  EQU  $0D   Carriage Return