EASy68K  
It is currently Wed Nov 22, 2017 2:24 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Sat Feb 27, 2016 3:40 am 
Offline

Joined: Sat Jan 09, 2016 9:58 pm
Posts: 12
I preemptively apologize for asking a very elementary question; my searches did not quickly yield my answer.

I understand that when I want to access data from memory, the size of the instruction dictates what is read:


ex.
Code:
MOVE.L #0,D0
MOVE.L #0,D1
MOVE.L #0,D2
MOVE.L #0,D3

MOVE.L #524292,($40).L
MOVE.L ($40).L,D0
MOVE.W ($40).L,D1

MOVE.W D0,D2
MOVE.B D0,D3


I expect that this results in a filled D0:
54292 = 0000000000001000 0000000000000100
D0 = 0000000000001000 0000000000000100
and a half filled (lower order byte) D1 = 0000000000000000 0000000000001000

This is because the second move instruction reads 4 bytes and the first one reads only 2 bytes starting at address pointed to by the value stored at address $40.
My question is: when I read a word value from a filled register, is the higher order byte the one which is read (starting at the first byte at bit 31) or is the lower order byte the one that is read (starting at bit 15)? Alternately, would D2 contain #4 or #8?


Top
 Profile  
 
PostPosted: Sat Feb 27, 2016 11:23 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1049
The MOVE.W $40,D0 instruction copies the 16 bit value contained in address $40 and $41 to the lower 16 bits of register D0 resulting in 8.

Be careful about using memory locations below $400. Those addresses are reserved for exception vectors by the 68000.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Sat Feb 27, 2016 12:42 pm 
Offline

Joined: Sat Jan 09, 2016 9:58 pm
Posts: 12
Thanks for the response.

I understand that putting data into a register results in filling from the lowest order byte, but does reading from the register do the same? i.e. reading a word from the 32 bit register (which has bits throughout) takes the lower order word in the register?

Aside: Here is another interesting thought about the exception table- I find, when reading my disassembly, that the exception table is re-defined throughout the code.


Top
 Profile  
 
PostPosted: Sun Feb 28, 2016 9:55 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1049
Reading is the same as writing.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Mon Feb 29, 2016 9:41 am 
Offline

Joined: Tue Oct 20, 2015 7:09 pm
Posts: 7
profkelly wrote:
Be careful about using memory locations below $400. Those addresses are reserved for exception vectors by the 68000.

Looking in the 68000 programmer's manual, I see that $100..$3FF contains "user-defined" vectors, but I don't see much else about them. Could you explain what those vectors are used for?


Top
 Profile  
 
PostPosted: Mon Feb 29, 2016 12:44 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1049
Exception vectors are described in EASy68K help. Go to Help/Simulator Operation/Exceptions.

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Fri Mar 04, 2016 7:35 pm 
Offline

Joined: Tue Oct 20, 2015 7:09 pm
Posts: 7
profkelly wrote:
Exception vectors are described in EASy68K help. Go to Help/Simulator Operation/Exceptions.

Thank you for the tip, Professor. I looked at the page you referred to in the help file, but I don't see any information about the user-defined vectors from $100..$3FF. In fact, there's only information on some of the Motorola-defined vectors from below $C0. I also used the help file's search to look for info on exceptions and interrupts, but I can't find anything about these user-defined vectors. Am I missing something?


Top
 Profile  
 
PostPosted: Sat Mar 05, 2016 12:41 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1049
This book explains the user defined vectors.
"The 68000 Microprocessor" by Andrew M. Veronis
https://books.google.com/books?id=O2DTBwAAQBAJ&lpg=PA84&ots=7iGO7lRJkp&dq=68000%20user%20defined%20vectors&pg=PR2#v=onepage&q=68000%20user%20defined%20vectors&f=false

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Sat Mar 05, 2016 3:14 pm 
Offline

Joined: Tue Oct 20, 2015 7:09 pm
Posts: 7
profkelly wrote:

Thank you very much, Professor! :D


Top
 Profile  
 
PostPosted: Sat Mar 05, 2016 3:26 pm 
Offline

Joined: Sat Jan 09, 2016 9:58 pm
Posts: 12
In my attempt at disassembly, I find that some of the user defined vectors are referenced to interrupts for processor specific functions. For instance, when a function is setting up interrupts for serial communication it references the 64th vector, the first user defined vector, and the address that that vector points to contains actions for what to do with serial data.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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