Improved tokenizer
This commit is contained in:
parent
5c12992fca
commit
c4b28fb66e
10 changed files with 57 additions and 53 deletions
|
@ -22,7 +22,7 @@ func New() *Assembler {
|
|||
}
|
||||
|
||||
// Finalize generates the final machine code.
|
||||
func (a *Assembler) Finalize(verbose bool) ([]byte, []byte) {
|
||||
func (a *Assembler) Finalize() ([]byte, []byte) {
|
||||
code := make([]byte, 0, len(a.Instructions)*8)
|
||||
data := make(Data, 0, 16)
|
||||
pointers := []Pointer{}
|
||||
|
@ -45,7 +45,7 @@ func (a *Assembler) Finalize(verbose bool) ([]byte, []byte) {
|
|||
}
|
||||
}
|
||||
|
||||
if verbose {
|
||||
if config.Verbose {
|
||||
for _, x := range a.Instructions {
|
||||
log.Info.Println(x.String())
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ func TestHello(t *testing.T) {
|
|||
a.MoveRegisterNumber(register.Syscall1, 0)
|
||||
a.Syscall()
|
||||
|
||||
code, data := a.Finalize(false)
|
||||
code, data := a.Finalize()
|
||||
|
||||
assert.DeepEqual(t, code, []byte{
|
||||
0xb8, 0x01, 0x00, 0x00, 0x00,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue