Código Delphi [-]var before, after : Word; begin // Set up out starting number before := $3C; // Hex 3C = 003C in the Word // Shift left by 12 will lose the top 12 bits of the Word after := before Shl 12; ShowMessageFmt('Before : %x',[before]); ShowMessageFmt('After shift left : %x',[after]); // Shifting right by 12 will not recover the lost data after := after Shr 12; ShowMessageFmt('After shift right : %x',[after]); end;
var before, after : Word; begin // Set up out starting number before := $3C; // Hex 3C = 003C in the Word // Shift left by 12 will lose the top 12 bits of the Word after := before Shl 12; ShowMessageFmt('Before : %x',[before]); ShowMessageFmt('After shift left : %x',[after]); // Shifting right by 12 will not recover the lost data after := after Shr 12; ShowMessageFmt('After shift right : %x',[after]); end;