You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <stdio.h>
#define BUFFER_SIZE 16384
#define MAINBANK_ADDR (65536 - BUFFER_SIZE*2)
void main(void)
{
printf("M RAMTOP no good (%u)", MAINBANK_ADDR);
}
zcc +zx -vn -a test.c
._main
ld hl,i_1+0
push hl
ld hl,32768 ;const
ld de,0
push de
push hl
ld a,3
call printf
pop bc
pop bc
pop bc
ret
MAINBANK_ADDR is being pushed as a 32-bit value when the result is 16-bits and a 16-bit value is expected. This is happening because there is a 32-bit value "65536" in the expression used to calculate MAINBANK_ADDR. If the constant is changed to 65535, 16-bits is pushed.
zsdcc pushes 16-bits for the value if it is in range of 16-bits.
The text was updated successfully, but these errors were encountered:
zcc +zx -vn -a test.c
MAINBANK_ADDR
is being pushed as a 32-bit value when the result is 16-bits and a 16-bit value is expected. This is happening because there is a 32-bit value "65536" in the expression used to calculateMAINBANK_ADDR
. If the constant is changed to 65535, 16-bits is pushed.zsdcc pushes 16-bits for the value if it is in range of 16-bits.
The text was updated successfully, but these errors were encountered: