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.

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