IOT: Difference between revisions

From NDWiki
Jump to navigation Jump to search
(IOT is an old version of MON)
m (Two small typos)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{InstructionBox
{{InstructionBox
|Mnemonic=IOT
|Mnemonic=IOT SKA
|Description=Perform monitor call
|Description=Perform monitor call
|Format=IOT SKA <number>
|Format=IOT SKA <number>
Line 9: Line 9:
}}
}}


'''IOT''', or '''IOT SKA''' is an undocumented instruction used by very old applications like [[NPL]]. Old ND system applications tend to keep old code even when updated. This instruction is probably from [[NORD-1]].
'''IOT''' is a [[NORD-1]] I/O instruction which is the NORD-1 equivalent of the [[NORD-10]]/[[ND-100]] I/O instruction [[IOX]]. IOT is undocumented. The MAC Assembler manual <ref>*{{ND-doc|60.096}}</ref> states that ''the NORD-10 may also be delivered with a NORD-1 compatible I/O instruction IOT'' (page 2-27).
 
A special case of IOT is the '''IOT SKA''' instruction, it is still used by very old applications like the [[NPL]] compiler. Old ND system applications tend to keep old code even when updated.


The [[BRF EDITOR]] command ''LIST-BRF'' is aware of 161.xxx instructions and lists them as '''IOT SKA'''. The [[BRF Linker]] ''LIST-BRF-CODE'' command will only list the octal value, and no mnemonic.
The [[BRF EDITOR]] command ''LIST-BRF'' is aware of 161.xxx instructions and lists them as '''IOT SKA'''. The [[BRF Linker]] ''LIST-BRF-CODE'' command will only list the octal value, and no mnemonic.


The instruction pre-dates [[SINTRAN-III]] and the [[NORD-10]]/[[ND-100|N1xx]] CPUs, but applications using this instruction, within a certain range of <number> values, are still able to execute on the newer systems due to a trick explained below. This allows applications like [[NPL]] to work.
<tt>'IOT SKA', as used by the BRF EDITOR probably means 'IOT Systemkall' which translates to 'IOT System Call' from Norwegian.''</tt>
 
As described above, the instruction pre-dates [[SINTRAN III|SINTRAN-III]] and the [[NORD-10]]/[[ND-100|N1xx]] CPUs, but applications using this instruction, within a certain range of <number> values, are still able to execute on the newer systems due to a trick explained below. This allows applications like [[NPL]] to work.


