EASy68K  
It is currently Mon Sep 23, 2019 12:03 pm

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Wed Apr 20, 2011 2:30 am 
Offline

Joined: Tue Apr 19, 2011 2:50 am
Posts: 7
Location: Malaysia
START: org $1000
move.l #$7ffe,sp ;init stack pointer
move.l data1,d2 ;get data1
add.l data2,d2 ;add data2
add.l data3,d2 ;add data3
move.l d2,result ;save result
move.b #9,d0 ;stop
trap #15 ; halt simulator

org $2500
dc.l 1 ;initialised = 1
dc.w 2 ;initialised = 2
dc.l 5 ;initialised = 5
ds.l 1 ;long word for
END START ; last line of source

i dont know why is it undefined symbol. help


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 20, 2011 11:51 am 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
You need to have labels on your data items. The assembler is not psychic


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2011 3:16 am 
Offline

Joined: Tue Apr 19, 2011 2:50 am
Posts: 7
Location: Malaysia
ohh okay.. so the data1 become data ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2011 12:25 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
You have to define them by name so the assembler knows what you are referencing.
Code:
org $2500
data1 dc.l 1 ;initialised = 1
data2 dc.w 2 ;initialised = 2
..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2011 2:38 pm 
Offline

Joined: Tue Apr 19, 2011 2:50 am
Posts: 7
Location: Malaysia
owhh thank youu clive=] but this is wat i got
org $2500
data1 dc.l 1 ;initialised = 1
data2 dc.w 2 ;initialised = 2
data3 dc.l 5 ;initialised = 5
ds.l 1 ;long word for
END START ; last line of source


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 21, 2011 2:58 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
Every thing you use a name to reference needs to be explicitly defined. The assembler does not know what data2, result, foobar10, etc are.

If you use MOVE.L and ADD.L, they'd better be LONG variables.
Code:
org $2500
data1 dc.l 123 ;initialised = 123
data2 dc.l 234 ;initialised = 234
data3 dc.l 567 ;initialised = 567
result ds.l 1 ;long word for result (should be computed as 924)
END START ; last line of source


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2011 4:17 am 
Offline

Joined: Tue Apr 19, 2011 2:50 am
Posts: 7
Location: Malaysia
clive wrote:
Every thing you use a name to reference needs to be explicitly defined. The assembler does not know what data2, result, foobar10, etc are.

If you use MOVE.L and ADD.L, they'd better be LONG variables.
Code:
org $2500
data1 dc.l 123 ;initialised = 123
data2 dc.l 234 ;initialised = 234
data3 dc.l 567 ;initialised = 567
result ds.l 1 ;long word for result (should be computed as 924)
END START ; last line of source


yeapp i used urs wayy but mine easy68k show is still error with this part. =\
org $2500
data1 dc.l 1 ;initialised = 1
data2 dc.l 2 ;initialised = 2
data3 dc.l 5 ;initialised = 5
result ds.l 1 ;long word for

END START ; last line of source


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2011 6:51 am 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
This is working for me, you'll need to be more specific. What error, where?
Code:
   org $1000
START:
   move.l #$7ffe,sp ;init stack pointer

   move.l data1,d2 ;get data1
   add.l data2,d2 ;add data2
   add.l data3,d2 ;add data3
   move.l d2,result ;save result

   move.b #9,d0 ;stop
   trap #15 ; halt simulator

   org $2500
data1   dc.l 1 ;initialised = 1
data2   dc.l 2 ;initialised = 2
data3   dc.l 5 ;initialised = 5
result   ds.l 1 ;long word for

   END START ; last line of source


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2011 7:43 am 
Offline

Joined: Tue Apr 19, 2011 2:50 am
Posts: 7
Location: Malaysia
owhh i duno but in the red is undefined symbol in olive are invalid opcode. =| is it my easy68k got some problem ?

org $1000

move.l #$7ffe,sp ;init stack pointer
move.l data1,d2 ;get data1
add.l data2,d2 ;add data2
add.l data3,d2 ;add data3
move.l d2,result ;save result


move.b #9,d0 ;stop
trap #15 ; halt simulator

org $2500
data1 dc.l 1 ;initialised = 1
data2 dc.l 2 ;initialised = 2
data3 dc.l 5 ;initialised = 5
result ds.l 1 ;long word for


END START ; last line of source


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2011 8:05 am 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
Use "Code" Tags to post on the forum. The columns and spacing are important to the assembler. Are you sure it's not an "Invalid Syntax" error?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2011 12:12 pm 
Offline

Joined: Tue Apr 19, 2011 2:50 am
Posts: 7
Location: Malaysia
clive wrote:
Use "Code" Tags to post on the forum. The columns and spacing are important to the assembler. Are you sure it's not an "Invalid Syntax" error?



Code:
START:   org    $1000
    move.l      #$7ffe,sp    ;init stack pointer
   move.l     data1,d2    ;get data1
   add.l     data2,d2    ;add data2
   add.l    data3,d2    ;add data3
   move.l    d2,result   ;save result
   move.b   #9,d0   ;stop
   trap      #15      ; halt simulator
   
    org    $2500
    data1  dc.l 1    ;initialised = 1
   data2  dc.l 2    ;initialised = 2
   data3  dc.l 5    ;initialised = 5
   result  ds.l 1    ;long word for
   END   START   ; last line of source


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2011 3:23 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
See the earlier post http://www.easy68k.com/EASy68Kforum/vie ... =3142#3142

Note that the labels are in the *first* column. Copy and Paste that code into the editor.

The assembler expects the label,opcode,operand to be separate/distinguished by white space (space/tab)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2011 8:29 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1102
From EASy68K Help:
Quote:
A label normally begins in the first column of the line. It must be terminated with a space, tab or a colon. If a colon is used it does not become part of the label. If a label does not start in the first column it must be terminated with a colon.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 23, 2011 6:16 am 
Offline

Joined: Tue Apr 19, 2011 2:50 am
Posts: 7
Location: Malaysia
owhh got it ady :D :D thank you clive & profkelly =) with ur help my assignment will be done by time CHEERS


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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