1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00
Commit Graph

104 Commits

Author SHA1 Message Date
Rob Pike
fdeee3a538 [dev.cc] cmd/asm: the assembler proper
Add main.go, the simple driver for the assembler, and the
subdirectory internal/asm, which contains the parser and
instruction generator.

It's likely that much of the implementation is superstition,
or at best experimental phenomenology, but it does generate
working binaries.

Change-Id: I322a9ae8a20174b6693153f30e39217ba68f8032
Reviewed-on: https://go-review.googlesource.com/3196
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-23 04:54:05 +00:00
Rob Pike
8642639575 [dev.cc] cmd/asm: add lex internal package
Add the lexing code for the new portable assembler.
It is internal to the assembler, so lives in a subdirectory of cmd/asm/internal.

Its only new dependency is the flags package for the assembler, so
add that too; it's trivial. That package manages the command-line
flags in a central place.

The lexer builds on text/scanner to lex the input, including doing a
Plan 9-level implementation of the C preprocessor.

Change-Id: I262e8717b8c797010afaa5051920839906c0dd19
Reviewed-on: https://go-review.googlesource.com/3195
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-23 04:24:57 +00:00
Rob Pike
40eb0ed0d8 [dev.cc] cmd/asm: add addr package
This simple package holds the definition of the Addr (address) type
that represents addresses inside the assembler.

It has no dependencies.

Change-Id: I7573fd70f1847ef68e3d6b663dc4c39eb2ebf8b3
Reviewed-on: https://go-review.googlesource.com/3193
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-23 03:30:37 +00:00
Rob Pike
6017f68029 [dev.cc] cmd/asm: add arch package
This package builds the representation of the machine architecture
for the new assembler.

Almost nothing in it is likely to last but this will get things running.

Change-Id: I8edd891f927a81f76d2dbdcd7484b9c87ac0fb2e
Reviewed-on: https://go-review.googlesource.com/3194
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-23 03:18:55 +00:00