-
-
Notifications
You must be signed in to change notification settings - Fork 12
Align Pypm.asm with updated PMLL core #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
drQedwards
wants to merge
1
commit into
main
Choose a base branch
from
fix/pypm-asm-pmll-core
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+66
−21
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,48 @@ | ||
| ; pypm.asm - Minimal x86_64 assembly entry for PYPM | ||
| ; Assumes linkage with C runtime and pypm.c | ||
| ;; Pypm.asm — x86_64 entry for PYPM linked against the updated PMLL C core | ||
| ; (PMLL.c / PMLL.h). | ||
| ; | ||
| ; PMLL owns memory/state: | ||
| ; memory_silo_t, silo_set, peek, peek_semantic, sat_bridge_*, init_pml | ||
| ; (assignments start at -1 = undecided; flag is solve state, not a var value) | ||
| ; Q-promise owns temporal/control-flow (not entered from this stub). | ||
| ; | ||
| ; Build sketch (Linux x86_64): | ||
| ; nasm -f elf64 Pypm.asm -o Pypm.o | ||
| ; cc -DPMLL_NO_MAIN -c PMLL.c -o PMLL.o | ||
| ; cc -c Pypm.c -o Pypm_api.o | ||
| ; cc -no-pie -o pypm-asm Pypm.o PMLL.o Pypm_api.o | ||
| ; | ||
| ; Alternate CLI entry remains Pypm.c::main (doctor / version / …). | ||
|
|
||
| global _start | ||
|
|
||
| section .data | ||
| msg db "PYPM v0.0.3-dev", 10, 0 ; Null-terminated string | ||
| msglen equ $ - msg | ||
| msg db "PMLL core · silo + peek/peek_semantic · init_pml=-1", 10, 0 | ||
| msglen equ $ - msg - 1 ; exclude trailing NUL from write length | ||
|
|
||
| section .text | ||
| _start: | ||
| ; Write version message to stdout | ||
| mov rax, 1 ; syscall: write | ||
| mov rdi, 1 ; file descriptor 1 (stdout) | ||
| mov rsi, msg ; pointer to message | ||
| mov rdx, msglen ; message length | ||
| ; write(1, msg, msglen) | ||
| mov rax, 1 | ||
| mov rdi, 1 | ||
| mov rsi, msg | ||
| mov rdx, msglen | ||
| syscall | ||
|
|
||
| ; Call pypm_init (assumed external C function) | ||
| call pypm_init ; Defined in pypm.c | ||
| test eax, eax ; Check return value | ||
| jnz .error ; Jump if error | ||
| ; Smoke-boot the updated PMLL core (defined in Pypm.c) | ||
| call pmll_asm_boot | ||
| test eax, eax | ||
| jnz .error | ||
|
|
||
| ; Exit successfully | ||
| mov rax, 60 ; syscall: exit | ||
| xor rdi, rdi ; return code 0 | ||
| ; exit(0) | ||
| mov rax, 60 | ||
| xor rdi, rdi | ||
| syscall | ||
|
|
||
| .error: | ||
| ; Exit with error code | ||
| mov rax, 60 ; syscall: exit | ||
| mov rdi, 1 ; return code 1 | ||
| ; exit(1) | ||
| mov rax, 60 | ||
| mov rdi, 1 | ||
| syscall | ||
|
|
||
| ; External C function (to be linked) | ||
| extern pypm_init | ||
| extern pmll_asm_boot | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: drQedwards/PPM
Length of output: 1253
🏁 Script executed:
Repository: drQedwards/PPM
Length of output: 1844
🏁 Script executed:
Repository: drQedwards/PPM
Length of output: 642
Add
-nostartfilesto the custom-entry link command.The default
cclink includescrt1.o, which defines_start.Pypm.oalso defines_start, so the command can fail with a duplicate-symbol error. Keep libc available and suppress only the startup objects.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents