Solved

.equ Statements with GNU Assembler

Posted on 2006-11-14
3
1,913 Views
Last Modified: 2008-01-09
    I'm using GAWK to automate the conversion of lots of assembly language source files written for the Phar386 assembler to they can be recompiled with the GNU assembler.  So far, things are generally going fine!
     I have three statements that have been encountered that I'm researching how to convert from Phar386 to GNU:

ml_variable_scrn  EQU      "000,000,192,240"       ;these are the Phar386 versions
ml_adv_msg_scrn   EQU      "000,240,192,016"
ml_fixed_scrn     EQU      "000,256,192,064"

.equ      ml_variable_scrn,"000,000,192,240"     ;these are the same lines after the automated tool conversion
.equ      ml_adv_msg_scrn,"000,240,192,016"           
.equ      ml_fixed_scrn,"000,256,192,064"       

When the second set of lines are compiled using the GNU Assembler, each of the three lines produces these two warnings:
     "Error: bad expression"
     "Error: junk at end of line, first unrecognized character is '0'

How to convert the first set of three lines so that will peform correctly when compiled with the GNU Assembler?

Quick and good answers are needed and will be highly appreciated!
How can the
0
Comment
Question by:apx_31088
  • 2
3 Comments
 
LVL 11

Expert Comment

by:dimitry
ID: 17947531
I think this is because of "string"...
I would suggest to use next trick:
1) Rename your file from myfile.s to myfile.S
2) Change lines to
#define ml_variable_scrn    "000,000,192,240"
#define ml_adv_msg_scrn  "000,240,192,016"          
#define ml_fixed_scrn        "000,256,192,064"
3) Compile myfile.S with gcc, so gcc will take care of #define stuff...

If it will not work then you'll need to show us how these defines are used in code so we will help you to convert it to gnu assembler.
0
 

Author Comment

by:apx_31088
ID: 17958109
dimitry,

     These three .equ statements are part of an assembly language file that contains nothing but about 300 .equ statements.  These three statements are the only .equ statements that contain data within quotations ("000,000,192,240", etc).  The rest of the .equ statements are in the form:

.equ      ml_sline_24,131
.equ      ml_sline_25,123
.equ      ml_sline_26,115

     A coworker had earlier mentioned mentioned using gcc to pre-process the literal string assignments in the manner that you'd written about.  What is an example of an assembly source file that contains both the #define statements and also contains assembly language statements?  What are the steps needed to process that assembly source file so that it is processed by both gcc and as?
0
 
LVL 11

Accepted Solution

by:
dimitry earned 500 total points
ID: 17958481
I've already written that you need to rename myfile.s to myfile.S
And just use gcc instead of as. as flags you can pass by -Wa,special_as_flags.
The only problem you can face is other .equ will not be accepted by gcc. Then use #define...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to implement a communication protocol 8 521
How to Replace 2003 failover Cluster node 4 355
Bomb lab phase_5 1 1,355
how to solve the error 1935: 1 685
There is no doubt that cloud is gaining importance. Many of you must have read about this technology and its growing importance. More and more organisations are embracing this technology not forgetting start-ups. The process begins by dipping …
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now