5

How can I change the texts assigned to MSX function keys using Z80 ASM?

8

I answer myself:

At address 0xf87f (FNKSTR), at the system variables memory, there are 160 bytes where you can change the values of the 10 function keys (16 bytes each).

The strings are in ASCIIZ (zero terminated string).

EDIT:

; Sample code (compiled with sjasmplus)
    OUTPUT test.bin
    db $fe
    dw start, newtext_end, start
    ORG $8000

; Change the F1 key text
start:
    ld hl,newtext
    ld de,$f87f
    ld bc,newtext_end-newtext
    ldir
    ret

newtext:
    db "?\"Hi you!\"",0
newtext_end:

enter image description here

  • 5
    Source (and useful reference): Work area listing @ MSX2 Technical Handbook – Konamiman Oct 1 at 9:53
  • 1
    An improvement to your sample code would be calling DSPFNK (00CFH) after chaning the work area contents, so that you don't need to key on from BASIC. – Konamiman Oct 2 at 8:22
  • It's true, but the question is about to change the Function Keys text, not about update them at screen bottom. Anyway is good to known that! Thanks. – NataliaPC Oct 2 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.