Watson Assembly Tutorial


Home
Labs
Tutorials
Known Bugs
Schedule
Archive
Members
Contact Information

Watson Assembly Language Commands

Below are the explanation of each of the 18 commands used in the Watson Assembly Lab

  • Word - Inserts 'label .WORD value'
    Used to declare a variable and give it an initial value. The name of the variable will replace 'label'. The initial value of the variable will be placed into the 'value' field.
  • Block - Inserts 'label .BLOCK size'
    Used to reserve a block of memory to hold data rather than instructions. The name of the mmeory block will be stored in the 'label' field. The 'size' field will specify the number of words of memory to be reserved.
  • LoadImm - Inserts 'LOADIMM reg,value'
    Used to load a value into the specified register. The values that may be included in this instruction are limited to the range 0 - 255, inclusive.
  • Load - Inserts 'LOAD reg,label'
    Copies into the specified register the value stored at the address indicated by 'label'.
  • LoadInd - Inserts 'LOADIND reg,reg'
    The 'load indirect' statement loads the first register with a copy of the value stored at the memory location whose address is held in the second register. Load indirect statements are often used to retrieve items from multi-word blocks.
  • Store - Inserts 'STORE reg,label'
    Places a copy of the value held in the specified register into the memory location indicated by 'label'.
  • StoreInd - Inserts 'STOREIND reg,reg'
    The 'store indirect' statement stores a copy of the value held in the first register into the memory location whose address is held in the second register. Store indirect statements are often used for placing items into multi-word memory blocks.
  • Add - Inserts 'ADD reg,reg,reg'
    Adds the contents of the third register to the second register and stores the sum into the first register.
  • Subtract - Inserts 'SUBTRACT reg,reg,reg'
    Subracts the contents of the third register from the second register and stores the difference into the first register.
  • And - Inserts 'AND reg,reg,reg'
    Performs a bitwise logical 'and' of the contents of the second and third registers then stores the result into the first register.
  • Or - Inserts 'OR reg,reg,reg'
    Performs a bitwaise logical 'or' of the contents of the second and third registers then stores the result into the first register.
  • Not - Inserts 'NOT reg,reg'
    Complements the vlue held in the second register then stores the result into the first register.
  • ASL - Inserts 'ASL reg,reg,bits'
    The 'arithmetic shift left' statement places into the first register a copy of the contents of the second register after they have been shifted to the left by the specified number of bits. As the contents of the register are shifted leftwards, 0's are inserted on the right. Arithmetic shift lefts are used to implement multiplication by power's of two.
  • ASR - Inserts 'ASR reg,reg,bits'
    The 'arithmetic shift right' statement palces into the first register a copy of the contents of the second register after they have been shifted to the right by the specified number of bits. As the contents of the register are shifted rightwards, copies of the leftmost bit are propogated to the right. Arithmetic shift rights are used to implement division by power's of two.
  • Compare - Inserts 'COMPARE reg,reg'
    Compares the contents of the first register to the contents of the second register and sets the CPU flag bits accordingly. Normally, 'compare' is used in conjunction with 'branch' to implement conditionals such as IF statements.
  • Branch - Inserts 'BRANCH cond,target'
    Loads the program counter with the address of 'target' (causing execution to branch to the instruction at that address) ONLY if the specified condition is true. Valid conditions include: LT - Less than, GT - Greater than, EQ - Equal, LE - Less than or equal, GE - Greater than or equal, NE - Not equal.
  • Jump - Inserts 'JUMP target'
    Load the program counter with the address of 'target' causing the next instruction executed by the program to be the one stored at that location.
  • Halt - Inserts 'HALT'
    This statement halts execution of the current Watson Assembly Language program.

<< Back

Back to Tutorials



Home | Labs | Tutorials | Known Bugs | Schedule | Archive | Members | Contact Information

For problems or questions regarding this site or the labs, contact the Watson Project.
Last updated: 10/22/03.