You can use AAD and AAM (ASCII adjust for Division/Multiplication) to do quick decimal-binary conversions for numbers 0-99.
Suppose AX = 0506h (representing decimal digits 5 and 6 for the decimal number 56)
then AAD will set AX = 0038h (56d)
and then AAM will set AX = 0506h.
So AAD converts 2 digits in AX to binary in AL, and AAM converts binary in AL to 2 digits in AX.
(Once you've got your two digits you can easily turn them into ASCII characters by adding 30h to each byte and adjusting for the characters between '9' and 'A').
Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.
Quick
- ($a, $b....) = unpack("A2A7...", $packed)
- push( array, list )
Friday, October 21, 2011
Followers
Blog Archive
-
▼
2011
(80)
-
▼
October
(19)
- Perl mkdir, make_path and mkpath
- Perl and large integers
- readdir
- Combo box dropdown failure
- CreateProcess
- Pointers to member functions
- Perl system and synchronicity
- AAD and AAM
- Endianness
- Astronomy sky diagrams and photos often have a lit...
- Giving up smoking
- Constructors, temporary objects and initialisation
- new and constructors
- Choice of language
- argv and argc
- C++ static member functions
- do while is not a loop
- C++ structs
- mingw maximum file name length
-
▼
October
(19)