ANDA Instruction is used to
clear the bits
ORAB instruction is used to set the bits.
A- Using either “ANDA” or “ORAA” instructions, write an HCS12 code to clear bits 0, 2,5,...
Write Nios II assembler instructions that will invert bits 3 to 0, set (turn on) bits 11 to 8 and reset (turn off) bits 31 to 12 in register r4. All other bits in r4 should be left unchanged. Finish off this piece of code with a jump immediate to address 0x00000040
S4.1) Write C code to set all odd bits (b1, 63, b5, b7) in the uint_8 variable PORT. All other bits should not be changed. S4.2) Write C code to clear bits b3, 64, and b5 in the uint_8 variable PORT. All other bits should not be changed. S4.3) Write C code to toggle all even bits in the uint_8 variable PORT. All other bits should not be changed.
The following code is used to set (1) and clear (0) certain bits of a one byte variable. The initial state of all bits is unknown ('x'). After both of the following commands are executed in the order shown , determine which bits are known to be 1. A &= ~0x03; A |= ~0x30; Note: A |= 0xFB is the same command as A = A | 0xFB
Find the shortest sequence of ARMv7M instructions that extracts bits 16 down to 11 from register r0 and uses the value of this field to replace bits 31 down to 26 in register r1 without changing the other bits of registers r0 or r1. (Be sure to test your code using r0 = 0 and r1 = 0xffffffff. Doing so may reveal a common oversight.) Please explain steps and reasoning.
PCON is not a bit addressable register. Write a C code segment that makes sure that SMOD0 (bit 6) is cleared to ‘0’ and SMOD1 (bit 7) is set or cleared based on a defined value (i.e #define SMOD1 (1) would cause bit 7 to be set.). Hint: This can be done with as few as two instructions (one to clear and one to set).
Use HCS12 assembly language only - not C code Using CodeWarrior to create a new project that uses assembly language. Write an assembly program that turns on the red LED at the beginning. It switches to off 2 seconds later and switches back to on after three more seconds. (That is, it stays on for 2 seconds and off for 3 seconds.) This switching process lasts forever. Use a loop (or nested loops) for each of the 2/3-second delay where...
2.Write code that jumps to label Ll if either bit 4, 5, or 6 is set in the BL register (10')
Implement the following statements using MS430 assembly instructions. You may use more than one, but you should minimize the number of instructions required. You can use both native and emulated instructions. Use hex notation for all numbers 1. (a) Move the word located in register R14 to R15 (b) Increment the word in R6 by 2. (c) Perform a bitwise ANDing of the word located at address 0x0240 with the datum in R15, placing the results in R15. (d) Rotate...
Write assembly instructions to set Bit 3 of variable foo without changing other bits. Any quick response to this would be highly appreciated.