|Description:||Add W into PC(L), clear bit 8|
|Operation:||PC = ( PC & 0xFEFF ) + W|
|Flags affected:||C DC Z|
|Actually compiles to:||add 2, W|
|Microchip PIC syntax:||ADDWF 2,1|
When executing a jmp PC+W, on the SX 18,28,etc.. no carry of the addition from bit 7 to bit 8 of the PC is performed. This means that relative jumps are restricted to the half page of 256 instructions from which the jump originates.
Despite this not being documented anywhere, adding, or-ing, and-ing, moving, etc... an 8 bit value to the PC (bits 0..7) also results in CLEARING the 9th bit (bit 8) of the PC. So you can only do relative or computed jumps into the first half page of each page. Just like calls.
Affected by the the CF_ bit in FUSEX (DEVICE CARRYX). If the CF bit is set to Zero, the Carry flag will be included in the addition. As a result, if the Carry is set, the destination will be one address higher than ( PC & 0xFEFF ) + W
|file: /Techref/scenix/inst/jmppcw.htm, 2KB, , updated: 2008/1/30 20:15, local time: 2019/10/17 20:17,
|©2019 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/scenix/inst/jmppcw.htm"> SX Instruction JMP PC+W</A>
|Did you find what you needed?|
PICList 2019 contributors:
o List host: MIT, Site host massmind.org, Top posters @20191017 RussellMc, David Van Horn, Bob Blick, AB Pearce - UKRI STFC, Neil, Jason White, Dwayne Reid, James Cameron, David C Brown, Manu Abraham,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!