This commit is contained in:
2025-08-02 12:10:59 -04:00
parent 0a4dd81318
commit 5bb19672a7
11 changed files with 1227 additions and 32 deletions
+25 -17
View File
@@ -1,28 +1,36 @@
$path_root = split-path -Path $PSScriptRoot -Parent
$path_build = join-path $path_root 'build'
$path_code = join-path $path_root 'code'
$path_scripts = join-path $path_root 'scripts'
$path_root = split-path -Path $PSScriptRoot -Parent
$path_build = join-path $path_root 'build'
$path_code = join-path $path_root 'code'
$path_scripts = join-path $path_root 'scripts'
$path_toolchain = join-path $path_root 'toolchain'
if ((test-path $path_build) -eq $false) {
new-item -itemtype directory -path $path_build
}
$armips = 'armips'
$armips = join-path $path_toolchain 'armips/armips.exe'
$bin2exe_lua = join-path $path_scripts 'bin2exe.lua'
$bin2exe_py = join-path $path_scripts 'bin2exe.py'
$path_fillmem = join-path $path_code 'fillmem'
$src_fillmem = join-path $path_fillmem 'fillmem.s'
$bin_fillmem = join-path $path_build 'fillmem.bin'
$exe_fillmem = join-path $path_build 'fillmem.exe'
function build-program { param(
[string]$module,
[string]$unit
)
$path_module = join-path $path_code $module
$src = join-path $path_module "$unit.s"
$bin = join-path $path_build "$unit.bin"
$exe = join-path $path_build "$unit.exe"
push-location $path_build
write-host "Assembling: $src_fillmem`n"
& $armips $src_fillmem
push-location $path_build
write-host "Assembling: $src`n"
& $armips $src
write-host 'Generating executable..'
& lua $bin2exe_lua $bin_fillmem $exe_fillmem
# & py $bin2exe_py $bin_fillmem $exe_fillmem
write-host 'Generating executable..'
& lua $bin2exe_lua $bin $exe
# & py $bin2exe_py $bin $exe
write-host 'Done!'
pop-location
write-host 'Done!'
pop-location
}
# build-program 'fillmem' 'fillmem'
build-program 'warmup' 'exercise1'