MON

From NDWiki
Revision as of 14:38, 6 August 2010 by TArntsen (talk | contribs) (MON instruction)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
MON
Description Monitor Call
Format MON <number>
Code 153 0008
Affected Various
Type User
Architecture ND-100, ND-110

MON is an assembly instruction.

The instruction is used for monitor calls. A "monitor call" is equivalent to a syscall in Unix. Depending on the specific monitor call, various registers may be loaded with call-specific values before the MON instruction is called, and return values may be retrieved from registers after the call. Parameters and data may also be stored and retrieved from memory addresses.

Some monitor calls will cause the program counter to be incremented by two instead of one (a "skip return") if the monitor call succeded, and by one in case of error. For such monitor calls the instruction immediately following MON will typically be a jump instruction to an error handler, while the next one after that is the instruction to execute in case of success.

Other monitor calls, for example those with no error state like 153 1138 (MON CLOCK), have no skip return.

The instruction causes an internal interrupt to program level 14, with the <number> value from the lower 8 bits of the instruction loaded sign-extended into the T register on level 14. The sign-extension is a method for the interrupt handler to detect that the T register was set, which identifies the interrupt as caused by a MON instruction[1]. The lower 8 bits of the T register (the original <number>) is used to call the correct system function through a look-up table.

The 8 bit wide <number> limits the possible ND-100 monitor calls to the range 0 to maximum 256, or 3778

The various monitor calls are documented in Norsk Data Document ND–60.228.1 SINTRAN III Monitor Calls manual .

References

  1. SIN-L STD A listing part two, March 1989