2 A bug in handling of 8-bit parameters to z88dk_fastcall. Also bug #2852.
12 #pragma disable_warning 85
13 #pragma disable_warning 127
15 #if !defined( __SDCC_pdk14) && !defined( __SDCC_pdk15) && !(defined( __SDCC_mcs51) && (defined(__SDCC_MODEL_SMALL) || defined(__SDCC_MODEL_MEDIUM))) // Lack of memory
17 void lock_give_fastcall(uint8_t * mutex
)
19 __preserves_regs(b
,c
,d
,e
,iyh
,iyl
) __z88dk_fastcall
23 #define lock_give(a) lock_give_fastcall(a)
25 uint8_t bank_get_abs_fastcall(int8_t bankRel
)
27 __preserves_regs(b
,c
,d
,e
,h
,iyh
,iyl
) __z88dk_fastcall
30 ASSERT (bankRel
= 23);
33 #define bank_get_abs(a) bank_get_abs_fastcall(a)
35 static void *memcpy_far(void *str1
,int8_t bank1
,const void *str2
,const int8_t bank2
,size_t n
)
37 __preserves_regs(iyh
,iyl
)
42 uint8_t bankLockBase
[16];
46 int8_t ya_mvb(const char **args
)
48 if ( (args
[2] != NULL
) && (bank_get_abs((int8_t)atoi(args
[1])) != 0) && (bank_get_abs((int8_t)atoi(args
[2])) != 0) )
50 memcpy_far((void *)0x0000, (int8_t)atoi(args
[2]), (void *)0x0000, (int8_t)atoi(args
[1]), (0xF000));
51 bankLockBase
[ bank_get_abs((int8_t)atoi(args
[2])) ] = bankLockBase
[ bank_get_abs((int8_t)atoi(args
[1])) ];
56 int8_t ya_loadb(const char **args
)
62 if (args
[1] == NULL
|| args
[2] == NULL
) {
64 if (args
[3] == NULL
) {
65 dest
= (uint8_t *)0x0100;
67 dest
= (uint8_t *)strtoul(args
[3], NULL
, 16);
70 while ((uint16_t)dest
< (0xF000)) {
73 if (s1
> (0xF000) - (uint16_t)dest
) {
74 s1
= (0xF000) - (uint16_t)dest
;
76 memcpy_far((void *)dest
, (int8_t)atoi(args
[2]), buffer
, 0, s1
);
81 lock_give( &bankLockBase
[ bank_get_abs((int8_t)atoi(args
[2])) ] );
90 #if !defined( __SDCC_pdk14) && !defined( __SDCC_pdk15) && !(defined(__SDCC_mcs51) && (defined(__SDCC_MODEL_SMALL) || defined(__SDCC_MODEL_MEDIUM))) // Lack of memory
91 const char *args
[] = {"", "", "23", 0};