MPASM creates a CALL 0x0 ???

geekoftheweek

Joined Oct 6, 2013
1,429
No, but he would need to change PCLATH prior to the next CALL or GOTO to page 0.
Fair enough. I didn't look in to how the return address was stored on the stack and thought maybe there was something there to account for. I decided early in my hobby that the 16F and lower families had too many quirks to deal with and have always used 18F parts for all my tinkering.
 

Thread Starter

techristian

Joined Aug 27, 2013
53
So I have established ORG page boundaries and I have put all of my most used SubRoutines in Zero page and renamed all of my Subroutines according to page number. For instance all subs on page zero are named starting with a "Z" page 1 "A" page 2 "B" page 3 "_C" ETC. If they grow outside of their page limits they will be moved to a new page and be relabeled.
This way, m assuming that I won't need PCLATH EVERY TIME.

;************************************************************************CODE SEGMENT*****************
movlw HIGH zinactive
movwf PCLATH
Call zinactive
CALL zTinyDelay
CALL zaddress
movf RegAdress,0
MOVWF PORTB
CALL zTinyDelay
Call zinactive
CALL zread
CALL zTinyDelay
movf FreqNoiseHold,0
MOVWF PORTB
CALL zTinyDelay
Call zinactive
incf RegAdress,1
;********************************************************************************************************************
 

joeyd999

Joined Jun 6, 2011
6,305
So I have established ORG page boundaries and I have put all of my most used SubRoutines in Zero page and renamed all of my Subroutines according to page number. For instance all subs on page zero are named starting with a "Z" page 1 "A" page 2 "B" page 3 "_C" ETC. If they grow outside of their page limits they will be moved to a new page and be relabeled.
This way, m assuming that I won't need PCLATH EVERY TIME.

;************************************************************************CODE SEGMENT*****************
movlw HIGH zinactive
movwf PCLATH
Call zinactive
CALL zTinyDelay
CALL zaddress
movf RegAdress,0
MOVWF PORTB
CALL zTinyDelay
Call zinactive
CALL zread
CALL zTinyDelay
movf FreqNoiseHold,0
MOVWF PORTB
CALL zTinyDelay
Call zinactive
incf RegAdress,1
;********************************************************************************************************************
Just remember that GOTOs are also affected by PCLATH.
 

Thread Starter

techristian

Joined Aug 27, 2013
53
Just remember that GOTOs are also affected by PCLATH.
YEP ....WILL DO
But now less suppose that the Goto is part of the subroutine you are already in? Shouldn't be necessary then should it?, as long as I make sure that the sub doesn't expand to the next page.

BTW I was in Fort Lauderdale in June.

Dan
 

Thread Starter

techristian

Joined Aug 27, 2013
53
Also my "bz" "bnz" "bnc" shorcuts are actually 2 separate commands combined. A conditional bit test followed by a GOTO. Almost missed that one.
 
Top