# E04-S05: build the hello compiler fixture and a D81 holding HELLO.N8. [CmdletBinding()] param() $ErrorActionPreference = "Stop" $project = Split-Path $PSScriptRoot -Parent Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force $out = Join-Path $project "build\hello-test" New-Item -ItemType Directory -Force -Path $out | Out-Null $link = Invoke-Nova128Link -Name "hello-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\output.s"), (Join-Path $project "src\runtime\startup.s"), (Join-Path $project "tests\compiler\hello-test.s")) if ((Get-Nova128Label $link.Labels "test_entry") -ne 0x1C0D) { throw "test_entry is not at `$1C0D" } $pet = Join-Path $out "hello.pet" [IO.File]::WriteAllBytes($pet, (ConvertTo-Nova128Petscii (Get-Content -Raw -LiteralPath (Join-Path $project "tests\compiler\hello.n8")))) New-Nova128Disk -Path (Join-Path $out "hello-test.d81") -Files @( @{ Name = "hello-test"; Path = $link.Program; Type = "prg" }, @{ Name = "hello.n8"; Path = $pet; Type = "seq" }) # lowercase -> unshifted PETSCII Write-Host ("built {0}" -f $link.Program)