Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Organic/Assembler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,16 +591,21 @@ public List<ListEntry> Assemble(string code, string FileName)
}
else
{
if (opcode.valueA == null || (!nonBasic && opcode.valueB == null))
{
listEntry.ErrorCode = ErrorCode.InsufficientParamters;
output.Add(listEntry);
continue;
}

listEntry.Opcode = opcode;
StringMatch valueA = null, valueB = null;
listEntry.Output = new ushort[1];
if (!nonBasic)
{
listEntry.CodeType = CodeType.BasicInstruction;
if (opcode.valueA != null)
valueA = MatchString(opcode.valueA, ValueTable);
if (opcode.valueB != null)
valueB = MatchString(opcode.valueB, ValueTable);
valueA = MatchString(opcode.valueA, ValueTable);
valueB = MatchString(opcode.valueB, ValueTable);
if (valueA.value == valueB.value && valueA.value != 0x1E && valueB.value != 0x1E)
listEntry.WarningCode = WarningCode.RedundantStatement;
if (valueB.value == 0x1F && !opcode.match.Contains("IF"))
Expand Down Expand Up @@ -634,8 +639,7 @@ public List<ListEntry> Assemble(string code, string FileName)
else
{
listEntry.CodeType = CodeType.NonBasicInstruction;
if (opcode.valueA != null)
valueA = MatchString(opcode.valueA, ValueTable);
valueA = MatchString(opcode.valueA, ValueTable);
listEntry.ValueA = valueA;
// De-localize labels
if (listEntry.ValueA.isLiteral)
Expand Down
2 changes: 1 addition & 1 deletion Organic/Directives.cs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ private void ParseDirectives(List<ListEntry> output, string line)
currentAddress += (ushort)padding.Length;
}
}
else if (parameters.Length == 1)
else if (parameters.Length < 3)
output.Add(new ListEntry(line, FileNames.Peek(), LineNumbers.Peek(), currentAddress, ErrorCode.InsufficientParamters));
else
output.Add(new ListEntry(line, FileNames.Peek(), LineNumbers.Peek(), currentAddress, ErrorCode.TooManyParamters));
Expand Down