EASy68K  
It is currently Tue Dec 10, 2019 12:58 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Calling Subroutine
PostPosted: Fri Feb 22, 2008 4:25 pm 
Offline

Joined: Fri Feb 22, 2008 4:15 pm
Posts: 2
Location: Arkansas, USA
I am running the follow sample code out of the Computer Organization book:

Code:
SUM     EQU $2050
NUM1    EQU $2000
       
START   ORG $1000
        MOVEA.L #NUM1,A2
        MOVE.L  #4,D1
        BSR LISTADD
        MOVE.L D0,SUM
        STOP #$2000

LISTADD SUBQ.L #1,D1
        CLR.L D0
LOOP    ADD.W (A2)+,D0
        DBRA D1,LOOP
        RTS             RETURN

        END START


The problem is that after completing 4 loops as described, the program does not stop but continues going down into LISTADD and falls into an infinite loop.
How can I stop the program after the MOVE.L D0 SUM command?
Thank you

Linh


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 22, 2008 11:19 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1109
It works fine for me. How are you running it?

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 25, 2008 1:13 pm 
Offline

Joined: Fri Feb 22, 2008 4:15 pm
Posts: 2
Location: Arkansas, USA
it works fine for me also on my laptop. However, several of the students claim that the program is not stopping for them. They used "Trace Into" to execute the program and to step through the loop.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 25, 2008 3:43 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1109
The only thing I can think of the might cause a problem is using an older version of EASy68K. Using the current version when the STOP instruction runs the trace commands are deactivated.

_________________
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 4 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