Sim68K Text I/O
TRAP #15 is used for I/O. Put the task number in D0.
Task
| 0 | Display n characters of string at (A1), n is D1.W (stops on NULL or max 255) with CR, LF. (see task 13) | 
| 1 | Display n characters of string at (A1), n is D1.W (max 255) without CR, LF. (see task 14) | 
| 2 | Read string from keyboard and store at (A1), NULL (0) terminated, length returned 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 ASCII character from the keyboard into D1.B. | 
| 6 | Display single ASCII character in D1.B. | 
| 7 |  Check for keyboard input. Set D1.B to 1 if keyboard input is pending, 
	otherwise set to 0. | 
| 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. | 
| 11 | 
		 Cursor Position, Set/Get or Clear Screen | 
| 12 | 
		 Keyboard 
        Echo. 
       | 
| 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.  | 
| 16 |  Adjust display properties | 
| 17 |  Combination 
		of Trap codes 14 & 3.  | 
| 18 |  Combination of Trap codes 14 
	& 4.  | 
| 19 |  Returns current state of up to 4 
	specified keys or returns key scan code. Example: MOVE.B #19,D0 MOVE.L #'A'<<24+'S'<<16+'D'<<8+'F',D1 ; check for keypress (a,s,d,f)  
		     TRAP   #15 | 
| 20 | Display signed number in D1.L in decimal in field D2.B columns wide. | 
| 21 |  Set font properties where: | 
| 22 | Read char at Row,Col of text screen. Pre: D1.L = High 16 bits = Row Low 16 bits = Column Post: D1.B contains ASCII code of character. | 
| 23 | Delay n/100 of a second Pre: D1.L = n as unsigned number 0 through $FFFFFFFF Delay releases CPU which reduces power consumption. | 
| 24 | Text I/O control Pre: D1.L = 0, Enable simulator shortcut keys. (default) D1.L = 1, Disable simulator shortcut keys. All key codes are made available for 68000 program read using task 19. all other values reserved. Shortcuts are restored by Rewind or Reload. | 
| 25 | Scroll Text Rectangle Pre: D1.L = High 16 bits = Top row (0 to 128) Low 16 bits = Left column (0 to 255) D2.L = High 16 bits = Height in rows (Top + Height max 128) Low 16 bits = Width in columns (Left + Width max 255) D3.W = 0 scroll up D3.W = 1 scroll down D3.W = 2 scroll left D3.W = 3 scroll right all other values reserved | 
BEL EQU  $07   
Bell
BS  
EQU  $08   Backspace
HT  EQU  $09   Tab (horizontal 5 characters)
LF  EQU  $0A   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