Hello,
I've got an algorithm that changes 1 byte int
to 2 byte char...
pre-condition: al := converting content
post-condition: ah == higher byte, al == lower byte
---- this is the code ----
pusha
mov ah,0x00
mov al,a
aam
or al,0x30
mov a,al
or ah,0x30
mov b,ah
popa
---- END ----
Ben Hsu
1 byte (int) --> 2 (char)
RE:1 byte (int) --> 2 (char)
oh, a and b are just desired position in memory,
i did this with my c++ compiler and they just went
into the variable (char)a and (char)b.
Ben
>On 2002-04-11 17:06:17, Ben Hsu wrote:
>Hello,
> I've got an algorithm that changes 1 byte int
>to 2 byte char...
>pre-condition: al := converting content
>post-condition: ah == higher byte, al == lower byte
>
>---- this is the code ----
>pusha
>mov ah,0x00
>mov al,a
>aam
>or al,0x30
>mov a,al
>or ah,0x30
>mov b,ah
>popa
>---- END ----
>
>Ben Hsu
i did this with my c++ compiler and they just went
into the variable (char)a and (char)b.
Ben
>On 2002-04-11 17:06:17, Ben Hsu wrote:
>Hello,
> I've got an algorithm that changes 1 byte int
>to 2 byte char...
>pre-condition: al := converting content
>post-condition: ah == higher byte, al == lower byte
>
>---- this is the code ----
>pusha
>mov ah,0x00
>mov al,a
>aam
>or al,0x30
>mov a,al
>or ah,0x30
>mov b,ah
>popa
>---- END ----
>
>Ben Hsu