Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.equ Statements with GNU Assembler

Posted on 2006-11-14
3
Medium Priority
?
1,956 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 1500 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

916 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