DEVICE ZXSPECTRUM128
include "../_sdk/sys_h.asm"
org PROGSTART
begin
;ld e,6 ;textmode
;OS_SETGFX
call initstdio
ld a,9
ld b,0
ld de,0x8000
ld ix,0
ld hl,0
;b=drive(0..), de=buffer, ixhl=sector number, a=count
OS_READSECTORS
jr $
ld hl,thello
call prtext
ld hl,thello
call prtext
ld hl,thello
call prtext
ld hl,thello
call prtext
QUIT
prtext
;hl=text
push hl
call strlen ;hl=length
pop de ;de=text
jp sendchars
strlen
;hl=str
;out: hl=length
xor a
ld b,a
ld c,a ;чтобы точно найти терминатор
cpir ;найдём обязательно, если длина=0, то bc=-1 и т.д.
ld hl,-1
or a
sbc hl,bc
ret
thello
;db "Hello, world!",0x0d,0x0a,0
db "Sele",0x1b,'[','1','D',"ct drive:\r\n[0] Nemo master\r\n[1] Nemo slave\r\n[2] ATM master(not tested!)\r\n[3] ATM slave(not tested!)",0
include "../_sdk/stdio.asm"
end
savebin "hello.com",begin,end-begin
LABELSLIST "../../us/user.l"