|
3 answers
If you mean exactly the last two digits in hexadecimal notation, then you just need to impose a mask $ FF:
Z := $1122 AND $FF; |
Apparently take the remainder of the division by 0x100 (256)
|
while num>=256 do num:=num-256; not?
In general, logical multiplication by FF will be more correct. I do not remember already whether there is such in Pascal.
Another sick idea came to mind:
num := num - (num shr 8) shl 8; - In principle, it works, only you have to transfer it back to HEX then - nikita_sergeevich
- Yes, in Pascal there is a logical "or." num: = num and $ ff; // is called this masking. This is the best of your answers. - Dex
- The logical "and" , "or" is a logical addition :) - nikita_sergeevich
|
$used in pascal, not0x- nikita_sergeevich