From 7e693edc26712b0b03e98aef63ef7d5b90a07dbc Mon Sep 17 00:00:00 2001 From: Mark Ferry Date: Thu, 21 Sep 2017 16:57:55 +0100 Subject: [PATCH 1/3] asm: Add .equiv define --- parsers/asm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parsers/asm.c b/parsers/asm.c index 8c06d7c3fb..c47ca0f84d 100644 --- a/parsers/asm.c +++ b/parsers/asm.c @@ -43,6 +43,7 @@ typedef enum { OP_ENDP, OP_ENDS, OP_EQU, + OP_EQUIV, OP_EQUAL, OP_LABEL, OP_MACRO, @@ -90,6 +91,7 @@ static const keywordTable AsmKeywords [] = { { "endp", OP_ENDP }, { "ends", OP_ENDS }, { "equ", OP_EQU }, + { "equiv", OP_EQUIV }, { "label", OP_LABEL }, { "macro", OP_MACRO }, { ":=", OP_COLON_EQUAL }, @@ -115,6 +117,7 @@ static const opKind OpKinds [] = { { OP_ENDP, K_NONE }, { OP_ENDS, K_NONE }, { OP_EQU, K_DEFINE }, + { OP_EQUIV, K_DEFINE }, { OP_EQUAL, K_DEFINE }, { OP_LABEL, K_LABEL }, { OP_MACRO, K_MACRO }, From 26ea56de49eb5d2ac3d0c21f6382e493605b8387 Mon Sep 17 00:00:00 2001 From: Mark Ferry Date: Mon, 25 Sep 2017 23:23:35 +0100 Subject: [PATCH 2/3] Asm, Units: gas: test .equ, .equiv, .eqv --- Units/parser-asm.r/gas.s.d/expected.tags | 3 +++ Units/parser-asm.r/gas.s.d/input.s | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Units/parser-asm.r/gas.s.d/expected.tags b/Units/parser-asm.r/gas.s.d/expected.tags index 257838af48..00d3a8a086 100644 --- a/Units/parser-asm.r/gas.s.d/expected.tags +++ b/Units/parser-asm.r/gas.s.d/expected.tags @@ -1,3 +1,6 @@ X input.s /^#define X /;" d line:7 file: end:7 +_EQU input.s /^.equ _EQU equ1$/;" d line:14 +_EQUIV input.s /^.equiv _EQUIV equiv2$/;" d line:15 +_EQV input.s /^.eqv _EQV eqv3$/;" d line:16 altsum input.s /^.macro altsum from=0, to=6$/;" m line:8 end:13 sum input.s /^.macro sum from=0, to=5$/;" m line:1 end:6 diff --git a/Units/parser-asm.r/gas.s.d/input.s b/Units/parser-asm.r/gas.s.d/input.s index 1e974b0794..d5be3f03d0 100644 --- a/Units/parser-asm.r/gas.s.d/input.s +++ b/Units/parser-asm.r/gas.s.d/input.s @@ -11,3 +11,6 @@ sum "(\from+1)",\to .endif .endm +.equ _EQU equ1 +.equiv _EQUIV equiv2 +.eqv _EQV eqv3 From 0e2e8f4db6baa014ebeb17067efea049499249b8 Mon Sep 17 00:00:00 2001 From: Mark Ferry Date: Mon, 25 Sep 2017 23:52:39 +0100 Subject: [PATCH 3/3] asm: Add .eqv define. Treat .equ, .equiv, .eqv as OP_EQU GNU AS documentation of the directives: .equiv: https://sourceware.org/binutils/docs/as/Equiv.html#Equiv .eqv: https://sourceware.org/binutils/docs/as/Eqv.html#Eqv Units: gas.s --- parsers/asm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/parsers/asm.c b/parsers/asm.c index c47ca0f84d..3c28e83e2d 100644 --- a/parsers/asm.c +++ b/parsers/asm.c @@ -43,7 +43,6 @@ typedef enum { OP_ENDP, OP_ENDS, OP_EQU, - OP_EQUIV, OP_EQUAL, OP_LABEL, OP_MACRO, @@ -91,7 +90,6 @@ static const keywordTable AsmKeywords [] = { { "endp", OP_ENDP }, { "ends", OP_ENDS }, { "equ", OP_EQU }, - { "equiv", OP_EQUIV }, { "label", OP_LABEL }, { "macro", OP_MACRO }, { ":=", OP_COLON_EQUAL }, @@ -100,8 +98,10 @@ static const keywordTable AsmKeywords [] = { { "record", OP_RECORD }, { "sections", OP_SECTIONS }, - /* This one is used in GNU as. */ + /* These are used in GNU as. */ { "section", OP_SECTION }, + { "equiv", OP_EQU }, + { "eqv", OP_EQU }, { "set", OP_SET }, { "struct", OP_STRUCT } @@ -117,7 +117,6 @@ static const opKind OpKinds [] = { { OP_ENDP, K_NONE }, { OP_ENDS, K_NONE }, { OP_EQU, K_DEFINE }, - { OP_EQUIV, K_DEFINE }, { OP_EQUAL, K_DEFINE }, { OP_LABEL, K_LABEL }, { OP_MACRO, K_MACRO },