started up asm

This commit is contained in:
aljazbrodar. 2025-12-18 13:49:58 +01:00
parent ef273790b8
commit acce30cea1
45 changed files with 1167 additions and 728 deletions

View file

@ -0,0 +1,7 @@
package code
type program struct {
name string
instruction_list
lc uint32
}

View file

@ -0,0 +1,11 @@
package comment
type Comment struct {
value string
}
func newComment(val string) Comment {
return Comment {
value: val
}
}

View file

View file

@ -0,0 +1,8 @@
package instruction
type Instruction interface {
newInstruction() Instruction
}
func newInstruction() {}

View file

@ -0,0 +1,11 @@
package instructionF1
type InstructionF1 struct {
opcode uint8
}
func newInstructionF1(opcode uint8) InstructionF1 {
return InstructionF1 {
opcode: opcode
}
}

View file

@ -0,0 +1,7 @@
package instructionF2
type InstructionF2 struct {
opcode uint8
r1 uint8
r2 uint8
}

View file

@ -0,0 +1,25 @@
package instructionF3
type InstructionF3 struct {
opcode uint8
n bool
i bool
x bool
b bool
p bool
e bool
offset uint16
}
func newInstructionF3(opcode uint8, n bool, i bool, x bool, b bool, p bool, e bool, offset uint16) InstructionF3 {
return InstructionF3{
opcode: opcode,
n: n,
i: i,
x: x,
b: b,
p: p,
e: e,
offset: offset
}
}

View file

@ -0,0 +1,25 @@
package instructionF4
type InstructionF4 struct {
opcode uint8,
n bool,
i bool,
x bool,
b bool,
p bool,
e bool,
offset uint32
}
func newInstructionF4(opcode uint8, n bool, i bool, x bool, b bool, p bool, e bool, offset uint32) InstructionF4 {
return InstructionF4{
opcode: opcode,
n: n,
i: i,
x: x,
b: b,
p: p,
e: e,
offset: offset
}
}

View file

@ -0,0 +1,26 @@
package instructionSIC
type InstructionSIC struct {
opcode uint8
n bool
i bool
x bool
b bool
p bool
e bool
offset uint16
}
func newInstructionSIC(opcode uint8, n bool, i bool, x bool, b bool, p bool, e bool, offset uint16) InstructionSIC {
return InstructionSIC{
opcode: opcode,
n: n,
i: i,
x: x,
b: b,
p: p,
e: e,
offset: offset
}
}

View file

3
ass3/zbirnik/go.mod Normal file
View file

@ -0,0 +1,3 @@
module zbirnik
go 1.25.2