Error Message
KenC
Posts: 2
I hope I'm not asking to simple a question.· I'm new to SX programming:
I am working with the SX28 device.· I have written code to read data from several latches and send the information out to be converted to an ARINC 429 word.
I understand the concept of pages and how to jump or call across them, but I don't quite understand one error maessage that I keep getting--"Address is not within lower half of page".· I am not sure if I told it to be there somehow or·if I am getting the message because it needs to be for other reasons.
Is there somewhere I could find a little more data about this subject?
Thanks.
File has been enclosed.
I am working with the SX28 device.· I have written code to read data from several latches and send the information out to be converted to an ARINC 429 word.
I understand the concept of pages and how to jump or call across them, but I don't quite understand one error maessage that I keep getting--"Address is not within lower half of page".· I am not sure if I told it to be there somehow or·if I am getting the message because it needs to be for other reasons.
Is there somewhere I could find a little more data about this subject?
Thanks.
File has been enclosed.
src
18K
Comments
First, I recommend this book
http://www.parallax.com/detail.asp?product_id=70002
On to your error. Any call MUST be on the lower half of any page. This is because the call instruction has room for only 8 bits.....(learned this in the book I recommended)
for page 0, a call must be between org $000 and org $100
Here is a little demo
;FLINE NAME:
;Date:
;Programmer:Ken Mathis
;Purpose of this program is to:test jumping across pages
ifdef __SASM
·DEVICE·SX28L, STACKX, OPTIONX
·IRC_CAL·IRC_FAST
·FREQ·50_000_000
else
·DEVICE·SX28AC, OPTIONX
endif
DEVICE·TURBO, OSCHS2
RESET·START
;place directives here
;
[noparse][[/noparse]start of page boundry 1]
;any calls on page1 should be placed between org $000 and org $100
org·$000
page1·equ·$
page1sub
·clrb·rb.3
·ret
org·$100
Start
·call·page1sub;call to sub on first half of page 1
·call·@kensub·;call to sub on lower half of page 2
·jmp ·@ken·;jump to upper half of page 2
peterpage1
·call·@petersub;call to sub on first half of page 3
·jmp·@peter;jump to upper half of page 3
guentherpage1
·call·@guenthersub;call to sub on first half of page 4
·jmp·@guenther;jump to upper half of page 4
;
[noparse][[/noparse]end of page boundry 1]
;
[noparse][[/noparse]start of page boundry 2]
;any calls on page2 should be placed between org $200 and org $300
org·$200
page2·equ·$
kensub
·setb·rb.0
·clrb·rb.0
·retp·;if sub called from this page return to this page, if
··;sub called from another page return to that page
org·$300
ken
·call·kensub·;call to sub on page 2
·jmp·@peterpage1;jump back to page 1
;
[noparse][[/noparse]end of page boundry 2]
;
[noparse][[/noparse]start of page boundry 3]
;any calls on page3 should be placed between org $400 and org $500
org·$400
page3·equ·$
petersub
·setb·rb.0
·clrb·rb.0
·retp
org·$500
peter
·call·petersub·;call to sub on page 2
·call·@kensub
·jmp·@guentherpage1
;
[noparse][[/noparse]end of page boundry 3]
;
[noparse][[/noparse]start of page boundry 4]
;any calls on page43 should be placed between org $600 and org $700
org·$600
page4·equ·$
guenthersub
·setb·rb.0
·clrb·rb.0
·retp
org·$700
guenther
·call·guenthersub
·jmp·@start
End
Post Edited (KenM) : 8/28/2004 1:50:37 AM GMT