why wouldnt it work, i guess its because of the al, i know it should be a pointer but i need it to be the value of al, anyone know a way i i could do this ?

thanks in advance.

The Keeper trying to be direct :-)
Posted on 2002-06-16 21:27:32 by The Keeper
not exactly sure, but i think this may be what you are looking for:

...
LOCAL pVal:BYTE
mov pVal,al
invoke InString,1,addr pVal,ADDR alpha
Posted on 2002-06-16 22:18:20 by jademtech
Keeper,

If what you are doing is scanning for a single byte, there are better ways than using InString.

InString proc StartPos:DWORD, lpszString:DWORD, lpszSubStr:DWORD

The second parameter for InString is the address of the string to search in and the third parameter is the substring you are trying to find.

Tell us what you are trying to do and I am sure one of our members can help you.

Regards,

hutch@movsd.com
Posted on 2002-06-16 23:04:23 by hutch--
i found i was using parameters inverted, what i want to do is find the value of al in a table, i did

szAlpha db "ABC...",0
alval db 00h
mov alval, al
invoke InString,1,addr szAlpha, alval

but it doesnt seem to be working either, any idea?
Posted on 2002-06-17 06:55:08 by The Keeper
Keeper



.data
szAlpha db "ABC...",0
alval db 00h
retval dd 0

.code
; startup code etc ...
; assuming you have a BYTE value in AL
mov alval, al
invoke InString,1,ADDR szAlpha, ADDR alval
mov retval, eax ; << location here

This should work but its a poor use of the algo, for this application you should write a simple byte scanner that exits on the character you are looking for or when it gets to the end.

Regards,

hutch@movsd.com
Posted on 2002-06-17 07:13:32 by hutch--
hutch shouldn't the alval variable be 2 bytes long, so there is a null terminator on it too?

It'll work the first time because retval will act as its null terminator, but its not exactly clean is it!

Mirno
Posted on 2002-06-17 07:20:33 by Mirno