i did this asm proc but i think can be done using operators ¿?
Code: Select all
procedure peekw_(hbuf)
r.w
mov edi,hbuf
mov ax,word [edi]
mov r,ax
procedurereturn r
endprocedure
Code: Select all
procedure peekw_(hbuf)
r.w
mov edi,hbuf
mov ax,word [edi]
mov r,ax
procedurereturn r
endprocedure
Code: Select all
LoWord = Long & $FFFF
HiWord = Long >> 16

Don't know about quicker, but I guess using the & and >> operators would be preferrable as your peek method relies on little endian byte ordering (i.e. would not work on 68k, probably not on PPC depending on what mode it was in). I guess it only matters if you care about portability and hope that there is one day a PPC/Linux or Mac version of PB ;)Justin wrote:Ok thanks, much easier. Do you know if it's faster or slower?, i'll use to process the WM_COMMAND msg inside the window callback.