delphi package - full disassembler
-
Claes
- Posts: 52
- Joined: Thu Apr 22, 2004 10:52 pm
- Location: Denmark
Post
by Claes »
Can anyone help make the below code work?
Code: Select all
function MakeWord(L, H: Byte): Word;
{ macro creates a word from low and high bytes }
inline(
$5A/ { pop dx }
$58/ { pop ax }
$8A/$E2); { mov ah, dl }
It seems that Delphi no longer understand "inline"...? Anyhow I'm no assembler guy AT ALL, so I can't make it work...
The function is taken from the library SendKeys that I found somewhere on the net, and the code is part of Delphi Developers Guide by Steve Teixeira
-
Claes
- Posts: 52
- Joined: Thu Apr 22, 2004 10:52 pm
- Location: Denmark
Post
by Claes »
Will this work?
Code: Select all
function MakeWord(L,H: Byte): Word;
begin
MakeWord := (H shl 8) + L;
end;
-
nildo
- Posts: 249
- Joined: Mon Mar 22, 2004 11:32 am
-
Contact:
Post
by nildo »
Code: Select all
function MakeWord(L, H: Byte): Word;
{ macro creates a word from low and high bytes }
begin
asm
pop dx
pop ax
mov ah, dl
end;
end;
?
-
madshi
- Site Admin
- Posts: 10766
- Joined: Sun Mar 21, 2004 5:25 pm
Post
by madshi »
Is this still 16bit code? In Delphi you usually use "asm" instead of "inline", it's much nicer anyway.
But I'd do it like this:
Code: Select all
function MakeWord(L, H: Byte) : Word;
begin
result := Word(H) shl 8 + L;
end;
-
Claes
- Posts: 52
- Joined: Thu Apr 22, 2004 10:52 pm
- Location: Denmark
Post
by Claes »
Thanks, guys!