initial commit

This commit is contained in:
Edward R. Gonzalez 2025-05-25 18:45:24 -04:00
commit b32fdffb93
6 changed files with 99 additions and 0 deletions

31
.editorconfig Normal file
View File

@ -0,0 +1,31 @@
root = true
[*.refactor]
indent_style = space
indent_size = 4
[*.md]
indent_style = space
indent_size = 4
[*.{h, c, hpp, cpp}]
indent_style = tab
indent_size = 4
[*.{ps1, psm1}]
indent_style = tab
indent_size = 4
[*.odin]
indent_style = tab
indent_size = 2
charset = utf-8
[*.asm]
indent_style = tab
indent_size = 2
charset = utf-8
[*.{natvis, natstepfilter}]
indent_style = tab
indent_size = 4

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build

2
code/forth.asm Normal file
View File

@ -0,0 +1,2 @@
; An introduction to forth based on jonesforth.S

30
scripts/build.ps1 Normal file
View File

@ -0,0 +1,30 @@
$devshell = Join-Path $PSScriptRoot 'helpers/devshell.ps1'
& $devshell -arch amd64
$path_root = split-path -Path $PSScriptRoot -Parent
$path_build = join-path $path_root 'build'
$path_code = join-path $path_root 'code'
if ((test-path $path_build) -eq $false) {
new-item -itemtype directory -path $path_build
}
$masm = 'ml64'
$lib_kernel32 = 'kernel32.lib'
$flag_subsystem_console = '/subsystem:console'
$flag_link = '/link'
push-location $path_build
$unit = join-path $path_code 'forth.asm'
$asm_args = @()
$asm_args += $unit
$asm_args += $flag_link
$asm_args += $flag_subsystem_console
$asm_args += $lib_kernel32
& $masm $asm_args
pop-location

View File

@ -0,0 +1,28 @@
if ($env:VCINSTALLDIR) {
return
}
$ErrorActionPreference = "Stop"
# Use vswhere to find the latest Visual Studio installation
$vswhere_out = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
if ($null -eq $vswhere_out) {
Write-Host "ERROR: Visual Studio installation not found"
exit 1
}
# Find Launch-VsDevShell.ps1 in the Visual Studio installation
$vs_path = $vswhere_out
$vs_devshell = Join-Path $vs_path "\Common7\Tools\Launch-VsDevShell.ps1"
if ( -not (Test-Path $vs_devshell) ) {
Write-Host "ERROR: Launch-VsDevShell.ps1 not found in Visual Studio installation"
Write-Host Tested path: $vs_devshell
exit 1
}
# Launch the Visual Studio Developer Shell
Push-Location
write-host @args
& $vs_devshell @args
Pop-Location

7
scripts/run.ps1 Normal file
View File

@ -0,0 +1,7 @@
$path_root = split-path -Path $PSScriptRoot -Parent
$path_build = join-path $path_root 'build'
Push-Location $path_build
$forth = join-path $path_build 'forth.exe'
& $forth
pop-location