EASy68K  
It is currently Tue Oct 16, 2018 7:19 pm

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: drive zero flag commands
PostPosted: Mon Mar 21, 2011 1:09 am 
Offline

Joined: Sun Mar 06, 2011 2:54 am
Posts: 15
Location: Malaysia
how to set/clear z flag commands between two different input signals of comparator?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 21, 2011 1:38 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1083
The condition code register may be directly manipulated with:

Code:
    ANDI    #n,CCR  ; logical AND #n to CCR
    EORI    #n,CCR  ; logical exclusive OR #n to CCR
    MOVE    s,CCR   ; move source to CCR
    ORI     #n,CCR  ; logical OR #n to CCR

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Mon Mar 21, 2011 3:19 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
salim wrote:
how to set/clear z flag commands between two different input signals of comparator?


Your question doesn't make a lot of sense. Provide some code to give it some context.

If you operate on a register the Z flag will reflect the content of the register at the end of the operation. Refer to your instruction set documentation to see which instructions effect the flags and how.

Code:
or.l d0,d0 ; cmp.l #0,d0
beq d0waszero
bne d0wasnonzero


Top
 Profile  
 
 Post subject: drive zero flag commands
PostPosted: Mon Mar 21, 2011 11:08 pm 
Offline

Joined: Sun Mar 06, 2011 2:54 am
Posts: 15
Location: Malaysia
The comparator compare two input signals to give one output signal :
Vdac and Vtemp and gives one output High ot Low.

the question is how to test comparator output state in order to set/reset z flag?

Vdac is the positive signal and Vtepm is the nagetive signal.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 22, 2011 1:56 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1083
Is the comparator a hardware comparator? If so, how is it mapped into the 68000 address space?

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: comarator
PostPosted: Tue Mar 22, 2011 2:27 am 
Offline

Joined: Sun Mar 06, 2011 2:54 am
Posts: 15
Location: Malaysia
yes.the comparator hardware comparator in 68000.
is comparing 2 signals .one from DAC converter and another from temperature sensor.[/img][/b]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 22, 2011 1:20 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
Assuming 16-bit, because your specification is so weak.
Code:
   MOVE.W  Vdac,D0
   MOVE.W  Vtemp,D1
   NEG.W   D1
   CMP.W   D0,D1 ; Flags set based on relationship of Vdac to -Vtemp


Top
 Profile  
 
 Post subject: set/reset z flag
PostPosted: Tue Mar 22, 2011 3:16 pm 
Offline

Joined: Sun Mar 06, 2011 2:54 am
Posts: 15
Location: Malaysia
i think is not MOVE commands. it is about BTST.Z commands,but i dont know how to state it in this condition.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 22, 2011 3:43 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1083
What is the part number of the comparator?

How is it wired into the 68000 circuit?

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: set/reset z flag
PostPosted: Tue Mar 22, 2011 5:16 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
salim wrote:
i think is not MOVE commands. it is about BTST.Z commands,but i dont know how to state it in this condition.

And we're left to guess, because the 68000 does not contain an analogue comparator.

Perhaps you should define the circuit or board you are using. Provide part numbers or schematics for the design. The address at which the comparator resides within the 68000's memory space. The bit within that address the comparator uses.

Assume we know nothing about your board or problem beyond what you have described. We are not taking your course, and not familiar with the board being used.

http://68k.hax.com/BTST

Assuming bit 7 @ Address $123456

BTST #7,$123456


Top
 Profile  
 
 Post subject: set/reset z flag
PostPosted: Wed Mar 23, 2011 1:12 am 
Offline

Joined: Sun Mar 06, 2011 2:54 am
Posts: 15
Location: Malaysia
kelly, clive...

can some one give me his email to post my circuit diagram?
i dont know how to attach it here!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2011 8:10 am 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
Sent you a PM (Private Message) with addresses.
http://www.easy68k.com/EASy68Kforum/pri ... lder=inbox


Top
 Profile  
 
 Post subject: Schematic
PostPosted: Wed Mar 23, 2011 4:46 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1083
The schematic as sent to me in a Word document.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2011 5:42 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
So the comparator output bit is at Bit 8 of the word at $Fxy700 ?
Where the x & y are defined by the state of the DSW1 switches.
All OFF then $FFF700, All ON then $F00700

Does this jive with your documentation for the board?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 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