diff options
Diffstat (limited to 'src/cmd/6a')
-rw-r--r-- | src/cmd/6a/Makefile | 23 | ||||
-rw-r--r-- | src/cmd/6a/a.h | 9 | ||||
-rw-r--r-- | src/cmd/6a/a.y | 14 | ||||
-rw-r--r-- | src/cmd/6a/lex.c | 10 |
4 files changed, 26 insertions, 30 deletions
diff --git a/src/cmd/6a/Makefile b/src/cmd/6a/Makefile index 21d824708..30180bd24 100644 --- a/src/cmd/6a/Makefile +++ b/src/cmd/6a/Makefile @@ -2,10 +2,10 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -include ../../Make.conf +include ../../Make.inc +O:=$(HOST_O) -TARG=\ - 6a\ +TARG=6a HFILES=\ a.h\ @@ -20,21 +20,6 @@ OFILES=\ YFILES=\ a.y\ -$(TARG): $(OFILES) - $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9 - -$(OFILES): $(HFILES) +include ../../Make.ccmd lex.$O: ../cc/macbody ../cc/lexbody - -y.tab.h: $(YFILES) - bison -y $(YFLAGS) $(YFILES) - -y.tab.c: y.tab.h - test -f y.tab.c && touch y.tab.c - -clean: - rm -f *.$O $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c - -install: $(TARG) - cp $(TARG) "$(GOBIN)"/$(TARG) diff --git a/src/cmd/6a/a.h b/src/cmd/6a/a.h index a713acc9f..9030081ca 100644 --- a/src/cmd/6a/a.h +++ b/src/cmd/6a/a.h @@ -1,7 +1,7 @@ // Inferno utils/6a/a.h // http://code.google.com/p/inferno-os/source/browse/utils/6a/a.h // -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) @@ -50,7 +50,7 @@ typedef struct Ref Ref; typedef struct Gen Gen; typedef struct Io Io; typedef struct Hist Hist; -typedef struct Gen2 Gen2; +typedef struct Gen2 Gen2; #define MAXALIGN 7 #define FPCHIP 1 @@ -161,6 +161,7 @@ EXTERN int pass; EXTERN char* pathname; EXTERN int32 pc; EXTERN int peekc; +EXTERN int32 stmtline; EXTERN int sym; EXTERN char* symb; EXTERN int thechar; @@ -168,9 +169,9 @@ EXTERN char* thestring; EXTERN int32 thunk; EXTERN Biobuf obuf; -void* alloc(int32); +void* alloc(int32); void* allocn(void*, int32, int32); -void ensuresymb(int32); +void ensuresymb(int32); void errorexit(void); void pushio(void); void newio(void); diff --git a/src/cmd/6a/a.y b/src/cmd/6a/a.y index 804f638a0..770f676fe 100644 --- a/src/cmd/6a/a.y +++ b/src/cmd/6a/a.y @@ -1,7 +1,7 @@ // Inferno utils/6a/a.y // http://code.google.com/p/inferno-os/source/browse/utils/6a/a.y // -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) @@ -60,7 +60,11 @@ %type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 spec9 %% prog: -| prog line +| prog + { + stmtline = lineno; + } + line line: LLAB ':' @@ -453,6 +457,12 @@ omem: $$.type = D_INDIR+D_SP; $$.offset = $1; } +| con '(' LSREG ')' + { + $$ = nullgen; + $$.type = D_INDIR+$3; + $$.offset = $1; + } | con '(' LLREG '*' con ')' { $$ = nullgen; diff --git a/src/cmd/6a/lex.c b/src/cmd/6a/lex.c index 81273b297..1b8bb6344 100644 --- a/src/cmd/6a/lex.c +++ b/src/cmd/6a/lex.c @@ -1,7 +1,7 @@ // Inferno utils/6a/lex.c // http://code.google.com/p/inferno-os/source/browse/utils/6a/lex.c // -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) @@ -1260,10 +1260,10 @@ jackpot: } Bputc(&obuf, a); Bputc(&obuf, a>>8); - Bputc(&obuf, lineno); - Bputc(&obuf, lineno>>8); - Bputc(&obuf, lineno>>16); - Bputc(&obuf, lineno>>24); + Bputc(&obuf, stmtline); + Bputc(&obuf, stmtline>>8); + Bputc(&obuf, stmtline>>16); + Bputc(&obuf, stmtline>>24); zaddr(&g2->from, sf); zaddr(&g2->to, st); |