EASy68K  
It is currently Tue May 21, 2013 11:41 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Handling data sizes
PostPosted: Wed Nov 19, 2008 12:31 pm 
Offline

Joined: Wed Nov 19, 2008 11:42 am
Posts: 3
Hallo,

as is tried to use the Version 4.00 or higher Easy68K produces an error where no error should be. Older versions work fine.


Code:
00000012  =00008000                247  fsbflock   equ     $8000
...
...
Line 4995 ERROR: Immediate data exceeds 16 bits
000F2398  026C 7FFF 0000          4995     andi.w  #~fsbflock,fsbfflag(a4)


"fsbflock" is defined as a 16bit Value. When i negate it anyway it remains still as a 16bit value. But it seems that Easy68K extents it to a 32bit value because the MSB is set. If i used any value where the MSB is not set in this case no error will orrure. Maybe there is a problem handling signed/unsigned values in Easy68K.

best regards
Gerald


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2008 12:56 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 823
Location: Monroe County Community College, Monroe Michigan, U.S.A.
The EQU directive does not have a size and can be considered long only. If you negate $8000 the result is $FFFF7FFF. This can be demonstrated by something like:
Code:
00001000  =00008000                  9  fsbblock        equ     $8000
00001000  =FFFF7FFF                 10  nfsbblock       equ     ~fsbblock

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2008 1:27 pm 
Offline

Joined: Wed Nov 19, 2008 11:42 am
Posts: 3
You are right but that does not solve the problem with the error message. The result of your explanation means that a value produced by an EQU directive is always 32bit and cannot be used in 8- or 16bit commands.
I add another code that demonstrates the problem:

Code:
00001000  =00004000                  9  fsbfdirty  equ     $4000
00001000  =FFFFBFFF                 10  nfsbfdirty equ     ~fsbfdirty
00001000                            11 
00001000  =00008000                 12  fsbflock   equ     $8000
00001000  =FFFF7FFF                 13  nfsbflock  equ     ~fsbflock
00001000                            14 
00001000  026C BFFF 0002            15   andi.w  #~fsbfdirty,2(a4)
Line 16 ERROR: Immediate data exceeds 16 bits
00001006  026C 7FFF 0002            16   andi.w  #~fsbflock,2(a4)


If Easy68K should produce a warning instead of an error in this case.

best regards
Gerald


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2008 11:41 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 823
Location: Monroe County Community College, Monroe Michigan, U.S.A.
The result of negating 00008000 is FFFF7FFF

The instruction

andi.w #~fsbflock,2(a4)

is equivalent to

andi.w #$FFFF7FFF,2(a4)

or

andi.w #-32769,2(a4)

-32769 is not a valid 16 bit number.

The error message that is reported is consistent with the behavior of other 68000 assemblers that I use for comparison purposes when testing EASy68K.

(Edit)
The following are the results obtained from the Quelo 68000 Assembler:
Code:
     # 00004000            22.  fsb     equ     $4000
     # FFFFBFFF            23.  nfsb    equ     ~fsb
                           24. 
     # 00008000            25.  fsb2    equ     $8000
     # FFFF7FFF            26.  nfsb2   equ     ~fsb2
                           27. 
00001020  026C BFFF 0002   28.          andi.w  #~fsb,2(a4)
>>>  ERROR  line[29] Word unsigned trunc.   [29] DATASIZE.A68
00001026  026C 7FFF 0002   29.          andi.w  #~fsb2,2(a4)


_________________
Prof. Kelly


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 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