Incorrect initialization of variables
short __idata k[16]={0};
translate to
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area HOME (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area GSINIT (CODE)
; main.c:1: short __idata k[16]={0};
mov r0,#_k
mov @r0,#0x00
inc r0
mov @r0,#0x00
;--------------------------------------------------------
; Home
sdcc -v
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/r800/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02 TD- 4.4.0 #14620 (MINGW64)
This is not wrong. SDCC only initializes the explicitly given values and the rest is set to zero in crtclear.asm.
https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/device/lib/mcs51/crtclear.asm