EASy68K  
It is currently Wed May 23, 2018 10:31 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Adress error
PostPosted: Tue Feb 13, 2018 12:18 pm 
Offline

Joined: Tue Feb 13, 2018 12:11 pm
Posts: 2
Hello!

Iam currently beginning a project to learn 68k asm and general understanding the 68k cpu.
Ive bought the book "The 68000 processor" by James L. Antonakos. And just to check that i had the toolchain working i typed in the example program in side 39:

Code:
        ORG     $8000
SUM     DC.W    0
DATA    DS.B    16
       
        ORG $8100       
TOTAL   CLR.W   D0
        MOVE.B  #16,D1
        MOVEA.L #DATA,A0
LOOP    ADD.B   (A0)+,D0
        SUBI.B  #1,D1
        BNE     LOOP
        MOVEA.L #SUM,A1
        MOVE.W  D0,(A1)
        RTS

        END TOTAL


It assembles the code without any error or warnings, however in the simulator i get:
Code:
Address Error: Instruction at ffffffff accessing address ffffffff


I just wanted to know what is causing this. Is the book not compatible with the easy68k or is there something else wrong?

Thank you.


Top
 Profile  
 
 Post subject: Re: Adress error
PostPosted: Tue Feb 13, 2018 1:21 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1072
The RTS instruction pulls a return address from the stack and goes to that address, however since TOTAL was not called as a subroutine there is not a valid return address. Replace the RTS instruction with SIMHALT and it will work.

cross wrote:
Code:
        ORG     $8000
SUM     DC.W    0
DATA    DS.B    16
       
        ORG $8100       
TOTAL   CLR.W   D0
        MOVE.B  #16,D1
        MOVEA.L #DATA,A0
LOOP    ADD.B   (A0)+,D0
        SUBI.B  #1,D1
        BNE     LOOP
        MOVEA.L #SUM,A1
        MOVE.W  D0,(A1)
        SIMHALT

        END TOTAL


_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: Adress error
PostPosted: Tue Feb 13, 2018 3:58 pm 
Offline

Joined: Tue Feb 13, 2018 12:11 pm
Posts: 2
Thank you very much for that info.

Is this due to a error in the book, or is it something that is for the simulator only?
I guess that the "SIMHALT" is only for the simulator?


Top
 Profile  
 
 Post subject: Re: Adress error
PostPosted: Tue Feb 13, 2018 7:58 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1072
Correct, SIMHALT is unique to EASy68K.

_________________
Prof. Kelly


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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