diff --git a/Gen.pas b/Gen.pas index 1819491..5983d02 100644 --- a/Gen.pas +++ b/Gen.pas @@ -4278,6 +4278,18 @@ var GenNative(m_lda_abs, absolute, q, lab, 0) else GenNative(m_lda_long, longabsolute, q, lab, 0); + if not short then + if op^.right^.optype in [cgByte,cgUByte] then + if op^.right^.opcode <> pc_ldc then begin + GenNative(m_and_imm, immediate, $00FF, nil, 0); + if optype = cgByte then begin + GenNative(m_bit_imm, immediate, $0080, nil, 0); + lab1 := GenLabel; + GenNative(m_beq, relative, lab1, nil, 0); + GenNative(m_ora_imm, immediate, $FF00, nil, 0); + GenLab(lab1); + end; {if} + end; {if} end {if} else begin GenImplied(m_pla); diff --git a/cc.notes b/cc.notes index 06b3267..df71550 100644 --- a/cc.notes +++ b/cc.notes @@ -1213,6 +1213,8 @@ int foo(int[42]); 161. The system() function might return the wrong value when using the large memory model. (This was a regression introduced in ORCA/C 2.2.0 B3.) +162. In certain cases, an assignment from a location with an 8-bit type to a location with a 16-bit type might store the wrong value. + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.