==== Implementation details ====
==== Implementation details ====
The instruction does not exist in the NORD-10/ND-1x0 CPUs, so it will trigger an ''Illegal instruction'' exception in SINTRAN-III. The snippet of SINTRAN-III code which handles the exception looks as follows: <ref>SIN-L STD A listing part two, March 1989</ref>
The instruction does not exist in the NORD-10/ND-1x0 CPUs (except when specially ordered with the NORD-10), but it will trigger a ''Privileged Instruction'' exception in SINTRAN-III (bit 6 in the [[IIC register|Internal Interrupt Code register]] <ref>{{ND-doc|06.014.02}} page 2-17</ref>). The snippet of SINTRAN-III code which handles the exception looks as follows: <ref>SIN-L STD A listing part two, March 1989</ref>
<pre>
{{DocPreStart}}
072404  IIC06: IF ACTLV=ALEVL THEN                      % PRIVILIGED INSTRUCTION
072404  IIC06: IF ACTLV=ALEVL THEN                      % PRIVILIGED INSTRUCTION [[Wikipedia:Sic|[''sic'']]]
072410            RTREF.ACTPRI/\74000 SHZ -4+"NMPIT+LV14B+ERNG2"% SET USERS NORMAL PIT AS ALT. PIT
072410            RTREF.ACTPRI/\74000 SHZ -4+"NMPIT+LV14B+ERNG2"% SET USERS NORMAL PIT AS ALT. PIT
072415            X:=PERR; *TRR PCR
072415            X:=PERR; *TRR PCR
072417            X.SN1=:D                              % D= THE ILL.INSTR.
072417            X.SN1=:D                              % D= THE ILL.INSTR.
072421            "NMPIT+ADPIT+LV14B+ERNG2"; *TRR PCR    % RESET PCR
072421            "NMPIT+ADPIT+LV14B+ERNG2"; *TRR PCR    % RESET PCR
072423            IF 177600/\D=161000 THEN T:=177/\D; GO FAR MONCALL FI % IF 161XXX THEN MONCALL
072423            IF 177600/\D=161000 THEN T:=177/\D; GO FAR MONCALL FI % IF 161XXX THEN MONCALL
072433            IBITNO; T:=PERR; CALL 9ERR(#24)        % GIVE ERROR MESSAGE
072433            IBITNO; T:=PERR; CALL 9ERR(#24)        % GIVE ERROR MESSAGE
072437            GO FAR ABOR                            % TERMINATE CURRENT RUNNING PROGRAM
072437            GO FAR ABOR                            % TERMINATE CURRENT RUNNING PROGRAM
072440          FI; GO FAR TDTLEV                        % MAY BE ILL.INSTRUCTION ON ILLEGAL LEVEL
072440          FI; GO FAR TDTLEV                        % MAY BE ILL.INSTRUCTION ON ILLEGAL LEVEL
</pre>
{{DocPreEnd}}


The NPL code '''IF 177600/\D=161000 THEN T:=177/\D; GO FAR MONCALL FI''' translates to the following pseudocode:
The NPL code "'''IF 177600/\D=161000 THEN T:=177/\D; GO FAR MONCALL FI'''" translates to the following pseudocode:
<pre>
{{DocPreStart}}
if instruction is in the 161000 (octal) range, and <number> is in the range 0x00-0x7f, then
if instruction is in the 161000 (octal) range, and <number> is in the range 0x00-0x7f, then
  handle as monitor call (<number>)
  handle as monitor call (<number>)
else
else
  handle as any other illegal instruction, abort program
  handle as any other illegal instruction, abort program
endif
endif
</pre>
{{DocPreEnd}}


The illegal instruction error handler detects if the instruction is an 161000 instruction, and, if so, handles it as a [[MON]] instruction (153000<sub><small>8</small></sub>), i.e. a monitor call (within the allowed range for <number>), instead of aborting the program.  The instruction is thus an old version of the [[MON]] instruction, and the old calls map one-to-one to the SINTRAN-III functions as long as they are below 128 decimal (i.e. up to and including 'MON 177').
The interrupt handler detects if the instruction is a 161000 instruction, and, if so, handles it as a [[MON]] instruction (153000<sub><small>8</small></sub>), i.e. a monitor call (within the allowed range for <number>), instead of aborting the program.  The instruction is thus an old version of the [[MON]] instruction, and the old calls map one-to-one to the SINTRAN-III functions as long as they are below 128 decimal (i.e. up to and including 'MON 177').


'' 'IOT SKA', as used by the BRF EDITOR, may possibly stand for 'IOT Systemkall' which translates to 'IOT System Call' from Norwegian.''


== References ==
== References ==

Latest revision as of 07:45, 26 May 2016

IOT SKA
Description Perform monitor call
Format IOT SKA <number>
Code 161 0008
Affected Various registers, depending on <number>
Type User
Architecture NORD-1

IOT is a NORD-1 I/O instruction which is the NORD-1 equivalent of the NORD-10/ND-100 I/O instruction IOX. IOT is undocumented. The MAC Assembler manual [1] states that the NORD-10 may also be delivered with a NORD-1 compatible I/O instruction IOT (page 2-27).

A special case of IOT is the IOT SKA instruction, it is still used by very old applications like the NPL compiler. Old ND system applications tend to keep old code even when updated.

The BRF EDITOR command LIST-BRF is aware of 161.xxx instructions and lists them as IOT SKA. The BRF Linker LIST-BRF-CODE command will only list the octal value, and no mnemonic.

'IOT SKA', as used by the BRF EDITOR probably means 'IOT Systemkall' which translates to 'IOT System Call' from Norwegian.

As described above, the instruction pre-dates SINTRAN-III and the NORD-10/N1xx CPUs, but applications using this instruction, within a certain range of <number> values, are still able to execute on the newer systems due to a trick explained below. This allows applications like NPL to work.

Implementation details

The instruction does not exist in the NORD-10/ND-1x0 CPUs (except when specially ordered with the NORD-10), but it will trigger a Privileged Instruction exception in SINTRAN-III (bit 6 in the Internal Interrupt Code register [2]). The snippet of SINTRAN-III code which handles the exception looks as follows: [3]

072404   IIC06: IF ACTLV=ALEVL THEN                       % PRIVILIGED INSTRUCTION [sic]
072410             RTREF.ACTPRI/\74000 SHZ -4+"NMPIT+LV14B+ERNG2"% SET USERS NORMAL PIT AS ALT. PIT
072415             X:=PERR; *TRR PCR
072417             X.SN1=:D                               % D= THE ILL.INSTR.
072421             "NMPIT+ADPIT+LV14B+ERNG2"; *TRR PCR    % RESET PCR
072423             IF 177600/\D=161000 THEN T:=177/\D; GO FAR MONCALL FI % IF 161XXX THEN MONCALL
072433             IBITNO; T:=PERR; CALL 9ERR(#24)        % GIVE ERROR MESSAGE
072437             GO FAR ABOR                            % TERMINATE CURRENT RUNNING PROGRAM
072440           FI; GO FAR TDTLEV                        % MAY BE ILL.INSTRUCTION ON ILLEGAL LEVEL

The NPL code "IF 177600/\D=161000 THEN T:=177/\D; GO FAR MONCALL FI" translates to the following pseudocode:

if instruction is in the 161000 (octal) range, and <number> is in the range 0x00-0x7f, then
  handle as monitor call (<number>)
else
  handle as any other illegal instruction, abort program
endif

The interrupt handler detects if the instruction is a 161000 instruction, and, if so, handles it as a MON instruction (1530008), i.e. a monitor call (within the allowed range for <number>), instead of aborting the program. The instruction is thus an old version of the MON instruction, and the old calls map one-to-one to the SINTRAN-III functions as long as they are below 128 decimal (i.e. up to and including 'MON 177').


References

  1. *Norsk Data Document ND–60.096 MAC INTERACTIVE ASSEMBLY AND DEBUGGING SYSTEM USER'S GUIDE
  2. Norsk Data Document ND–06.014.02 ND-100 REFERENCE MANUAL page 2-17
  3. SIN-L STD A listing part two, March 1989