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

How to toggle a memory location between 0 and 1?
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1600
Page 1 of 1

Author:  RichP4 [ Sun Sep 17, 2017 6:42 pm ]
Post subject:  How to toggle a memory location between 0 and 1?

I'm a beginner in 68000. Would be grateful if someone could tell me the best and fastest way to toggle a memory location between 0 and 1

Thanks

Author:  profkelly [ Sun Sep 17, 2017 9:49 pm ]
Post subject:  Re: How to toggle a memory location between 0 and 1?

The BCHG instruction will change the specified bit from 0 to 1 or 1 to 0 (toggle).

Code:
        ORG    $1000
START:                      ; first instruction of program
        bchg #0,var1        ; toggle bit 0 in var1

        SIMHALT             ; halt simulator

* Put variables and constants here
        ORG     $2000
var1    ds.b    1           ; 1 byte variable
        END    START        ; last line of source

Author:  profkelly [ Tue Sep 19, 2017 12:12 pm ]
Post subject:  Re: How to toggle a memory location between 0 and 1?

68000 programming tips including performance considerations.
http://www.easy68k.com/paulrsm/doc/trick68k.htm

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