EASy68K  
It is currently Sat Dec 16, 2017 10:49 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Sep 17, 2017 6:42 pm 
Offline

Joined: Fri Apr 25, 2014 5:59 pm
Posts: 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


Top
 Profile  
 
PostPosted: Sun Sep 17, 2017 9:49 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
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

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Tue Sep 19, 2017 12:12 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1056
68000 programming tips including performance considerations.
http://www.easy68k.com/paulrsm/doc/trick68k.htm

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group