Hi @fenrock, The (word) should not be needed, however since KickC is missing a fragment you have found a very nice work-around tricking it to use a fragment it already knows.
If you add the following file to the /fragment/mos6502-common/ folder of KickC the code will compile and work without the (word) cast. The fragment in question handles the case word z1, z2, *c1; *z1=*c1+z2; where z1 and z2 are located on zeropage and c1 is a constant.
https://gitlab.com/camelot/kickc/-/blob/master/src/main/fragment/mos6502-common/vwum1=_deref_pwuc1_plus_vwum2.asm
The last compile-phase in KickcC generates ASM code based on small ASM fragment files matching simple C statements. It almost never fails on 8bit numbers - but is still learning to handle all combinations for 16bit numbers.
By the way KickC can create the multiply by 40 code for you. So the following also works, and generates code that is very similar to your mul40():
word screenAddress1 = currentTop + (word)currentRow*40 + currentCol;