Improved branch compilation

This commit is contained in:
Eduard Urbach 2024-07-07 21:55:32 +02:00
parent 871749101e
commit 13161f5021
Signed by: eduard
GPG key ID: 49226B848C78F6C8
9 changed files with 160 additions and 113 deletions

View file

@ -27,20 +27,20 @@ type counter struct {
// PrintInstructions shows the assembly instructions.
func (s *state) PrintInstructions() {
ansi.Dim.Println("╭────────────────────────────────────────────────╮")
ansi.Dim.Println("╭────────────────────────────────────────────────────╮")
for _, x := range s.assembler.Instructions {
ansi.Dim.Print("│ ")
switch x.Mnemonic {
case asm.LABEL:
ansi.Yellow.Printf("%-46s", x.Data.String()+":")
ansi.Yellow.Printf("%-50s", x.Data.String()+":")
case asm.COMMENT:
ansi.Dim.Printf("%-46s", x.Data.String())
ansi.Dim.Printf("%-50s", x.Data.String())
default:
ansi.Green.Printf("%-8s", x.Mnemonic.String())
ansi.Green.Printf("%-12s", x.Mnemonic.String())
if x.Data != nil {
fmt.Printf("%-38s", x.Data.String())
@ -52,5 +52,5 @@ func (s *state) PrintInstructions() {
ansi.Dim.Print(" │\n")
}
ansi.Dim.Println("╰────────────────────────────────────────────────╯")
ansi.Dim.Println("╰────────────────────────────────────────────────────╯")
}