Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

46 lignes
1.9KB

  1. # E04-S02: run the software-frame ABI fixture in x128 and check the mailbox.
  2. [CmdletBinding()]
  3. param(
  4. [int]$Port = 6530,
  5. [int]$TimeoutSeconds = 90
  6. )
  7. $ErrorActionPreference = "Stop"
  8. $project = Split-Path $PSScriptRoot -Parent
  9. Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force
  10. & (Join-Path $PSScriptRoot "build-frame-test.ps1")
  11. $out = Join-Path $project "build\frame-test"
  12. $prg = Join-Path $out "frame-test.prg"
  13. $session = Start-Nova128X128 -Autostart $prg -Port $Port `
  14. -Screenshot (Join-Path $out "frame-test-vicii.png")
  15. try {
  16. $mb = Wait-Nova128Mailbox $session -TimeoutSeconds $TimeoutSeconds
  17. } finally {
  18. Stop-Nova128X128 $session
  19. }
  20. Write-Host ('mailbox: ' + (($mb | ForEach-Object { $_.ToString('X2') }) -join ' '))
  21. $sum = $mb[8] + 256 * $mb[9]
  22. $byteSum = $mb[10]
  23. $overflow = $mb[11]
  24. $sp = $mb[12] + 256 * $mb[13]
  25. $frameError = $mb[14]
  26. $fp = $mb[15]
  27. Write-Host ("results: recursive={0} one-byte={1} overflow={2} SP=${3:X4} error={4} FP=${5:X2}" -f `
  28. $sum, $byteSum, $overflow, $sp, $frameError, $fp)
  29. $failures = @()
  30. if ($mb[2] -ne 0x03) { $failures += "producer $($mb[2]) is not a generated program" }
  31. if ($mb[3] -ne 0xA5) { $failures += "fixture status is not PASS" }
  32. if ($mb[4] -ne 0 -or $mb[5] -ne 0) { $failures += "code is $($mb[4] + 256 * $mb[5])" }
  33. if ($sum -ne 1275) { $failures += "recursive result is $sum, expected 1275" }
  34. if ($byteSum -ne 12) { $failures += "one-byte result is $byteSum, expected 12" }
  35. if ($overflow -ne 1) { $failures += "overflow result is $overflow, expected 1" }
  36. if ($sp -ne 0xC000) { $failures += ('SP after overflow is ${0:X4}, expected $C000' -f $sp) }
  37. if ($frameError -ne 1) { $failures += "frame error is $frameError, expected 1" }
  38. if ($fp -ne 0) { $failures += "FP after overflow is $fp, expected 0" }
  39. if ($failures) { throw ("frame verification failed:`n " + ($failures -join "`n ")) }
  40. Write-Host "verified 50-deep recursion, one-byte return, and transactional overflow unwind"

Powered by TurnKey Linux.