Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for instructions with a "(reg+expression)" argument and parenthesis in the expression #17

Merged
Merged
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
14 changes: 7 additions & 7 deletions Assembler/AssemblySourceProcessor.CpuInstructions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ namespace Konamiman.Nestor80.Assembler

public partial class AssemblySourceProcessor
{
private static readonly Regex ixPlusArgumentRegex = new(@"^\(\s*IX\s*[+-][^)]+\)$", RegxOp);
private static readonly Regex iyPlusArgumentRegex = new(@"^\(\s*IY\s*[+-][^)]+\)$", RegxOp);
private static readonly Regex pcPlusArgumentRegex = new(@"^\(\s*PC\s*[+-][^)]+\)$", RegxOp);
private static readonly Regex spPlusArgumentRegex = new(@"^\(\s*SP\s*[+-][^)]+\)$", RegxOp);
private static readonly Regex hlPlusArgumentRegex = new(@"^\(\s*HL\s*[+-][^)]+\)$", RegxOp);
private static readonly Regex indexPlusArgumentRegex = new(@"^\(\s*I(X|Y)\s*(?<sign>[+-])(?<expression>[^)]+)\)$", RegxOp);
private static readonly Regex registerPlusArgumentRegex = new(@"^\(\s*(IX|IY|PC|SP|HL)\s*(?<sign>[+-])(?<expression>[^)]+)\)$", RegxOp);
private static readonly Regex ixPlusArgumentRegex = new(@"^\(\s*IX\s*[+-].+\)$", RegxOp);
private static readonly Regex iyPlusArgumentRegex = new(@"^\(\s*IY\s*[+-].+\)$", RegxOp);
private static readonly Regex pcPlusArgumentRegex = new(@"^\(\s*PC\s*[+-].+\)$", RegxOp);
private static readonly Regex spPlusArgumentRegex = new(@"^\(\s*SP\s*[+-].+\)$", RegxOp);
private static readonly Regex hlPlusArgumentRegex = new(@"^\(\s*HL\s*[+-].+\)$", RegxOp);
private static readonly Regex indexPlusArgumentRegex = new(@"^\(\s*I(X|Y)\s*(?<sign>[+-])(?<expression>.+)\)$", RegxOp);
private static readonly Regex registerPlusArgumentRegex = new(@"^\(\s*(IX|IY|PC|SP|HL)\s*(?<sign>[+-])(?<expression>.+)\)$", RegxOp);
private static readonly Regex z80MemPointedByRegisterRegex = new(@"^\(\s*(?<reg>HL|DE|BC|IX|IY|SP|C)\s*\)$", RegxOp);
private static readonly Regex z280MemPointedByRegisterRegex = new(@"^\(\s*(?<reg>HL|DE|BC|IX|IY|PC|SP|C|IX *\+ *IY|HL *\+ *IX|HL *\+ *IY)\s*\)$", RegxOp);
private static readonly Regex registerRegex = new(@"^[A-Z]{1,3}$", RegxOp);
Expand Down