Re: Hexadecimal words
- From: Chris Head <spamtrap@xxxxxxxxxx>
- Date: Fri, 29 Jul 2005 01:21:30 +0000 (UTC)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Kjeld Jacobsen wrote:
[snip]
> Hi Alex
>
> ;Code to shift dx:ax 4 bits left on any x86 CPU
>
> shl ax,1 ;Shift ax 1 bit left, into carry
> rcl dx,1 ;Shift carry left into dx bit 0
>
> shl ax,1
> rcl dx,1
>
> shl ax,1
> rcl dx,1
>
> shl ax,1
> rcl dx,1
>
> ;Result, dx:ax shifted 4 bits left
>
>
> Regards
> Kjeld Jacobsen
>
Hi,
If you can assume the upper 16 bits are zero initially (as you can
here), then this code works without having to clear DX, and it's shorter:
mov dx, ax
shl ax, 4
shr dx, 12
Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
iD8DBQFC6X4v6ZGQ8LKA8nwRAhFeAKC+xOfL/WQqeW5amAYxY48v32iwLACeLCvd
09ms3JM4c2872NYGEwH2G6E=
=xlkT
-----END PGP SIGNATURE-----
.
- Follow-Ups:
- Re: Hexadecimal words
- From: Bill Leary
- Re: Hexadecimal words
- References:
- Hexadecimal words
- From: Alex Buell
- Re: Hexadecimal words
- From: Kjeld Jacobsen
- Hexadecimal words
- Prev by Date: Re: need list of x86 opcodes
- Next by Date: Re: Hexadecimal words
- Previous by thread: Re: Hexadecimal words
- Next by thread: Re: Hexadecimal words
- Index(es):
Relevant Pages
|