EASy68K  
It is currently Sat Jun 06, 2020 8:57 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: storing result at D0
PostPosted: Mon Feb 28, 2011 2:15 am 
Offline

Joined: Sun Feb 27, 2011 9:39 am
Posts: 2
Location: Philippines
Hello!

I have a problem with the specs given to me. The instruction says that we have to store the result of our program (which I am done with already) to register D0. But because of MOVE.B #9,D0 TRAP #15, the LSB of D0 has 9. Is there any way to replace that MOVE.B #9.D0, or maybe there's something wrong with the specs? I still don't have a reply from my prof on the specs, and maybe there is a way for that 9 not to appear. Any help would be great.

Thanks a lot! :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2011 3:22 am 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
One might reasonably assume that it is the value in D0 immediately prior to halting the simulator with the D0=9;TRAP or HALT or STOP

I would suggest that a) you store the value in D0 into a memory location like ANSWER or RESULT, and b) print out it's content, before you halt. Comment your epilogue code suitably so that it's clear to your instructor you have thought about this.

You could also compartmentalize your assignment code within a subroutine that returns the value in D0. You call the subroutine, and then halt.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2011 6:01 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1122
You may also use the STOP instruction to halt the simulator.

Code:
* Stop execution
   STOP   #$2000

_________________
Prof. Kelly


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 5 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:  
cron
Powered by phpBB® Forum Software © phpBB Group