Код:
OUTPUT Usr0x02.bas
org #5CCB
;; Three basic lines
line1 dw #0100,lenln1-4
db REM,'Busy soft 07.04.2017',#0D
line2 dw #0200,lenln2-4
db RAND,USR,VAL,'"',PEEK,'23627+256*',PEEK,'23628+3"',#0D
line3 dw #0300,lenln3-4
db LOAD,'""',#0D
;; Basic variables
varss db 'S'+#80 ;; Variable s$
dw lencod ;; Length of whole variable content
OUTPUT Usr0x02.cod
;; Content of variable s$
start res 4,(iy+#01) ;; Switch to 48 basic
ld hl,(ramtop) ;; Recontruction of stack for 48 basic
ld (hl),#3E ;; End-of-stack mark for basic RETURN
dec hl ;; (for detect RETURN without GOSUB)
ld sp,hl
ld hl,main ;; Standart error handler
push hl ;; (for displaying error messages)
ld (errsp),sp
ld hl,inican
ld de,canmem ;; Base address for channel information
ld bc,21
ld (chans),de
ldir
ld l,low stdata ;; Initial open channels
ld e,low strms
ld c,low 14
ldir
jp runbas ;; Continue in 48 basic interpreter
endend
;; Lengths
lenln1 = line2-line1
lenln2 = line3-line2
lenln3 = varss-line3
lenbas = varss-line1
lencod = endend-start
lenall = endend-line1
;; Basic tokens
REM = #EA
RAND = #F9
VAL = #B0
USR = #C0
PEEK = #BE
LOAD = #EF
;; Used ROM addresses
main = #1303
inican = #15AF
stdata = #15C6
runbas = #1BF4
;; Used system variables
strms = #5C10
errsp = #5C3D
chans = #5C4F
ramtop = #5CB2
canmem = #5CB6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;