This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
GASP really obsolete?
- From: Frank Mehnert <fm3 at os dot inf dot tu-dresden dot de>
- To: binutils at sources dot redhat dot com
- Date: Tue, 11 Jun 2002 13:49:36 +0200
- Subject: GASP really obsolete?
- Organization: Dept. of CS, Dresden University of Technology
Hi,
yesterday I asked about labels in GAS which should contain a variable
numeric part (subject "Variable numeric labels in assembler macros").
Because I still not got an answer to that question, I want to motivate
the background of my question.
I have to maintain GAS assembler files which contain a lot of GASP
macros. The original author of these files wrote some macros to make
it easier to understand the assembler program. For instance, he was
able to write such code:
IFNZ variable_a, $0
call handle_case_a_not_null
ELSE
call handle_case_a_is_null
ENDIF
He implemented the IFNZ, ELSE and ENDIF using GASP macros:
icount .ASSIGNA 0
ival .ASSIGNA 0
MAXIF .REG (90)
.MACRO IFNZ val1, val2
icount .ASSIGNA \&icount+1
ival .ASSIGNA \&ival+1
cmpl \val1, \val2
jnz I\&icount
icount .ASSIGNA \&icount+1
.ENDM
.MACRO ELSE
x1 .ASSIGNA \&ival-(\&ival/MAXIF*MAXIF)
ival .ASSIGNA \&ival+1
x2 .ASSIGNA \&ival-(\&ival/MAXIF*MAXIF)
jmp I\&x2
I\&x1:
.ENDM
.MACRO ENDIF
x .ASSIGNA \&ival-(\&ival/MAXIF*MAXIF)
I\&x:
ival .ASSIGNA \&ival/MAXIF
.ENDM
I have to replace that code using features of GAS because the maintainer
of binutils deceided to drop GASP -- they claim that GAS includes all
features of GASP.
I have no idea how to translate these macros from GASP to GAS. The main
feature I miss is that I can't create labels containing variable numeric
parts.
Does anybody has an idea?
Frank
--
Frank Mehnert
## Dept. of Computer Science, Dresden University of Technology, Germany ##
## E-Mail: fm3@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/~fm3 ##