2 A bug in gbz80 code generation for 16-bit addition with operands allocated to bc and de, result spilt.
7 #define UINT8 unsigned char
8 #define specialchar_nl '\n'
10 #define buffer_length (16)
11 UINT8 buffer
[buffer_length
];
13 UINT8
smart_write(const UINT8 y
, const UINT8 height
, char *str
){
22 for(length
= 0; length
< 16; ++length
){
23 if(*str_ptr
== specialchar_nl
|| *str_ptr
== '\0'){
24 buffer
[length
] = '\0';
27 buffer
[length
] = *str_ptr
;
36 if(*str_ptr
== specialchar_nl
)
40 if(tmp_y
>= y
+height
){ // Wrong code generated for addition here.
50 ASSERT(smart_write(1, 20, "test\n") == 0);