Path: news.uiowa.edu!chi-news.cic.net!uwm.edu!news.cse.psu.edu!news.math.psu.edu!scramble.lm.com!godot.cc.duq.edu!newsgate.duke.edu!news.mathworks.com!news.kei.com!nntp.coast.net!howland.reston.ans.net!newsfeed.internetmci.com!in2.uu.net!netnews.jhuapl.edu!jensens-mac.jhuapl.edu!bob_jensen From: Robert Jensen Newsgroups: comp.sys.apple2.programmer Subject: Re: Help with 65C02 instructions Date: 12 Jun 1996 13:20:03 GMT Organization: JHU/APL Lines: 53 Distribution: world Message-ID: <4pmg63$qtf@aplinfo.jhuapl.edu> References: <1996Jun12.000759.1@scvax2.shepherd.wvnet.edu> <4plsq0$sfn@blackice.winternet.com> NNTP-Posting-Host: jensens-mac.jhuapl.edu X-UserAgent: Version 1.1.3 X-XXMessage-ID: X-XXDate: Wed, 12 Jun 96 13:20:42 GMT In article <4plmkg$hou@tuba.cit.cornell.edu> Jay Krell, jmk3@crux4.cit.cornell.edu writes: >> Quick answer: they're a read-modify-write between the accumulator and >>memory. They are roughly (*) equivalent in this manner: > >>lda addr lda #$80 >>ora #$80 <--> tsb addr >>sta addr > >>lda addr lda #$7F >>and #$7F <--> tsb addr >>sta addr > >I think that's actually more like > lda addr lda #$80 > and #~$80 trb addr > sta addr > I would say that you are both right, and both wrong. The code lda #$80 tsb addr would translate to lda addr and #$80 ;test the bit php ;save the zero flag lda addr ora #$80 ;set the bit sta addr plp ;recover the zero flag and similarly lda #$80 trb addr would translate to lda addr and #$80 ;test the bit php ;save the zero flag lda addr and #$7f ;reset the bit sta addr plp ;recover the zero flag ========================================================= Bob Jensen bob_jensen@jhuapl.edu