Solved

.equ Statements with GNU Assembler

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Binary bomb phase 3 10 2,063
FSM's, Flow Charts or Something else 5 371
C++ bitwise shift issue 12 621
writing Bios 6 450
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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