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:
|
2024-06-23 17:01:03 +00:00
|
|
|
.str "SDCC: Hello2world..."
|
2020-12-23 17:14:13 +00:00
|
|
|
.db 0x1D
|
|
|
|
|
|
|
|
TXT_HELLO_SRC:
|
|
|
|
.str "from asm."
|
|
|
|
.db 0x0D,0x0A
|
|
|
|
.db 0x1D
|
|
|
|
|
|
|
|
.area _DATA
|