started up asm
This commit is contained in:
parent
ef273790b8
commit
acce30cea1
45 changed files with 1167 additions and 728 deletions
7
ass3/zbirnik/code/code.go
Normal file
7
ass3/zbirnik/code/code.go
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
package code
|
||||
|
||||
type program struct {
|
||||
name string
|
||||
instruction_list
|
||||
lc uint32
|
||||
}
|
||||
11
ass3/zbirnik/code/comment.go
Normal file
11
ass3/zbirnik/code/comment.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package comment
|
||||
|
||||
type Comment struct {
|
||||
value string
|
||||
}
|
||||
|
||||
func newComment(val string) Comment {
|
||||
return Comment {
|
||||
value: val
|
||||
}
|
||||
}
|
||||
0
ass3/zbirnik/code/directive.go
Normal file
0
ass3/zbirnik/code/directive.go
Normal file
8
ass3/zbirnik/code/instruction.go
Normal file
8
ass3/zbirnik/code/instruction.go
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
package instruction
|
||||
|
||||
type Instruction interface {
|
||||
newInstruction() Instruction
|
||||
}
|
||||
|
||||
|
||||
func newInstruction() {}
|
||||
11
ass3/zbirnik/code/instructionF1.go
Normal file
11
ass3/zbirnik/code/instructionF1.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package instructionF1
|
||||
|
||||
type InstructionF1 struct {
|
||||
opcode uint8
|
||||
}
|
||||
|
||||
func newInstructionF1(opcode uint8) InstructionF1 {
|
||||
return InstructionF1 {
|
||||
opcode: opcode
|
||||
}
|
||||
}
|
||||
7
ass3/zbirnik/code/instructionF2.go
Normal file
7
ass3/zbirnik/code/instructionF2.go
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
package instructionF2
|
||||
|
||||
type InstructionF2 struct {
|
||||
opcode uint8
|
||||
r1 uint8
|
||||
r2 uint8
|
||||
}
|
||||
25
ass3/zbirnik/code/instructionF3.go
Normal file
25
ass3/zbirnik/code/instructionF3.go
Normal 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
|
||||
}
|
||||
}
|
||||
25
ass3/zbirnik/code/instructionF4.go
Normal file
25
ass3/zbirnik/code/instructionF4.go
Normal 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
|
||||
}
|
||||
}
|
||||
26
ass3/zbirnik/code/instructionSIC.go
Normal file
26
ass3/zbirnik/code/instructionSIC.go
Normal 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
|
||||
}
|
||||
}
|
||||
|
||||
0
ass3/zbirnik/code/storage.go
Normal file
0
ass3/zbirnik/code/storage.go
Normal file
Loading…
Add table
Add a link
Reference in a new issue