[Color Computer] [Coco] 6809 Test and Set instruction?
James Diffendaffer
jdiffendaffer at yahoo.com
Tue Jul 11 01:04:33 EDT 2006
I think he was asking if the 6809 has an instruction similar to the
680x0 test-and-set instruction.
That is, one instruction that tests the state of a bit and sets it.
The condition code register would let you know the previous state.
This prevents an interrupt or task switch from changing the bit
between the time you test it and setting it so that you can restore
the proper state later without screwing it up for another task.
I believe the answer is no but you can imitate the behavior by
disabling interrupts, execute the separate test and set operations and
then enable interrupts.
Yeah, it's no 68K but it's no 6502 either.
>Rumor has it that Allen Huffman may have mentioned these words:
>>Does the 6809 have a test and set instruction?
>
>Assuming I understand your question, yes.
>
>TST
>TSTA, opcode 4D
>TSTB, " 5D
>
>The memory TST instruction works with these addressing modes:
>
>Direct: opcode 0D
>Extended: " 7D
>Indexed/Indirect: 6D
>
>HTH!
>Roger "Merch" Merchberger
Brought to you by the 6809, the 6803 and their cousins!
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ColorComputer/
<*> To unsubscribe from this group, send an email to:
ColorComputer-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the Coco
mailing list