msxbuild/test/ahello-sdcc/ahello.asm

43 lines
500 B
NASM
Raw Normal View History

2020-12-23 17:14:13 +00:00
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:
2021-07-06 01:52:02 +00:00
.str "SDCC: Hello world..."
2020-12-23 17:14:13 +00:00
.db 0x1D
TXT_HELLO_SRC:
.str "from asm."
.db 0x0D,0x0A
.db 0x1D
.area _DATA