projects
/
b43-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fwcutter: Print the ID in the --identify output
[b43-tools.git]
/
assembler
/
parser.y
diff --git
a/assembler/parser.y
b/assembler/parser.y
index f00b2da4dec31266d2e64b6e6599514525ace4e8..c589195369c2ce536afecff77a8a460031238326 100644
(file)
--- a/
assembler/parser.y
+++ b/
assembler/parser.y
@@
-75,6
+75,7
@@
line : line_terminator {
/* Allow terminating lines with the "|" char */
line_terminator : /* Nothing */
| BITW_OR line_terminator
/* Allow terminating lines with the "|" char */
line_terminator : /* Nothing */
| BITW_OR line_terminator
+ ;
section_switch : SECTION_TEXT {
section = SECTION_TEXT;
section_switch : SECTION_TEXT {
section = SECTION_TEXT;
@@
-1083,27
+1084,26
@@
reg : GPR regnr {
}
;
}
;
-mem : BRACK_OPEN
hexnum_decnu
m BRACK_CLOSE {
+mem : BRACK_OPEN
im
m BRACK_CLOSE {
struct memory *mem = xmalloc(sizeof(struct memory));
struct memory *mem = xmalloc(sizeof(struct memory));
+ struct immediate *offset_imm = $2;
mem->type = MEM_DIRECT;
mem->type = MEM_DIRECT;
- mem->offset = (unsigned long)$2;
+ mem->offset = offset_imm->imm;
+ free(offset_imm);
$$ = mem;
}
$$ = mem;
}
- | BRACK_OPEN
hexnum_decnu
m COMMA OFFR regnr BRACK_CLOSE {
+ | BRACK_OPEN
im
m COMMA OFFR regnr BRACK_CLOSE {
struct memory *mem = xmalloc(sizeof(struct memory));
struct memory *mem = xmalloc(sizeof(struct memory));
+ struct immediate *offset_imm = $2;
mem->type = MEM_INDIRECT;
mem->type = MEM_INDIRECT;
- mem->offset = (unsigned long)$2;
+ mem->offset = offset_imm->imm;
+ free(offset_imm);
mem->offr_nr = (unsigned long)$5;
$$ = mem;
}
;
mem->offr_nr = (unsigned long)$5;
$$ = mem;
}
;
-imm : hexnum {
- struct immediate *imm = xmalloc(sizeof(struct immediate));
- imm->imm = (unsigned long)$1;
- $$ = imm;
- }
- | decnum {
+imm : hexnum_decnum {
struct immediate *imm = xmalloc(sizeof(struct immediate));
imm->imm = (unsigned long)$1;
$$ = imm;
struct immediate *imm = xmalloc(sizeof(struct immediate));
imm->imm = (unsigned long)$1;
$$ = imm;