please answer E21 E22 E23 E24E26 216 L Exercises 87 Rotate i

please answer E2.1, E2.2, E2.3, E2.4,E2.6

2.16 L Exercises 87 Rotate instructions are useful for bit-field manipulations. They can also be used to implement rs dividing a ble by a power of 2. All rotate instructions operate on 8-bit regis only. One can write a sequence of instructions to or a A PIC18 instruction takes either one or two instruction complete. choosing an appropriate cycles to By be created instruction sequence and repeating it for a certain number of times, a time delay can Exercises E2.1 Identify the four fields of the following instructions: addwf 0x10 W.A add register 0x10 to WREG b) wait btfss. STATUS FA skip the next instruction if the C flag is 1 decfsz cnt, F, A decrement cnt and skip if it is decremented to 0 Find the valid and invalid labels in the following instructions and explain why an invalid label is invalid Column 1 a. sum h equ 0x20 ncf WREG, WA increment WREG by 1 OW t abc movwf 0x30, A d. 5plus3 clrf A 0x33 decf 0x35, F, A may f. ?less orwf 0x1A, F, A g. two three goto esSS E2.3 Use an assembler directive to define a string \"Please make a choice (1/2):\" program in memory. 4 Use assembler directives to define a table of all uppercase letters. Place this table in pro gram memory starting from location 0x2000. Assign one byte to one letter E2.5 Use assembler directives to assign the symbols sum, Ip cnt, height, and weight to data memory locations at 0x00, 0x01, 0x02, 0x03, respectively E2.6 write an instruction sequence to decrement the contents of data memory locations ox10 0x11, and 0x12 by 5, 3, and 1, respectively E2.7 Write an instruction sequence to add the te numbers stored in memory locations 0x11-0x13 and 0x14-0x16 and save the sum in memory locations 0x20-0x22. E 2.8 Write an instruction sequence to subtract the 4-byte number stored in memory locations 0x10-0x13 from the 4-byte number stored in memory locations 0x00-0x03 and store the differ ence in memory locations 0x20-0x23 E2.9 Write an instruction sequence to shift the 4-byte number stored in memory locations 0x20-0x23 to the right arithmetically four places and leave the result in the same location E2.10 Write a program to shift the 64-bit number stored in data memory locations 0x10-0x17 to the left four places E2.11 Write an instruction sequence to multiply the 24-bit unsigned numbers stored in data memory locations 0x10-0x12 and 0x13-0x15 and store the product in data memory locations 0x20-0x25 E2.12 Write an instruction sequence to multiply the unsigned 32-bit numbers stored in data memory locations 0x00-0x03 and 0x04-0x07 and leave the product in data memory memory locations 0x10 0x17

Solution

E.12 instruction sequence

0 1 0 1

0 0 1 1

1 0 1 0

1 1 1 1

E 1.13 sequence addition = I + J +K /3

E1.14 1010

1000

1005

please answer E2.1, E2.2, E2.3, E2.4,E2.6 2.16 L Exercises 87 Rotate instructions are useful for bit-field manipulations. They can also be used to implement rs

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site