~rabbits/public-inbox

(uxnasm) Explicit error for empty rom v1 PROPOSED

Lobo Torres: 1
 (uxnasm) Explicit error for empty rom

 1 files changed, 5 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rabbits/public-inbox/patches/50592/mbox | git am -3
Learn more about email & git

[PATCH] (uxnasm) Explicit error for empty rom Export this patch

---
 src/uxnasm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/uxnasm.c b/src/uxnasm.c
index d69c313..7af82ec 100644
--- a/src/uxnasm.c
+++ b/src/uxnasm.c
@@ -400,10 +400,11 @@ main(int argc, char *argv[])
{
	ptr = PAGE;
	copy("on-reset", scope, 0);
	if(argc == 1) return error_top("usage", "uxnasm [-v] input.tal output.rom");
	if(scmp(argv[1], "-v", 2)) return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 29 Mar 2024.\n");
	if(!assemble(argv[1]) || !length) return !error_top("Assembly", "Failed to assemble rom.");
	if(argc == 2 && scmp(argv[1], "-v", 2)) return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 29 Mar 2024.\n");
	if(argc != 3) return error_top("usage", "uxnasm [-v] input.tal output.rom");
	if(!assemble(argv[1])) return !error_top("Assembly", "Failed to assemble rom.");
	if(!length) return !error_top("Assembly", "Output rom is empty.");
	if(!resolve()) return !error_top("Assembly", "Failed to resolve symbols.");
	if(!build(argv[2])) return !error_top("Assembly", "Failed to build rom.");
	return 0;
}
\ No newline at end of file
}
-- 
2.39.2