1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00

Merge pull request #2447 from ops/helloworld

Add sample assembly program for Commodore machines
This commit is contained in:
Bob Andrews 2024-06-16 16:05:54 +02:00 committed by GitHub
commit 35d638cb09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 4 deletions

View File

@ -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-asm.s
# Use separate assembler ...
$(AS) -t $(SYS) hello-asm.s
# ... and linker commands ...
$(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-asm.map -u __EXEHDR__ hello-asm.s
# --------------------------------------------------------------------------
# Rule to make a CBM disk with all samples. Needs the c1541 program that comes

15
samples/cbm/hello-asm.s Normal file
View File

@ -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!"