EASy68K  
It is currently Sat Mar 25, 2017 1:56 am

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
PostPosted: Thu Apr 26, 2012 6:39 am 
Offline

Joined: Mon Apr 11, 2005 12:57 am
Posts: 27
Location: Australia
Hi,

I have been doing some testing of some Exception processing for Bus and Address errors and I appear to have found a problem. According to the Motorola documentation when a Bus Error occurs the stack should contain the following data Highest to lowest address.

Program Counter (Long Word)
Status Register (Word)
Instrution Register (Word)
Address (Long Word)
Special Data (Word)

According to Motorola, the structure of the Special Data is:
bits 0-2 = Function Code
bit 3 = INSTRUCTION/NOT: INSTRUCTION = 0, NOT = 1.
bit 4 = R/W (READ/WRITE): WRITE = 0, READ = 1.

The above information was sourced from Page B-3 figure B2 from http://www.freescale.com/files/archives/doc/ref_manual/M68000PRM.pdf

In my testing all the data execpt the Special Data is correct.
The Special Data is not containing the Read/Write part correctly as it is always a 0 regardless of what the code was doing.

Read Sample Code.
Code:
00000000                             7          MEMORY  INVALID $8000,$8200
00000008                             8          ORG     $08
00000008= 0000100C                   9          DC.L    BUS_ERROR
0000000C                            10 
00001000                            11          ORG     $1000
00001000                            12  START:                          ; first instruction of program
00001000  2039 00008100             13          MOVE.L  $8100,D0
00001006  103C 0009                 14          MOVE.B  #9,D0
0000100A  4E4F                      15          TRAP    #15             ; halt simulator
0000100C                            16 
0000100C                            17  BUS_ERROR
0000100C  4E71                      18          NOP
0000100E  4E73                      19          RTE
00001010                            20 
00001010                            21 
00001010                            22          END     START           ; last line of source

Memory Stack at line 18
Code:
00FFFFF0: FF FF 00 00 00 81 00 20 39 20 00 00 00 10 02

Line 13 is a read from invalid address, No Good
Address 00FFFFF2 should contain 01 not 00 and I think the Function Code might be wrong.

Write Sample Code
Code:
00000000                             7          MEMORY  INVALID $8000,$8200
00000008                             8          ORG     $08
00000008= 0000100C                   9          DC.L    BUS_ERROR
0000000C                            10 
00001000                            11          ORG     $1000
00001000                            12  START:                          ; first instruction of program
00001000  23C0 00008100             13          MOVE.L  D0,$8100
00001006  103C 0009                 14          MOVE.B  #9,D0
0000100A  4E4F                      15          TRAP    #15             ; halt simulator
0000100C                            16 
0000100C                            17  BUS_ERROR
0000100C  4E71                      18          NOP
0000100E  4E73                      19          RTE
00001010                            20 
00001010                            21 
00001010                            22          END     START           ; last line of source

Memory Stack at line 18
Code:
00FFFFF0: FF FF 00 05 00 81 00 23 C0 20 00 00 00 10 02

Line 13 is a write to invalid address, All appears good although the Function Code has changed, not sure if that is right.

Is this a bug? or am I missing something?

Thanks
Kenneth


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 26, 2012 1:22 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1035
Location: Monroe County Community College, Monroe Michigan, U.S.A.
This topic has a previous discussion thread here:
http://www.easy68k.com/EASy68Kforum/vie ... hlight=bus

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 2 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