Function Add Instruction
The add instruction adds values in src1 and src2 and stores the result in dst
Format:
an add instruction with dst: dst src1: src1 and src2: src2
Input:
number dst - 
    
    number src1 - 
    
    number src2 - 
    
    Output:
boolean - None
    Details:
Instructions
        
    | Memory Cells | 
|---|
| Program Counter | Time | 
|---|---|
| 0 | 0 | 
  
  
LW Computer Simulator
Conditional properties that reference this function:
if the following are true:
- the instruction at computer c and index i = an add instruction with dst: d src1: s1 and src2: s2
 - the PC at computer c and time t = i
 
then byte at ID: c, cell #d at time (t + 1) = (byte at ID: c, cell #s1 at time t) + (byte at ID: c, cell #s2 at time t)
(link)if the following are true:
- the instruction at computer c and index i = an add instruction with dst: d src1: s1 and src2: s2
 - the PC at computer c and time t = i
 - not (other = d)
 
then byte at ID: c, cell #other at time (t + 1) = byte at ID: c, cell #other at time t
(link)if the following are true:
- the instruction at computer c and index x = an add instruction with dst: s src1: d and src2: imm
 - the PC at computer c and time t = x
 
then the PC at computer c and time (t + 1) = x + 1
(link)
Comments
Please log in to add comments