Initial files
This commit is contained in:
parent
2f34088fc3
commit
a92a2b8dad
16 changed files with 755 additions and 2 deletions
33
test/ahello/0module.mk
Normal file
33
test/ahello/0module.mk
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
ASM_HELLO_NAME := ahello
|
||||
ASM_HELLO_RUN := run-$(ASM_HELLO_NAME)
|
||||
ASM_HELLO_TEST := test-$(ASM_HELLO_NAME)
|
||||
ASM_HELLO_SRC := test/$(ASM_HELLO_NAME)
|
||||
ASM_HELLO_BIN := $(PATH_BIN)/test/$(ASM_HELLO_NAME)
|
||||
ASM_HELLO_HEX := $(ASM_HELLO_BIN)/$(ASM_HELLO_NAME).hex
|
||||
ASM_HELLO_COM := $(ASM_HELLO_BIN)/$(ASM_HELLO_NAME).com
|
||||
ASM_HELLO_RELS := $(ASM_HELLO_BIN)/$(ASM_HELLO_NAME).rel
|
||||
ASM_HELLO_CODE := $(ASM_HELLO_SRC)/$(ASM_HELLO_NAME).asm
|
||||
BUILD_HELP += \\n\\t* $(ASM_HELLO_COM)\\n\\t* $(ASM_HELLO_RUN)\\n\\t* $(ASM_HELLO_TEST) \(Change txt in hello.asm and run again\)
|
||||
|
||||
$(ASM_HELLO_BIN):
|
||||
$(call mb_mkdir,$(ASM_HELLO_BIN))
|
||||
|
||||
$(ASM_HELLO_BIN)/%.rel: $(ASM_HELLO_SRC)/%.asm | $(ASM_HELLO_BIN)
|
||||
$(call mb_compile_asm,$@,$<)
|
||||
|
||||
$(ASM_HELLO_HEX): $(ASM_HELLO_RELS)
|
||||
$(call mb_link_asm_dos,$(ASM_HELLO_HEX),$(ASM_HELLO_RELS))
|
||||
|
||||
$(ASM_HELLO_COM): $(ASM_HELLO_HEX)
|
||||
$(call mb_hex2com,$(ASM_HELLO_HEX),$(ASM_HELLO_COM))
|
||||
|
||||
$(ASM_HELLO_RUN): $(ASM_HELLO_COM)
|
||||
$(call mb_autoexec_open_gui,$(ASM_HELLO_BIN))
|
||||
$(call mb_openmsx_dos2,$(ASM_HELLO_BIN))
|
||||
|
||||
$(ASM_HELLO_TEST): $(ASM_HELLO_COM)
|
||||
$(call mb_delete,$(ASM_HELLO_BIN)/test.out)
|
||||
$(call mb_autoexec_cmd_test,$(ASM_HELLO_BIN),$(ASM_HELLO_NAME) > test.out)
|
||||
$(call mb_openmsx_dos2,$(ASM_HELLO_BIN))
|
||||
$(call mb_assert_file_equals,$(ASM_HELLO_BIN)/test.out,Hello world...from asm.)
|
||||
42
test/ahello/ahello.asm
Normal file
42
test/ahello/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 "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