You are on page 1of 5

LAB ACTIVITY 1

1. Write a simple code to add the following numbers stored at 0X300 and 0x301
(i) FFH + FFH

(ii) 95 + (-85)

Store the carry, if any in 0X303 and sum in 0x302.

2. Subtract the contents of 0X300 from 0X301


(i) 00H – FFH
(ii) 79 – (-200)

Store the borrow, if any in 0X303 and sum in 0x302.

3. Use ADC to perform 16 bit addition of


(i) FFFFH and FFFFH

(ii) ABCDH and 1234H


Store the result at 0X204--- LSB of result, 0X205----MSB of result, 0X206----MSB
of the result.
4. Use SBC to perform 16 bit subtraction of
(i) FFFFH - 1234H

(ii) 0000H – FFFFH

Store the result at 0X204--- LSB of result, 0X205----MSB of result, 0X206----MSB


of the result.
5. Write a simple code to complement the contents of location $68 and place the result
in R27
6. Write a simple code to
(a) Load the value $15 into location $67
(b) Add it to R19 five times and place the result in R19 as the values are
added. R19 should be zero before the addition starts.

7. Write a simple code to load the value $5F into the PORTB I/O register.

8. Write a simple code to copy data from location $68 to PORTC using R19

You might also like