How to use "cmd" (MSX-BASIC)
  • asm source
                     org  #B000
    __ldirmv:        equ #0059
    __ldirvm:        equ #005C
    __chgmod:        equ #005F
    __filvrm:        equ #0056
    __wrtvrm:        equ #004D
    __getbyt:        equ #521C
    __ptrget:        equ #5EA4
                     jp   init
    cls:             ld hl,#1800
                     ld   bc,768
                     ld   a,0
                     call __filvrm
                     ret  
    init:            inc hl
                     inc  hl
                     ld   e,(hl)
                     inc  (hl)
                     ld   d,(hl)
                     push de
                     ld   hl,0
                     ld   de,fonts
                     ld   bc,#800
                     call __ldirmv
                     pop  hl
                     ld   a,l
                     call __chgmod
                     ld   hl,fonts
                     ld   de,#0
                     ld   bc,#800
                     call __ldirvm
                     ld   hl,fonts
                     ld   de,#800
                     ld   bc,#800
                     call __ldirvm
                     ld   hl,fonts
                     ld   de,#1000
                     ld   bc,#800
                     call __ldirvm
                     ld   hl,#2000
                     ld   bc,#1800
                     ld   a,#F0
                     call __filvrm
                     ld   a,#0C3
                     ld   (#FE0D),a
                     ld   hl,cmdprog
                     ld   (#FE0E),hl
                     jr   cls
    cmdprog:         pop af
                     call __getbyt
                     ld   d,#00
                     push de
                     inc  hl
                     call __getbyt
                     ld   d,#00
                     ex   de,hl
                     add  hl,hl
                     add  hl,hl
                     add  hl,hl
                     add  hl,hl
                     add  hl,hl
                     ld   bc,#1800
                     add  hl,bc
                     pop  bc
                     add  hl,bc
                     push hl
                     ex   de,hl
                     inc  hl
                     call __ptrget
                     push hl
                     ex   de,hl
                     ld   a,(hl)
                     inc  hl
                     ld   e,(hl)
                     inc  hl
                     ld   d,(hl)
                     pop  bc
                     pop  hl
                     push bc
                     ld   b,a
    loop1:           ld a,(de)
                     call __wrtvrm
                     inc  hl
                     inc  de
                     djnz loop1
                     pop  hl
                     ret  
    fonts:
  • basic sample (tabmegx)
    clear500,&hafff:color15,0,0:screen1,2:definta-z
    ad=&hb000:defusr=&hb000:defusr1=&hb003
    *macloop:reada$:ifa$="end"then*macend
    fori=0to31:pokead,val("&h"+mid$(a$,i*2+1,2)):ad=ad+1:next:goto*macloop
    data C30FB02100180100033E00CD5600C923235E3456D52100001196B0010008CD59
    data 00E17DCD5F002196B0110000010008CD5C002196B0110008010008CD5C002196
    data B0110010010008CD5C002100200100183EF0CD56003EC3320DFE2162B0220EFE
    data 18A1F1CD1C521600D523CD1C521600EB292929292901001809C109E5EB23CDA4
    data 5EE5EB7E235E2356C1E1C5471ACD4D00231310F8E1C9,end
    *macend:a=usr(4)
    
    sp=0
    *sploop
    reada$:ifa$="end"then*spend
    s$="":fori=0to31:s$=s$+chr$(val("&h"+mid$(a$,i*2+1,2))):nexti
    sprite$(sp)=s$
    reada$:s$="":fori=0to15:s$=s$+chr$(val("&h"+mid$(a$,i*2+1,2))):nexti
    colorsprite$(sp)=s$:sp=sp+1:goto*sploop
    *spend
    data0C1E3F7F5B6E7E3F1F1F1F1F3333330000000080C2CECE0EFCFEFEFE36363600
    data09090202020202020202020202050500,end
    
    a$="Hello Screen4!"
    cmd 10,5,a$
    putsprite0,(128,96),,0
    *lop:goto *lop
  • Try on MSXPen
    Back