"

Assignment #1

Assignment #1

  1. Write an instruction sequence to swap the contents of data registers at Ox300 and Ox200.
  2. Write an instruction sequence to load the value of Ox39 into data memory locations Oxl OO-Oxl03.
  3. Write an instruction sequence to subtract 10 from data memory locations Ox30-0x34.
  4. Write an instruction to store the contents of the WREG register in the data register located at Ox25 of bank 4.
  5. Write an instruction sequence to copy the contents of data memory at Oxl00-0xl03 to Ox200-0x203 using the postincrement addressing mode.
  6. Write an instruction sequence to copy the contents of data memory at Oxl00-0xl03 to Ox203-0x200, that is, in reverse order, by combining the use of postincrement and postdecrement modes.
  7. Write an instruction sequence to add 5 to data registers at $300–$303.
  8. Write an instruction sequence to add the contents of the data registers at $10 and $20 and
    store the sum at $30.
  9. Write an instruction sequence to subtract the contents of the data register at Ox20 from that of the data register at Ox30 and store the difference in the data register at OxlO.

Reference:

Chartrand, L., & Huang, H. W. (2005). (PIC microconteroller: an introduction to software & hardware interfacing.)

License

Icon for the Creative Commons Attribution 4.0 International License

Introduction to Microcontrollers Copyright © 2024 by Lake Washington Institute of Technology is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.