EASy68K  
It is currently Mon Dec 09, 2019 8:54 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: help with using EQU
PostPosted: Wed Oct 01, 2008 1:22 pm 
Offline

Joined: Wed Oct 01, 2008 1:17 pm
Posts: 2
Location: Australia
ok, probably a stupid question, but i cant seem to get EQU to work in my code. or DS or SET for that matter.
i just have it in my code like this:
Code:
      Addr    EQU    $10000 
        WHEEL   EQU    $FFFF     
START   ORG     $1000


       
        MOVE.W  #$100,A2                *sets wheel motion
        MOVE.W  #$108,A3
        MOVE.B  #$7,(A2)+
        MOVE.B  #$5,(A2)+
        MOVE.B  #$D,(A2)+
        MOVE.B  #$9,(A2)+
        MOVE.B  #$B,(A2)+
        MOVE.B  #$A,(A2)+
        MOVE.B  #$E,(A2)+
        MOVE.B  #$6,(A2)+


                   
        MOVE.L  ADDR,A1             *Loads the instruction into D0
MLOOP   MOVE.W  (A1)+,D0                *begins main loop
etc, etc

and when i go to complile it it says "error, invalid opcode".

any ideas??

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2008 1:42 pm 
Offline

Joined: Wed Oct 01, 2008 1:17 pm
Posts: 2
Location: Australia
ok, dont worry, figured it out. no spaces before the label... how annoying :x


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2008 3:01 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1109
Spaces may be in front of a label if the label ends with a colon ':'. The colon does not become part of the label.

Code:
label1  equ     01
    label2:  equ    02

        move   #label1,d0
        move   #label2,d1


The colon is necessary for the assembler to distinguish the label from an opcode or macro call.

_________________
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:  
Powered by phpBB® Forum Software © phpBB Group