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

1 Answer 1


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).


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

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

    db "?\"Hi you!\"",0

enter image description here

  • 5
    Source (and useful reference): Work area listing @ MSX2 Technical Handbook
    – Konamiman
    Oct 1, 2019 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, 2019 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, 2019 at 8:35
  • Note that this general technique is used in other MS-BASICs, as well, such as for NEC PC-8001.
    – cjs
    Apr 18 at 1:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .