That's all great documentation of points 1 and 2 in my post. It does NOT address point 3, which appears to be completely undocumented. -----Original Message----- From: kai.klein@t-online.de [mailto:kai.klein@t-online.de] Sent: Tuesday, October 17, 2000 12:18 To: sxtech@egroups.com Subject: Re: [sxtech] [SX]: math or load of PC ALWAYs clears PC.8? Importance: Low Hi , To jump across page boundaries: 1) Specify the jump command (JMP, JB, CJE, etc) with the page-set option (the @ sign preceding the address). The following code snippet demonstrates this: (See Help_Code\Page_Jumping.src on the diskette for full example) Start ORG $0 ;This routine is in page 0 JMP @Routine ;Jump to proper page JMP Start Routine ORG $200 ;This routine is in page 1 JMP @Start ;Jump back to proper page The @ symbol preceding the address causes the SX editor to insert a PAGE instruction just before the JMP to set the page select bits appropriately. The second JMP, in line three, does not require an @ symbol since the destination address is within the current page. If the @ was left out of line two, the SX would jump to address $000 instead of $200. See Jumping Across Pages in Appendix F for more information. Calling subroutines can pose even more boundary problems than jumping across pages. The CALL instruction uses only an 8-bit address as the operand (the 9 th bit of the address is always cleared). This limits the calling destination to the first 256 words of the current page. Because it is sometimes impossible to organize all subroutines within such a tight space, a common practice is to make use of a subroutine jump table. The jump table consists of a list of JMP commands to various subroutines and is located within the first 256 words of the page. The CALL instructions can simply call the proper location within the jump table and code execution jumps to the appropriate subroutine, even if it exists in different pages or above the 256 word barrier. Calling Across Pages with Jump Tables hope this helps it from sx-key_manual_v1_0.pdf ----- Original Message ----- From: James Newton To: ; Pic Microcontroller Discussion List Sent: Dienstag, 17. Oktober 2000 20:30 Subject: [sxtech] [SX]: math or load of PC ALWAYs clears PC.8? > I'll document that at the > http://www.sxlist.com > site, but shouldn't that be in the datasheet or errata or somewhere? > > --- > James Newton > 1-619-652-0593 > http://www.sxlist.com > mailto:jamesnewton@geocities.com > > -----Original Message----- > From: Stephen Holland [mailto:stephen.holland@scenix.com] > Sent: Tuesday, October 17, 2000 11:21 > To: 'sxtech@egroups.com' > Subject: RE: [sxtech] [SX]: math or load of PC ALWAYs clears PC.8? > Importance: Low > > > Correct, JMP PC+W can only be performed in the first half of a page. > > Stephen > > > -----Original Message----- > > From: James Newton [mailto:jamesnewton@piclist.com] > > Sent: Tuesday, October 17, 2000 11:21 AM > > To: Sxtech@Egroups. Com > > Subject: [sxtech] [SX]: math or load of PC ALWAYs clears PC.8? > > > > > > Ok, here is what I know... > > > > 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. Understood, well documented. > > > > 2. The call instruction clears the 9th bit (bit 8) of the PC > > so you can only > > call into the first 256 instruction half page of each 512 > > instruction page. > > Understood, well documented. > > > > Now, here is the one I want to make sure I'm not missing > > something on... > > > > 3. As far as I can tell, 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. > > > > Can some one confirm that? or correct me on that point? or > > point me to where > > that third point (and not the first two points) are > > documented by ANYONE? > > > > The main thing that concerns me is that the documentation > > doesn't appear to > > me to make that clear. Please prove me wrong. > > > > --- > > James Newton > > 1-619-652-0593 > > http://www.sxlist.com > > mailto:jamesnewton@geocities.com > > > > > > > > > > Egroups help: http://www.egroups.com/info/help/main.html > > > > Parallax SX tech support: (916) 624-8333 > > > > -or- mailto:sxtech@parallaxinc.com > > > > > > > > Egroups help: http://www.egroups.com/info/help/main.html > > Parallax SX tech support: (916) 624-8333 > > -or- mailto:sxtech@parallaxinc.com > > > > > Egroups help: http://www.egroups.com/info/help/main.html > > Parallax SX tech support: (916) 624-8333 > > -or- mailto:sxtech@parallaxinc.com > > > Egroups help: http://www.egroups.com/info/help/main.html Parallax SX tech support: (916) 624-8333 -or- mailto:sxtech@parallaxinc.com Egroups help: http://www.egroups.com/info/help/main.html Parallax SX tech support: (916) 624-8333 -or- mailto:sxtech@parallaxinc.com