Solved

.equ Statements with GNU Assembler

Posted on 2006-11-14
3
1,910 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

8 Experts available now in Live!

Get 1:1 Help Now