It is currently Sat Feb 29, 2020 7:24 am

 All times are UTC

 Page 1 of 1 [ 10 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Accessing part of a filled registerPosted: Sat Feb 27, 2016 3:40 am

Joined: Sat Jan 09, 2016 9:58 pm
Posts: 22
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

 Post subject: Re: Accessing part of a filled registerPosted: Sat Feb 27, 2016 11:23 am

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1118
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

 Post subject: Re: Accessing part of a filled registerPosted: Sat Feb 27, 2016 12:42 pm

Joined: Sat Jan 09, 2016 9:58 pm
Posts: 22
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

 Post subject: Re: Accessing part of a filled registerPosted: Sun Feb 28, 2016 9:55 am

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

_________________
Prof. Kelly

Top

 Post subject: Re: Accessing part of a filled registerPosted: Mon Feb 29, 2016 9:41 am

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

 Post subject: Re: Accessing part of a filled registerPosted: Mon Feb 29, 2016 12:44 pm

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

_________________
Prof. Kelly

Top

 Post subject: Re: Accessing part of a filled registerPosted: Fri Mar 04, 2016 7:35 pm

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

 Post subject: Re: Accessing part of a filled registerPosted: Sat Mar 05, 2016 12:41 pm

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1118
This book explains the user defined vectors.
"The 68000 Microprocessor" by Andrew M. Veronis

_________________
Prof. Kelly

Top

 Post subject: Re: Accessing part of a filled registerPosted: Sat Mar 05, 2016 3:14 pm

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

Thank you very much, Professor!

Top

 Post subject: Re: Accessing part of a filled registerPosted: Sat Mar 05, 2016 3:26 pm

Joined: Sat Jan 09, 2016 9:58 pm
Posts: 22
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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 10 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 16 guests

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

Search for:
 Jump to:  Select a forum ------------------ EASy68K Forum    FAQ    Latest Features    EASy68K Questions    68000 Programming Questions    Wish List    Wishes Granted    Undocumented Features    Documented Features    General Discussion    EASy68K Projects