I've got this procedure in PureBasic, which performs a XOR operation on all bytes in buffer 1,
using the byte at the same location from buffer 2. Now, I understand this isn't the best code
out there (I'm no ASM expert), but can anyone give me some pointers as to how I could translate
this to C++'s inline assembly support?
C++ inline assembly goes against everything I know (even though I know little) about ASM.
Code: Select all
Procedure.i xorblocks(*block1, *block2, length.l)
!PUSH EBP
!MOV EBP, ESP
!MOV ESI, [EBP + 8]
!MOV EDI, [EBP + 12]
!MOV ECX, [EBP + 16]
!XOR EAX, EAX
!xbl_init:
!MOV AL, [ESI]
!XOR AL, [EDI]
!MOV [ESI], AL
!INC ESI
!INC EDI
!DEC ECX
!JNE xbl_init
!POP EBP
!RETN 12
EndProcedure



