public void Parse_Data_DB() { var dad = CompilerDataAllocationDirective.ParseLine("msg db 'Hello, world!', 0xa"); Assert.Equal("msg", dad.Label); Assert.Equal("db", dad.Mnemonic); Assert.Equal(2, dad.Operands.Length); Assert.Equal("'Hello, world!'", dad.Operands[0]); Assert.Equal("0xa", dad.Operands[1]); }
public void Parse_Data_MisformattedLabel_Space_Before_Colon() { var dad = CompilerDataAllocationDirective.ParseLine("msg : db \"Mean is-: \",10"); Assert.Equal("msg", dad.Label); Assert.Equal("db", dad.Mnemonic); Assert.Equal(2, dad.Operands.Length); Assert.Equal("\"Mean is-: \"", dad.Operands[0]); Assert.Equal("10", dad.Operands[1]); }
public void Parse_Data_EQU() { var dad = CompilerDataAllocationDirective.ParseLine("len equ $ - msg"); Assert.Equal("len", dad.Label); Assert.Equal("equ", dad.Mnemonic); Assert.Equal(3, dad.Operands.Length); Assert.Equal("$", dad.Operands[0]); Assert.Equal("-", dad.Operands[1]); Assert.Equal("msg", dad.Operands[2]); }
public void Parse_Data_DQArray() { var dad = CompilerDataAllocationDirective.ParseLine("array: dq 102.56, 56.89, 111.11, 134.78, 34.99"); Assert.Equal("array", dad.Label); Assert.Equal("dq", dad.Mnemonic); Assert.Equal(5, dad.Operands.Length); Assert.Equal("102.56", dad.Operands[0]); Assert.Equal("56.89", dad.Operands[1]); Assert.Equal("111.11", dad.Operands[2]); Assert.Equal("134.78", dad.Operands[3]); Assert.Equal("34.99", dad.Operands[4]); }