The call table
Every call of profile 1, device by device: the number that goes in a7, the arguments, the result and the class that sets the base charge. How a program makes a call, and what an unknown call or a bad buffer returns, is in the article on the Terse32 machine; each device's article describes its calls in full.
Class sets the base charge: 4 for a deferred call (its result and charge follow from its arguments), 64 for an answered one (they depend on the device's state). System and Machines calls cost 4.
The system device, slot 1, always present:
a7 | Call | Arguments | Result |
|---|---|---|---|
100h | wait_frame | none | the frame counter in the frame it returns in |
101h | next_event | a0 = buffer (4 bytes, written) | 1 and the event, or 0 if the queue is empty |
102h | frame_count | none | the frame counter |
103h | unix_time | none | the Unix time latched at the start of the frame |
104h | random | a0 = buffer (written), a1 = length, at most 256 | the length |
105h | controller | a0 = controller number, a1 = buffer (8 bytes, written) | byte 0 of the state |
106h | exit | a0 = exit code (low 8 bits) | does not return |
107h | open | a0 = address of an open request (read) | 1 passed to the shell, 0 not |
108h | argument | a0 = buffer (32 bytes, written) | 1, or 0 if the machine has none |
109h | device | a0 = device slot | its version, or FFFF_FFFFh if absent |
10Ah | copy | a0 = text (read), a1 = length, at most 65,536 | 0 (the host takes it only for the user's copy key, Enter or press) |
10Bh | screen_size | none | the screen's width (bits 16 to 31) and height (bits 0 to 15): 0280_01E0h for 640 × 480 |
The terminal, slot 2:
a7 | Call | Arguments | Result | Class |
|---|---|---|---|---|
200h | write | a0 = buffer (read), a1 = length, at most 4,096 | the length | deferred |
201h | command | a0 = command | 0 | deferred |
202h | set_cursor | a0 = column, a1 = row | 0 | deferred |
203h | get_cursor | none | a0 = column, a1 = row | answered |
204h | set_colours | a0 = foreground, a1 = background | 0 | deferred |
205h | get_colours | none | a0 = foreground, a1 = background | answered |
206h | cells_read | a0 = first cell, a1 = buffer (written), a2 = count | the count | answered |
207h | cells_write | a0 = first cell, a1 = buffer (read), a2 = count | the count | deferred |
208h | palette_set | a0 = first entry, a1 = buffer (read), a2 = count | the count | deferred |
209h | size | none | a0 = columns, a1 = rows (80 and 30 on 640 × 480) | deferred |
The 2D vector display, slot 3:
a7 | Call | Arguments | Result | Class |
|---|---|---|---|---|
300h | submit | a0 = list address, a1 = length | 0 done, 1 rejected | deferred |
301h | clear | none | 0 | deferred |
302h | style | a0 = style | 0 done, 1 rejected | deferred |
303h | persistence | a0 = persistence | 0 done, 1 rejected | deferred |
304h | fill | a0 = fill mode | 0 done, 1 rejected | deferred |
The content device, slot 4 (see blobs, feeds and named records):
a7 | Call | Arguments | Result | Class |
|---|---|---|---|---|
400h | submit | a0 = address of a request block | a handle 1 to 8, or 0 if rejected | answered |
The page, slot 7:
a7 | Call | Arguments | Result | Class |
|---|---|---|---|---|
700h | submit | a0 = document address, a1 = length | 0 done, 1 rejected | deferred |
701h | clear | none | 0 | deferred |
702h | region | a0 = x, a1 = y, a2 = width, a3 = height | 0 | deferred |
703h | scroll | a0 = y | 0 | deferred |
704h | background | a0 = colour | 0 | deferred |
705h | locate | a0 = anchor id | 0 done, 1 rejected | answered |
706h | layer | a0 = layer, a1 = flags, a2 = x, a3 = y, a4 = scale | 0 done, 1 rejected | deferred |
Machines, slot 8, the shell only (buffer sizes in bytes):
a7 | Call | Arguments | Result |
|---|---|---|---|
800h | start | a0 = image ID (32, read) | a handle, or 0 if none is free |
801h | stop | a0 = handle | 1, or 0 if not in use |
802h | place | a0 = handle, a1 = x, a2 = y, a3 = width, a4 = height | 1, or 0 if not in use |
803h | run | a0 = handle, a1 = 1 run, 0 pause | 1, or 0 if refused |
804h | focus | a0 = handle, or 0 | 1, or 0 if refused |
805h | info | a0 = handle, a1 = buffer (48, written) | 1, or 0 if not 1 to 8 |
806h | builtin | a0 = index, a1 = buffer (32, written) | 1, or 0 past the last |
807h | start_program | a0 = program record (read) | a handle, or 0 if none is free |
808h | identity | a0 = handle, a1 = buffer (81, written) | 1, or 0 if it has none |
809h | request | a0 = handle, a1 = buffer (82, written) | 1, or 0 if no request waits |
80Ah | argument | a0 = handle, a1 = blob ID (32, read) | 1, or 0 if not loading |
80Bh | snapshot | a0 = handle, a1 = slot | 1 accepted, 0 refused |
80Ch | restore | a0 = slot | a handle, or 0 if none is free or out of range |
80Dh | snapshot_info | a0 = slot, a1 = buffer (122, written) | 1 if it holds one, else 0 |
80Eh | snapshot_delete | a0 = slot | 1, or 0 if out of range |
80Fh | face | a0 = handle, a1 = frames, a2 = x, a3 = y, a4 = width, a5 = height | 1, or 0 if refused |
810h | unface | a0 = frames | 1, or 0 if refused |
811h | experimental | a0 = handle, a1 = index, a2 = buffer (32, written) | 2 granted, 1 not, 0 none |
812h | stack | a0 = handle or 0, a1 = x, a2 = y, a3 = width, a4 = height | 1, or 0 if not in use |
The 3D vector display, slot 9:
a7 | Call | Arguments | Result | Class |
|---|---|---|---|---|
900h | submit | a0 = list address, a1 = length | 0 done, 1 rejected | deferred |
901h | clear | none | 0 | deferred |
902h | style | a0 = style | 0 done, 1 rejected | deferred |
903h | persistence | a0 = persistence | 0 done, 1 rejected | deferred |