Write programs that will accomplish the desired tasks listed below, using as few lines of code as possible. a) Add the bytes in RAM locations 34H and 35H ; put the result in register R5 (LSB) and R6 (MSB) b) Subtract the content of R2 from the number F3H ; put the result in external RAM location 028BH. c) Subtract the content of R1 from R0 ; put the result in R7.
Write programs that will accomplish the desired tasks listed below, using as few lines of code as possible.
a) Add the bytes in RAM locations 34H and 35H ; put the result in register R5 (LSB) and R6 (MSB)
b) Subtract the content of R2 from the number F3H ; put the result in external RAM location 028BH.
c) Subtract the content of R1 from R0 ; put the result in R7.
d) Multiply the data in RAM location 22H by the data in RAM location 15H ; put the result in RAM
location 19H (low byte) and 1AH (high byte).
e) Divide the data in RAM location 3EH by the number 12H ; put the quotient in R4 and the remainder
in R5.
f) Divide the data in RAM location 15H by the data in RAM location 16H ; put the quotient in
external RAM location 7CH and the remainder in in external RAM location 7DH.
g) Double the number in register R2, and put the result in register R3 (high byte) and R4 (low byte).
Use logic operations.
h) OR the contents of ports 1 and 2 ; put the result in external RAM location 0100H
i) Set Port 0, bits 1, 3, 5 and 7 to one, set the rest to zero.
j) Clear bit 3 of RAM location 22H without affecting any other bit.
k) Invert the data on the port 0 pins and write the data to port 1.
Step by step
Solved in 4 steps