[dev.cc] cmd/asm: final fixups for correct assembly of runtime, the last package to verify

- obj: add a missing setting of the context for a generated JMP instruction
- asm:  correct the encoding of mode (R)(R*scale)
- asm: fix a silly bug in the test for macro recursion.
- asm: accept address mode sym(R)(R*8); was an oversight

Change-Id: I27112eaaa1faa0d2ba97e414f0571b70733ea087
Reviewed-on: https://go-review.googlesource.com/4502
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Rob Pike 2015-02-10 17:11:36 -08:00
parent b6fd455c0d
commit e59ed477c3
5 changed files with 60 additions and 37 deletions

View file

@ -93,9 +93,9 @@ func (in *Input) Next() ScanToken {
in.text = in.peekText
return tok
}
// If we cannot generate a token after 100 tries, we're in trouble.
// If we cannot generate a token after 100 macro invocations, we're in trouble.
// The usual case is caught by Push, below, but be safe.
for i := 0; i < 100; i++ {
for nesting := 0; nesting < 100; {
tok := in.Stack.Next()
switch tok {
case '#':
@ -108,6 +108,7 @@ func (in *Input) Next() ScanToken {
name := in.Stack.Text()
macro := in.macros[name]
if macro != nil {
nesting++
in.invokeMacro(macro)
continue
}