# E04-S06: build the statement-emission fixture and a D81 holding STMTS.N8. [CmdletBinding()] param() $ErrorActionPreference = "Stop" $project = Split-Path $PSScriptRoot -Parent Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force $out = Join-Path $project "build\statements-test" New-Item -ItemType Directory -Force -Path $out | Out-Null $link = Invoke-Nova128Link -Name "statements-test" -BuildDir $out ` -Config (Join-Path $project "cfg\compiler.cfg") -Sources @( (Join-Path $project "src\compiler\mmu.s"), (Join-Path $project "src\compiler\diskio.s"), (Join-Path $project "src\compiler\source.s"), (Join-Path $project "src\compiler\lexer.s"), (Join-Path $project "src\compiler\names.s"), (Join-Path $project "src\compiler\diagnostics.s"), (Join-Path $project "src\compiler\parser.s"), (Join-Path $project "src\compiler\interfaces.s"), (Join-Path $project "src\compiler\types.s"), (Join-Path $project "src\compiler\codegen.s"), (Join-Path $project "src\compiler\flow.s"), (Join-Path $project "src\compiler\members.s"), (Join-Path $project "src\compiler\sizing.s"), (Join-Path $project "src\compiler\emit.s"), (Join-Path $project "src\runtime\startup.s"), (Join-Path $project "tests\compiler\statements-test.s")) if ((Get-Nova128Label $link.Labels "test_entry") -ne 0x1C0D) { throw "test_entry is not at `$1C0D" } $pet = Join-Path $out "stmts.pet" [IO.File]::WriteAllBytes($pet, (ConvertTo-Nova128Petscii (Get-Content -Raw -LiteralPath (Join-Path $project "tests\compiler\statements.n8")))) New-Nova128Disk -Path (Join-Path $out "statements-test.d81") -Files @( @{ Name = "statements-test"; Path = $link.Program; Type = "prg" }, @{ Name = "stmts.n8"; Path = $pet; Type = "seq" }) Write-Host ("built {0}" -f $link.Program)