To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 1062
1061  |  1063
Subject: 
(no subject)
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Fri, 28 Jun 1996 16:00:32 GMT
Original-From: 
System User <lylehaze@n*nospam*-jcenter.com>
Reply-To: 
Lyle Hazelwood <lylehaze@n-&antispam&jcenter.com>
Viewed: 
1588 times
  
Jeff Keyser wrote:
I'm trying to figure out what the BCLR line does.  Why does it clear
the bits of all the timers _except_ the one it's using?  I would think that
BSET TFLG1,X %00000010 would be more appropriate for the task.  Anyone know
how this works

I found this entry in the HC11 handbook, page 10-14. It may help..

"The most common way of clearing a status flag bit in the timer flag
registers is to load an accumulator with a mask that has a one in the bit(s)
corresponding to the flag(s) to be cleared; Then write this value to TFLG1
or TFLG2. The mask, which is supplied with the BCLR instruction, should
have zeros in the bit positions corresponding to the flags to be cleared
and ones in all other bits."

Sounds a bit confusing... Does a one bit or a zero bit clear the associated
flag?? The text goes on to explain...

"To clear the TOF flag, execute BCLR TFLG2 with a mask of %01111111. The
BCLR instruction will read TFLG2, AND it with the inverse of the supplied
mask (%10000000 in this case), and write the result back to TFLG2."
....snip snip......
"It is NOT appropriate to use the bit set (BSET) instruction to clear flags
in the timer flag registers because this could inadvertently clear one or
more of the other flags in the register."...


Lyle Hazelwood (lylehaze@n-jcenter.com)



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR