trap
Affected Flags
X
N
Z
V
C
-
-
-
-
-
Operands
Op 1
Im
Executes a trap, the value of the operand is used as the trap number, only #15 is supported. The register d0 holds the task number. The full table, with the registers each task takes and answers with, is on the trap tasks page.
| Task | Description |
|---|---|
| 0 | Print string pointed by a1 with length read in d1.w, null terminated with max of 255, then prints a new line. |
| 1 | Print string pointed by a1 with length read in d1.w. |
| 2 | Read string from keyboard, writes the string at address of a1 and overrides the value of d1 with the length of the string. |
| 3 | Print signed number at d1. |
| 4 | Read number, writes to d1. |
| 5 | Read character, writes to d1. |
| 6 | Print character at d1. |
| 7 | Check for keyboard input, writes 1 or 0 to d1.b. |
| 8 | Get the time in hundredths of a second since the run started, writes to d1. |
| 9 | Terminate. |
| 11 | Set or get the text cursor, or clear the screen with d1.w = $FF00. |
| 13 | Prints null terminated string pointed by a1 then prints new line, errors if string is longer than 16kb, to prevent infinite loops. |
| 14 | Prints null terminated string pointed by a1, errors if string is longer than 16kb, to prevent infinite loops. |
| 15 | Prints unsigned number at d1 in base (from 2 to 36) specified in d2.b |
| 17 | Prints the null terminated string at a1, then the signed number in d1. |
| 18 | Prints the null terminated string at a1, then reads a number into d1. |
| 19 | Reads the state of up to four keys given in d1.l, or the last keys pressed and released with d1.l = 0. |
| 20 | Print the signed number in d1 right justified in a field d2.b columns wide. |
| 23 | Delay for the number of hundredths of a second in d1. |
| 24 | Enable or disable the simulator shortcut keys; accepted and ignored. |
| 33 | Set or get the screen size, or set the window mode. |
| 61 | Read the mouse: flags in d0, y:x in d1. |
| 80-96 | Graphics: colors, pixels, lines, rectangles, ellipses, flood fill, drawing modes, double buffering, text and the pen position. |