Converted local project to demo structure.
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -8s
All checks were successful
Run test asserts / Test-Asserts (push) Successful in -8s
This commit is contained in:
parent
fd67884bee
commit
56e74ee085
21 changed files with 257 additions and 249 deletions
29
src/ahello-sdcc/0module.mk
Normal file
29
src/ahello-sdcc/0module.mk
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
AHELLO_SDCC_MOD := ahello-sdcc
|
||||
AHELLO_SDCC_SRC := $(PATH_SRC)/$(AHELLO_SDCC_MOD)
|
||||
AHELLO_SDCC_BIN := $(PATH_BIN)/$(AHELLO_SDCC_MOD)
|
||||
BUILD_HELP += \\n\\t* $(AHELLO_SDCC_BIN)/ahello.com\\n\\t* ahello-sdcc-run\\n\\t* ahello-sdcc-assert
|
||||
|
||||
$(AHELLO_SDCC_BIN):
|
||||
$(call mb_mkdir,$(AHELLO_SDCC_BIN))
|
||||
|
||||
$(AHELLO_SDCC_BIN)/%.rel: $(AHELLO_SDCC_SRC)/%.asm | $(AHELLO_SDCC_BIN)
|
||||
$(call mb_sdcc_compile_asm,$<,$@)
|
||||
|
||||
$(AHELLO_SDCC_BIN)/ahello.hex: $(AHELLO_SDCC_BIN)/ahello.rel
|
||||
$(call mb_sdcc_link_asm_dos,$<,$@)
|
||||
|
||||
$(AHELLO_SDCC_BIN)/ahello.com: $(AHELLO_SDCC_BIN)/ahello.hex
|
||||
$(call mb_sdcc_hex2bin,$<,$@)
|
||||
|
||||
.PHONY: ahello-sdcc-run
|
||||
ahello-sdcc-run: $(AHELLO_SDCC_BIN)/ahello.com
|
||||
$(call mb_autoexec_show_gui80,$(AHELLO_SDCC_BIN))
|
||||
$(call mb_openmsx_dosctl,$(AHELLO_SDCC_BIN))
|
||||
|
||||
.PHONY: ahello-sdcc-assert
|
||||
ahello-sdcc-assert: $(AHELLO_SDCC_BIN)/ahello.com
|
||||
$(call mb_delete,$(AHELLO_SDCC_BIN)/ahello.out)
|
||||
$(call mb_autoexec_safe_test,$(AHELLO_SDCC_BIN),ahello > ahello.out)
|
||||
$(call mb_openmsx_dosctl,$(AHELLO_SDCC_BIN))
|
||||
grep "SDCC: Hello world..." $(AHELLO_SDCC_BIN)/ahello.out
|
||||
42
src/ahello-sdcc/ahello.asm
Normal file
42
src/ahello-sdcc/ahello.asm
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
DOS .equ 0x5
|
||||
_CONOUT .equ 0x02
|
||||
|
||||
.area _CODE
|
||||
JP START
|
||||
|
||||
.db 0x0D ; type hello.com
|
||||
.db 0x0D,0x0A
|
||||
.str "Example hello world executable."
|
||||
.db 0x0D,0x0A
|
||||
.db 0x1A ; end txt
|
||||
|
||||
START:
|
||||
LD HL,#TXT_HELLO
|
||||
CALL PUT_TXT
|
||||
LD HL,#TXT_HELLO_SRC
|
||||
CALL PUT_TXT
|
||||
RET
|
||||
|
||||
PUT_TXT:
|
||||
LD A,(HL)
|
||||
CP #0x1D
|
||||
RET Z
|
||||
LD E,A
|
||||
LD C,#2
|
||||
PUSH HL
|
||||
CALL DOS
|
||||
POP HL
|
||||
INC HL
|
||||
JR PUT_TXT
|
||||
|
||||
TXT_HELLO:
|
||||
.str "SDCC: Hello world..."
|
||||
.db 0x1D
|
||||
|
||||
TXT_HELLO_SRC:
|
||||
.str "from asm."
|
||||
.db 0x0D,0x0A
|
||||
.db 0x1D
|
||||
|
||||
.area _DATA
|
||||
Loading…
Add table
Add a link
Reference in a new issue