1 List the hexadecimal code for the following program Use MA
1. List the hexadecimal code for the following program (Use MARIE).
LOAD A
ADD ONE 102
JUMP S1
S2, ADD ONE
STORE A
HALT
S1, ADD A
JUMP S2
A, HEX 0023
One, HEX 0001
Solution
Label Hex Address    Instruction
  100 Load A //load A (hex 0023) into accumulator
 101 Add One //add hex 0001 to accumulator
 102 Jump S1 //jump(unconditional) to label S1
 S2, 103 Add One //add hex 0001 to accumulator
 104 Store A //store the content of accumulator in A
 105 Halt //program terminates
 S1, 106 Add A //destination of Jump. Adds content of A (hex 0023) to accumulator
 107 Jump S2 //jump(unconditional) to label S2
 A, 108 HEX 0023 //constant value of A
 One, 109 HEX 0001 //constant value of One
Required list of Hexadecimal codes for the above program is as below:
1108
 3109
 9106
 3109
 2108
 7000
 3108
 9103
 0023

