Assignment #1
Assignment #1
- Write an instruction sequence to swap the contents of data registers at Ox300 and Ox200.
- Write an instruction sequence to load the value of Ox39 into data memory locations Oxl OO-Oxl03.
- Write an instruction sequence to subtract 10 from data memory locations Ox30-0x34.
- Write an instruction to store the contents of the WREG register in the data register located at Ox25 of bank 4.
- Write an instruction sequence to copy the contents of data memory at Oxl00-0xl03 to Ox200-0x203 using the postincrement addressing mode.
- 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.
- Write an instruction sequence to add 5 to data registers at $300–$303.
- Write an instruction sequence to add the contents of the data registers at $10 and $20 and
store the sum at $30. - 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.)