Make memory sizes parameters
This commit is contained in:
@@ -6,6 +6,8 @@ import "github.com/firestuff/subcoding/asm"
|
||||
|
||||
func TestTooManyOperands(t *testing.T) {
|
||||
_, err := asm.AssembleString(`
|
||||
global_memory_size: 4
|
||||
function_memory_size: 4
|
||||
functions:
|
||||
- - [nop, 0]
|
||||
`)
|
||||
@@ -16,6 +18,8 @@ functions:
|
||||
|
||||
func TestTooFewOperands(t *testing.T) {
|
||||
_, err := asm.AssembleString(`
|
||||
global_memory_size: 4
|
||||
function_memory_size: 4
|
||||
functions:
|
||||
- - [mov, g0]
|
||||
`)
|
||||
@@ -26,6 +30,8 @@ functions:
|
||||
|
||||
func TestIncorrectSigned(t *testing.T) {
|
||||
_, err := asm.AssembleString(`
|
||||
global_memory_size: 4
|
||||
function_memory_size: 4
|
||||
functions:
|
||||
- - [ltu, 0, -1]
|
||||
`)
|
||||
@@ -36,6 +42,8 @@ functions:
|
||||
|
||||
func TestHex(t *testing.T) {
|
||||
prog, err := asm.AssembleString(`
|
||||
global_memory_size: 4
|
||||
function_memory_size: 4
|
||||
functions:
|
||||
- - [mov, g0, 0xfeedc0de]
|
||||
`)
|
||||
@@ -51,6 +59,8 @@ functions:
|
||||
|
||||
func TestBinary(t *testing.T) {
|
||||
prog, err := asm.AssembleString(`
|
||||
global_memory_size: 4
|
||||
function_memory_size: 4
|
||||
functions:
|
||||
- - [mov, g0, 0b100101]
|
||||
`)
|
||||
|
||||
Reference in New Issue
Block a user