Solved

.equ Statements with GNU Assembler

Posted on 2006-11-14
3
1,930 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
Choosing a core focus or particular set of features and options can be tough. To help out, we’re going to highlight a handful of things your business needs on one of your social media pages. In other words, if one of these is missing, you should imp…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

622 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