diff --git a/Gen.pas b/Gen.pas index ccabb39..376a61b 100644 --- a/Gen.pas +++ b/Gen.pas @@ -2048,9 +2048,17 @@ var lab1 := GenLabel; with op^ do begin if opcode = pc_ldo then begin - GenNative(m_cmp_abs, absolute, q, lab, 0); - GenNative(m_bne, relative, lab1, nil, 0); - GenNative(m_cpx_abs, absolute, q+2, lab, 0); + if smallMemoryModel then begin + GenNative(m_cmp_abs, absolute, q, lab, 0); + GenNative(m_bne, relative, lab1, nil, 0); + GenNative(m_cpx_abs, absolute, q+2, lab, 0); + end {if} + else begin + GenNative(m_cmp_long, longabsolute, q, lab, 0); + GenNative(m_bne, relative, lab1, nil, 0); + GenImplied(m_txa); + GenNative(m_cmp_long, longabsolute, q+2, lab, 0); + end; {else} end {if} else begin disp := LabelToDisp(r) + q; diff --git a/cc.notes b/cc.notes index 225f627..73bdec8 100644 --- a/cc.notes +++ b/cc.notes @@ -2013,6 +2013,8 @@ int foo(int[42]); 223. Expressions of floating-point type could not be used in initializers for integer variables with static storage duration. This should be allowed, with a conversion performed as in the case of assignment. +224. Comparisons against four-byte values in global structures, unions, or arrays might not work correctly when using the large memory model. + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.