It is currently Sat Dec 07, 2019 3:20 pm

 All times are UTC

 Page 1 of 1 [ 1 post ]
Author Message
 Post subject: Character constants in EASy68K AssemblerPosted: Fri Dec 17, 2004 9:35 pm

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

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 2 guests

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

Search for:
 Jump to:  Select a forum ------------------ EASy68K Forum    FAQ    Latest Features    EASy68K Questions    68000 Programming Questions    Wish List    Wishes Granted    Undocumented Features    Documented Features    General Discussion    EASy68K Projects