bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

m68k/MRI XDEF Problem


From: Smith, Gene
Subject: m68k/MRI XDEF Problem
Date: Thu, 29 Aug 2002 17:36:05 -0400

Within this random code (simp.asm below) the symbol LOGICAL is exported with
XDEF.  However, the routine LOGICAL is also called within this same file via
BSR.S opcodes. When assembled, a "BSR.S LOGICAL" fails with the following
message: 

simp.asm.s:93: Error:value of -130 too large for field of 1 bytes at 129

If the XDEF is removed the failure goes away. Or, if some code ahead of
the "BSR.S LOGICAL" is removed (e.g., remove the line labeled "deleteMe") the
error goes away. Also, when the code is shortend, the listing indicates that
the BSR.S 8bit offset is zero when it should be a small number (perhaps the
linker fills it in?). If XDEF is removed, the proper offset appears in the BSR.S
opcode per the listing. The position of the XDEF in the file does not seem to
make a difference. However, the BSR.S calls seem to need to be within 128 bytes
of the start of the file when referencing a XDEF'd symbol in the same file.

I assemble the file with this command line:
m68k-rtems-as --mri -alm  simp.asm

         XDEF    LOGICAL        ; simp.asm line 1
         SECTION SCT_CODE     
*
NN1      MOVE.L  A6,A2        
         BRA.S   FWSCAN
*
*
REVLOOP  
         SNE     D3
         BCC.S   NBOUT
BKLOOP0  MOVE.L  A6,A2        

*
*                             
*
BKLOOP   CMPA.L  A6,A4        

BKL1     
         BEQ.S   BK_NOUT      
         BRA.S   FWSCAN       

BK_NOUT  MOVE.W  D2,D3        
         BRA.S   BKLOOP
*
NBOUT    MOVE.L  A0,A2        
*
FWSCAN   MOVEA.L A2,A6        
         CMPA.L  A3,A6        
         BEQ.S   NO_UNC
*                              
         LEA     -2(A0),A1    
         BSR     PUTTBL       
         BRA.S   FWSCAN       
*
*
NO_UNC   
FINDNET  MOVE.L  A0,A4        
         BSR     GOP_NXT      
         CMPA.L  A3,A6        
         BEQ.S   PART         
         BRA.S   FN0

NOTFINI  BSR     UNCOND       
FN0      LEA     -2(A6),A1    
*
FN1      
*
FN2      TST.B   D2           
         BNE.S   NOTFND       
         TST.B   D3           
         BEQ.S   NOTFND       
*                             
         LEA     -2(A6),A1    
         BSR     PUTTBL       
deleteMe MOVEA.L A4,A2        
         BRA.    FWSCAN       
*
NOTFND   MOVE    D2,D3        
         BRA.S   FINDNET      
*
*
PART     LEA.L   -2(A3),A1
         BSR     PUTTBL       
         MOVEQ.L #-1,D0       
*
* NORMAL EXIT
*                
EXIT     MOVE.B  D5,NETNUM    
         
         RTS     !
         PAGE
*-------------------------------------------------------------------------------
* LOGICAL
*-------------------------------------------------------------------------------
         SECTION  SCT_CODE            
LOGICAL  SUB.L    L_CODE,D6           
         LSR.L    #1,D6               
         CMPI.L   #32767,D6           
         BLS.S    bENDIF02            
         BSET     #31,D6              
bENDIF02 EQU      *                   
         RTS      !                   
*                                     
*-------------------------------------------------------------------------------
*          CALLING SEQUENCE:
*
*-------------------------------------------------------------------------------
         SECTION  SCT_CODE            
PUTTBL   MOVE.L   A2,D6               
         BSR.S    LOGICAL             
         MOVE.L   D6,(A5)             
         MOVE.L   A1,D6               
         BSR.S    LOGICAL             
         MOVE.L   D6,NETBLEN(A5)      
         ADDQ.L   #4,A5               
         ADDQ.L   #1,D5               
         RTS      !                   
*                                     
         PAGE
         END            ; simp.asm last line




reply via email to

[Prev in Thread] Current Thread [Next in Thread]