EASy68K
http://www.easy68k.com/EASy68Kforum/

drive zero flag commands
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=979
Page 1 of 1

Author:  salim [ Mon Mar 21, 2011 1:09 am ]
Post subject:  drive zero flag commands

how to set/clear z flag commands between two different input signals of comparator?

Author:  profkelly [ Mon Mar 21, 2011 1:38 pm ]
Post subject: 

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

Author:  clive [ Mon Mar 21, 2011 3:19 pm ]
Post subject:  Re: drive zero flag commands

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

Author:  salim [ Mon Mar 21, 2011 11:08 pm ]
Post subject:  drive zero flag commands

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.

Author:  profkelly [ Tue Mar 22, 2011 1:56 am ]
Post subject: 

Is the comparator a hardware comparator? If so, how is it mapped into the 68000 address space?

Author:  salim [ Tue Mar 22, 2011 2:27 am ]
Post subject:  comarator

yes.the comparator hardware comparator in 68000.
is comparing 2 signals .one from DAC converter and another from temperature sensor.[/img][/b]

Author:  clive [ Tue Mar 22, 2011 1:20 pm ]
Post subject: 

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

Author:  salim [ Tue Mar 22, 2011 3:16 pm ]
Post subject:  set/reset z flag

i think is not MOVE commands. it is about BTST.Z commands,but i dont know how to state it in this condition.

Author:  profkelly [ Tue Mar 22, 2011 3:43 pm ]
Post subject: 

What is the part number of the comparator?

How is it wired into the 68000 circuit?

Author:  clive [ Tue Mar 22, 2011 5:16 pm ]
Post subject:  Re: set/reset z flag

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

Author:  salim [ Wed Mar 23, 2011 1:12 am ]
Post subject:  set/reset z flag

kelly, clive...

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

Author:  clive [ Wed Mar 23, 2011 8:10 am ]
Post subject: 

Sent you a PM (Private Message) with addresses.
http://www.easy68k.com/EASy68Kforum/pri ... lder=inbox

Author:  profkelly [ Wed Mar 23, 2011 4:46 pm ]
Post subject:  Schematic

The schematic as sent to me in a Word document.

Author:  clive [ Wed Mar 23, 2011 5:42 pm ]
Post subject: 

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?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/