EASy68K  
It is currently Fri Dec 15, 2017 8:15 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: NBCD - n flag
PostPosted: Sat Feb 23, 2013 9:26 pm 
Offline

Joined: Sun Feb 17, 2013 7:16 pm
Posts: 10
MOVE.B #$7a, D1
MOVE #$0, CCR
NBCD D1

in easy68k assembly above sets the N flag. Is this how it should be? The size of operation is byte. The most significant is zero.

http://emu-docs.org/CPU%2068k/68knotes.txt


Top
 Profile  
 
 Post subject: Re: NBCD - n flag
PostPosted: Sun Feb 24, 2013 5:14 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
The status of the N flag is undefined with the NBCD instruction.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: NBCD - n flag
PostPosted: Sun Feb 24, 2013 9:03 pm 
Offline

Joined: Sun Feb 17, 2013 7:16 pm
Posts: 10
profkelly wrote:
The status of the N flag is undefined with the NBCD instruction.


I know but it doesn't mean its unpredictable.


Top
 Profile  
 
 Post subject: Re: NBCD - n flag
PostPosted: Sun Feb 24, 2013 9:55 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
We should never use an undefined flag. The behavior of the flag could vary between manufacturers or CPU type. Use a different instruction that sets the condition flag following the NBCD.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: NBCD - n flag
PostPosted: Mon Feb 25, 2013 6:37 pm 
Offline

Joined: Sun Feb 17, 2013 7:16 pm
Posts: 10
profkelly wrote:
We should never use an undefined flag.

agreed.

Not emulating undefined flag behavior can be a problem for emulators, because of bad programmed software which relies on the values for following instructions.
Sure, most unlikely.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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