EASy68K  
It is currently Tue Jun 27, 2017 3:46 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Dec 25, 2016 5:17 pm 
Offline

Joined: Fri Dec 23, 2016 5:18 pm
Posts: 49
Location: New Mexico, USA
Hi,
I want my boot software to be relocatable so I can swap boot device out of location $0 and replace with RAM. I also want to do PC-relative jump to subroutines by setting up a jump table with offset from the location of the JSR instruction. When I assemble the code below, the instruction jsr (pc,a0) gets an error message, "ERROR: undefined symbol". The EASy68K assembler has no problem with jsr (a0). So I think I may have the syntax incorrect? (That was the correct syntax for the old Quelo a68k assembler). Thanks for your help!

Code:
************my program*****************
    org $1000


*********** command table, a list of command entry points ************
cmdtable:            
   dc.l do_cmd1-jsr_reference   * calculate offset of do_cmd1 from jsr_reference
   dc.l do_cmd2-jsr_reference   * calculate offset of do_cmd2 from jsr_reference
*   .
*   .
   dc.l do_cmdn-jsr_reference   * calculate offset of do_cmdn from jsr_reference
*********** end of command table *************   


main_entry:



   lea cmdtable(pc),a0      * point a1 to the command table, pc-relative
   add.l #4,a0             * offset from command table
   move.l (a0),a0         * get the actual entry point of do_cmd2
jsr_reference:
   jsr (PC,a0)              * should jump subroutine to do_cmd2
   
   
   
do_cmd1:
    nop
    rts
do_cmd2:
    nop
    rts
*
*
do_cmdn:
    nop
    rts


    end main_entry

*******end of my program*******


edit: hmmm, program is not formatting correctly. I hope it is still readable to you.


Top
 Profile  
 
PostPosted: Mon Dec 26, 2016 12:59 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1039
Try this:
Code:
   jsr *(PC,a0)


This is an issue that I should probably correct in the assembler.
I don't have any free time so it will be a while before I can look into it.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Mon Dec 26, 2016 6:42 pm 
Offline

Joined: Fri Dec 23, 2016 5:18 pm
Posts: 49
Location: New Mexico, USA
Thanks! That works for me, I'll just put comments around it so I don't get confused later. The simulator works correctly with that instruction, so all is well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group