From 5976e3b85d0f8614c97090fa836661fa51f9030a Mon Sep 17 00:00:00 2001 From: Olli Savia Date: Thu, 13 Jun 2024 16:22:42 +0300 Subject: [PATCH 1/2] Add sample assembly program for Commodore machines --- samples/cbm/Makefile | 19 +++++++++++++++---- samples/cbm/hello.s | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 samples/cbm/hello.s diff --git a/samples/cbm/Makefile b/samples/cbm/Makefile index 03387a061..71ab93a41 100644 --- a/samples/cbm/Makefile +++ b/samples/cbm/Makefile @@ -80,17 +80,19 @@ ifneq ($(filter disk samples.%,$(MAKECMDGOALS)),) C1541 ?= c1541 endif -DISK_c64 = samples.d64 +DISK_$(SYS) = samples.d64 EXELIST_c64 = \ fire \ plasma \ - nachtm + nachtm \ + hello EXELIST_c128 = \ fire \ plasma \ - nachtm + nachtm \ + hello EXELIST_cbm510 = \ fire \ @@ -110,7 +112,7 @@ EXELIST_pet = \ notavailable EXELIST_vic20 = \ - notavailable + hello ifneq ($(EXELIST_$(SYS)),) samples: $(EXELIST_$(SYS)) @@ -135,6 +137,15 @@ plasma: plasma.c $(CL) -t $(SYS) -O -o plasma -m plasma.map plasma.c nachtm: nachtm.c $(CL) -t $(SYS) -O -o nachtm -m nachtm.map nachtm.c +hello: hello.s + # Use separate assembler ... + $(AS) -t $(SYS) hello.s + # ... and linker commands ... + $(LD) -C $(SYS)-asm.cfg -o hello -m hello.map -u __EXEHDR__ hello.o $(SYS).lib + @$(DEL) hello.o 2>$(NULLDEV) + # ... or compile & link utility +# $(CL) -C $(SYS)-asm.cfg -o hello -m hello.map -u __EXEHDR__ hello.s + # -------------------------------------------------------------------------- # Rule to make a CBM disk with all samples. Needs the c1541 program that comes diff --git a/samples/cbm/hello.s b/samples/cbm/hello.s new file mode 100644 index 000000000..689dcc06b --- /dev/null +++ b/samples/cbm/hello.s @@ -0,0 +1,15 @@ +; +; Sample assembly program for Commodore machines +; + + .include "cbm_kernal.inc" + + ldx #$00 +: lda text,x + beq out + jsr CHROUT + inx + bne :- +out: rts + +text: .asciiz "hello world!" From a1ca451e69ce9865c51741561662bb937717f2a6 Mon Sep 17 00:00:00 2001 From: Olli Savia Date: Sun, 16 Jun 2024 09:35:44 +0300 Subject: [PATCH 2/2] Renamed: hello.s -> hello-asm.s --- samples/cbm/Makefile | 10 +++++----- samples/cbm/{hello.s => hello-asm.s} | 0 2 files changed, 5 insertions(+), 5 deletions(-) rename samples/cbm/{hello.s => hello-asm.s} (100%) diff --git a/samples/cbm/Makefile b/samples/cbm/Makefile index 71ab93a41..fe9d349bc 100644 --- a/samples/cbm/Makefile +++ b/samples/cbm/Makefile @@ -137,14 +137,14 @@ plasma: plasma.c $(CL) -t $(SYS) -O -o plasma -m plasma.map plasma.c nachtm: nachtm.c $(CL) -t $(SYS) -O -o nachtm -m nachtm.map nachtm.c -hello: hello.s +hello: hello-asm.s # Use separate assembler ... - $(AS) -t $(SYS) hello.s + $(AS) -t $(SYS) hello-asm.s # ... and linker commands ... - $(LD) -C $(SYS)-asm.cfg -o hello -m hello.map -u __EXEHDR__ hello.o $(SYS).lib - @$(DEL) hello.o 2>$(NULLDEV) + $(LD) -C $(SYS)-asm.cfg -o hello -m hello-asm.map -u __EXEHDR__ hello-asm.o $(SYS).lib + @$(DEL) hello-asm.o 2>$(NULLDEV) # ... or compile & link utility -# $(CL) -C $(SYS)-asm.cfg -o hello -m hello.map -u __EXEHDR__ hello.s +# $(CL) -C $(SYS)-asm.cfg -o hello -m hello-asm.map -u __EXEHDR__ hello-asm.s # -------------------------------------------------------------------------- diff --git a/samples/cbm/hello.s b/samples/cbm/hello-asm.s similarity index 100% rename from samples/cbm/hello.s rename to samples/cbm/hello-asm.s