EASy68K  
It is currently Sun Nov 19, 2017 8:32 am

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
PostPosted: Fri Dec 17, 2004 9:35 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1049
The following code gives examples of how character constants are currently handled.

Code:
001000           3100 DC.W  '1'              creates a char constant word aligned
001002           0032 DC.W  '1'+1            creates a numeric constant
001004             32 DC.B  '1'+1

001005             B5 DC.B  '12345'+128      trying to set MSb of last character
ERROR 017: IMMEDIATE data exceeds 8 bits

001006 31 32 33 34 B5 DC.B   '1234','5'+128  this method works

00100C           3133 DC.W   '12'+1
00100E       31000000 DC.L   '1'
001012       00000032 DC.L   '1'+1
001016       00003133 DC.L   '12'+1

00101A       31323301 DC.L   '123'+1
00101E       31323335 DC.L   '1234'+1


001022      103C 0061 MOVE.B #'a',D0
001026      103C 0062 MOVE.B #'a'+1,D0
00102A      303C 0061 MOVE.W #'a',D0
00102E      303C 0062 MOVE.W #'a'+1,D0
001032           7061 MOVE.L #'a',D0
001034           7062 MOVE.L #'a'+1,D0
001036      303C 6162 MOVE.W #'ab',D0
00103A      303C 6163 MOVE.W #'ab'+1,D0
00103E  203C 00006162 MOVE.L #'ab',D0      character constants appear to be treated as numeric constants

001044  203C 00006163 MOVE.L #'ab'+1,D0
00104A  203C 61626364 MOVE.L #'abcd',D0
001050  203C 61626365 MOVE.L #'abcd'+1,D0
00104E  203C 61626300 MOVE.L #'abc',D0
001054  203C 61626301 MOVE.L #'abc'+1,D0   this is different

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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