To complete the LAB's you need a copy of the LAB1-2 worksheet

 

 

Asm.jpg (1532 bytes)

 

LAB 1 - Data in Registers

 


.We shall:
   - put the decimal number 14 into the  R0 register
   - put the decimal number 27 into the R1 register
   - add the contents of the registers storing the result in R0

wpe1.jpg (6141 bytes)

Write the program as shown above

- select Assemble from the main menu

and wpe2.jpg (1585 bytes)note that  the R0 register correctly shows 42

wpe4.jpg (12305 bytes)

Note also the change to the program Counter (PC) contents...


The Instruction Set

The processor executes a program which consists of a number of instructions. The entire instruction set consists of some 400 instructions from which all programs will be composed. The LAB 1 program above uses only three instructions.

-  a 'move' instruction

- an 'arithmetic' instruction

- the RTS instruction

Asm.jpg (1532 bytes)

 

LAB 2.1

 

Write a program to:
- store 13 hexadecimal  in R1
- store 2F hexadecimal in R2
- store 5C hexadecimal in R3
- add the contents of all three registers and store the result in R4

make clear the number is in hex. with:

move #$13, r1

note the register contents will still be displayed as decimal values so check the arithmetic by hand, or change the display ...

Immediate Values

When a number used in an instruction has the symbol # placed before it, e.g.


                                                move #28, R2

28 is described as an 'immediate' value.

Subtract Instructions

The instruction set will have similar instructions for subtract.

Asm.jpg (1532 bytes)

 

LAB 2.2

 


Use the Asm Help to find out how to subtract:
- the contents of two registers
- an 'immediate value' from the contents of a register

Write a program to store:
- 13 hex  in R0
- 34 hex in R1
- subtract (R0) from (R1) and store result in R1
- subtract 15 hex from (R1)                                                 ( ) means contents of

what answer should finally be in R1 ?

Note, the notation (r0) to indicate 'the contents of r0'.