Files Modified:
src/S1130.SystemObjects/AssemblyLine.cssrc/S1130.SystemObjects/Assembler.cs
Changes:
*now only recognized as comment when in column 1 (first character of line)//added for inline comments (can appear after code on same line)- Eliminated ambiguity with
*as current-address operator
Code Changes:
// AssemblyLine.cs - Column 1 check
if (line.Length > 0 && line[0] == '*')
{
IsComment = true;
Comment = line;
return;
}
// Inline comment support
int commentPos = line.IndexOf("//");
if (commentPos >= 0)
{
Comment = line.Substring(commentPos);
line = line.Substring(0, commentPos);
}Files Modified:
src/S1130.SystemObjects/Assembler.cs(ParseOperand method)
Changes:
- Completely rewrote ParseOperand method (~120 lines → ~60 lines)
- Format/tag now REQUIRED as first token after mnemonic
- Supported format/tag specifiers:
.- Short format, no indexL- Long format, no index1,2,3- Short format with index registerL1,L2,L3- Long format with index registerI,I1,I2,I3- Indirect addressing
- Returns clear error message if format/tag missing
Example:
LD . VAL1 // Short format, no index (dot required)
LD L VAL2 // Long format
LD 1 VAL3 // Short with XR1
LD L2 VAL4 // Long with XR2
LD I VAL5 // Indirect, no indexFiles Modified:
src/S1130.SystemObjects/Assembler.cs(ProcessBranch method)
Changes:
- Rewrote ProcessBranch to parse new syntax:
formatTag [condition] address - Removed old comma-based index syntax
- Format/tag must be first token
- Conditions (O, C, E, +, -, Z, P, M) optional and come after format/tag
Examples:
BSC . O LOOP // Short, overflow off
BSC L O LOOP // Long, overflow off
BSC 1 O LOOP // Short with XR1, overflow off
BSC L2 +- LOOP // Long with XR2, positive or minus
BSC . LOOP // Unconditional, short
BOSC . O LOOP // BSC with interrupt resetFiles Modified:
src/S1130.SystemObjects/Instructions/InstructionBase.cssrc/S1130.SystemObjects/Instructions/BranchSkip.cssrc/S1130.SystemObjects/Instructions/BranchStore.cssrc/S1130.SystemObjects/Instructions/ModifyIndex.cs
Changes:
- Updated InstructionBase.Disassemble to always output
.for short/no-index - Rewrote BranchSkip (BSC/BOSC) disassembly:
- Format/tag appears first
- Conditions appear before address
- Output: "BSC . O /0100" instead of "BSC /0100,O"
- Updated BSI and MDX disassembly to match new format
Key Change:
// InstructionBase.cs - Now outputs dot for short/no-index
else
{
// Short format
if (cpu.Tag > 0)
formatParts.Add(cpu.Tag.ToString());
else
formatParts.Add("."); // <-- NEW: Always output dot
}Files Modified:
tests/UnitTests.S1130.SystemObjects/AssemblerTests.cs
Tests Fixed (7 total):
BSC_Syntax_AllFormats- Updated all BSC variationsBSC_ConditionCodes_CorrectModifiers- Added dots to conditionsBranchInstructionsProgram- Updated BSC with dotXioInstructionTest- Added dot to XIO instructionShortFormatAndIndexRegisterProgram- Updated LD/STO with dots and index syntaxBssSymbolResolutionTest- Changed*inline comments to//ComprehensiveAssemblerTest- Updated all instructions and comments
Test Results:
- 473 tests total
- 473 passing
- 0 failures ✅
Files Modified:
web-frontend/src/components/AssemblerEditor.tsx
Changes:
- Updated EXAMPLE_PROGRAM to use new syntax:
- BSC instructions use dot notation
- Inline comments changed from
*to// - Maintains column-1
*for full-line comments
Example Updated:
const EXAMPLE_PROGRAM = ` ORG /100
* Test SLT overflow detection
START LDD L ONE // Load 1 into ACC and EXT
LOOP SLT 1 // Shift left by 1 bit
BSC . O // Skip if overflow OFF (continue)
BSC L START // Overflow ON - restart
...`;Test File:
tests/UnitTests.S1130.SystemObjects/RoundTripTests.cs
Results:
- 33 round-trip tests passing
- Confirms: Assemble → Disassemble → Reassemble produces identical binary
- Validates that disassembler output is valid assembler input
Files Created:
ASSEMBLER_SYNTAX_CHANGES.md- Complete reference document
Contents:
- Side-by-side old vs. new syntax examples
- Migration guide for existing code
- Complete list of format/tag specifiers
- Benefits and breaking changes clearly documented
| Category | Count | Status |
|---|---|---|
| Total Tests | 473 | ✅ All Passing |
| Round-Trip Tests | 33 | ✅ All Passing |
| Build Status | - | ✅ No Errors |
| Tests Modified | 7 | ✅ Updated |
- Lines of Code Modified: ~300 lines
- Files Modified: 11 files
- Tests Updated: 7 test methods
- Breaking Changes: Yes (syntax change - see migration guide)
- Backward Compatible: No (intentional - eliminates ambiguity)
- Time to Complete: ~4 hours (overnight session)
All existing assembly code must be updated:
- Add dots:
LD VAL→LD . VAL - Change index:
LD VAL,X1→LD 1 VAL - Fix branches:
BSC O LOOP→BSC . O LOOP - Update comments: Inline
* comment→// comment - Check column 1: Full-line
*must be first character
✅ All unit tests pass (473/473) ✅ Round-trip tests pass (33/33) ✅ Build succeeds with no errors ✅ Disassembler outputs valid syntax ✅ Assembler enforces new rules with clear error messages ✅ Web frontend example updated ✅ Documentation created
The assembler and disassembler are fully functional with the new syntax. All tests pass, and the system is ready for use. Users will need to update existing assembly code to the new syntax using the migration guide in ASSEMBLER_SYNTAX_CHANGES.md.
- Review
ASSEMBLER_SYNTAX_CHANGES.mdfor complete syntax reference - Update any existing assembly programs to new syntax
- Test with real programs if any exist
- Consider adding more comprehensive round-trip tests if desired
- Update any external documentation or tutorials
Modified (11 files):
src/S1130.SystemObjects/AssemblyLine.cs
src/S1130.SystemObjects/Assembler.cs
src/S1130.SystemObjects/Instructions/InstructionBase.cs
src/S1130.SystemObjects/Instructions/BranchSkip.cs
src/S1130.SystemObjects/Instructions/BranchStore.cs
src/S1130.SystemObjects/Instructions/ModifyIndex.cs
tests/UnitTests.S1130.SystemObjects/AssemblerTests.cs
web-frontend/src/components/AssemblerEditor.tsx
Created (2 files):
ASSEMBLER_SYNTAX_CHANGES.md
OVERNIGHT_WORK_SUMMARY.md (this file)
Completion Time: 4:00 AM (approximately) Status: ✅ READY FOR REVIEW Build Status: ✅ PASSING Test Status: ✅ 473/473 PASSING