Next: Floating Point Instructions
Up: Registers and MAL
Previous: Branch Instructions
MAL provides a separate I/O instruction for each type of data:
character (byte), integer (word) and string (.asciiz). No floating
point I/O instructions are included.
The MAL I/O instructions are:
Notes:
- R is either a general register or a label. The operation is
performed on the contents of R.
- S is either a general register or a label. If S is a general
register, the effective address is the contents of S; if S is a label,
the effective address is S.
- Superscripts indicate repetitions of a binary value.
- Subscripts indicate bit positions (Little-Endian) of sub-field.
The following MAL program reads a string of characters and prints
it out in reverse order using an array of bytes. Note that the
array index and newline character are stored in registers. RAM
is used only for the prompt string and the byte array.
CS 301 Class Account
Mon Sep 13 11:15:41 ADT 1999