Program Set I: Data Movements Instructions: 1. Copy the contents of
Download
Report
Transcript Program Set I: Data Movements Instructions: 1. Copy the contents of
EC-602
Advanced Microprocessors
& Micro-controllers
Program Set I:
Data Movements Instructions:
1.
2.
3.
4.
Copy the contents of internal RAM address 08h to the
registers R0 to R7 of bank 0. (Give two methods).
Copy the contents of external RAM address 0023h to
the registers R0 of Bank 0, R0 of bank 1, R2 of bank 2
& R3 of bank 3.(Give two different methods).
Copy the contents of internal RAM location 1000h to
external RAM locations 0200H.
Copy the contents of internal RAM location 10H to
external RAM locations 10H in two different ways
Program Set II:
Logical Instructions:
1.
2.
3.
4.
Swap the nibbles of R0 and R1 so that the low
nibble of R0 swaps with the high nibble of R1 and
the high nibble of R0 swap with the low nibble of
R1.
Double the contents of Register R3 (Bank 0), and
store the result in Register R3 of Bank 2 (High byte)
and R4 of Bank 0 (Low byte).
Treat the registers R0 and R1 as 16 bit registers, and
rotate them one place to the left, bit 7 of R0
becomes bit 0 of R1, bit 7 of R1 becomes bit 0 of R0,
and so on.
Rotate the DPTR one place to the left, bit 15
becomes bit 0.
Program Set III:
Arithmetic Instructions & Bit level instructions:
1.
2.
3.
Find X-OR of bit addresses 20h and 21h. Store
result in 22h.
Perform addition of two 16 bit data stored at
External memory location 30H, 31H, 32H, 33H.
Store result in 34H, 35H, 36H.
Perform 16 bit subtraction of data stored at internal
RAM location 40h, 41H, 42H, 43H. Store result at
44H, 45H.
Program Set IV:
JUMP & CALL instructions:
1.
2.
3.
Count the numbers of 0’s in any number in Reg. R3
and put the count in R5.
Use R4(LSB) and R5(MSB) as a single 16 bit counter
and decrement the pair until they equal 0000h.
Perform arithmetic operations in contents of R3, R4
according to value of R2. Use subroutine to
perform each arithmetic operation. Store result in
R5,R6.
R2
Arithmetic Operation
0
Addition
1
Subtraction
2
Multiplication
3
Division
Program Set V:
Array handling & look up table
1.
2.
3.
Add array of 8 bit data stored from internal RAM
location 60h. First location contains number of
data. Store 16bit result at int. RAM location 5Eh,
5Fh.
Find the average of ten 8 bit data starting from Ext.
RAM location 2000. First location contains number
of data. Store result at Ext Memory location at
1FFFh.
Find the 7 segment code for given binary data at
internal RAM location 30H. Use look up table
technique. Number can range from 00 to FFh.
Program Set VI:
Data conversion techniques:
1.
2.
3.
Find ASCII code of packed BCD stored at RAM
location 34H. Store result at internal RAM location
35H, 36H.
Convert 8 bit hex data stored at internal RAM
location 20H into unpacked BCD. Store result at
internal memory location 21h, 22h, 23H. Use
subroutines.
Convert 4 bit BCD data stored at internal RAM
location 30H into Grey code. Store result at internal
RAM location 31H.