I've been having trouble trying to find a function that flips a null-terminated string. Does one exist? If not, does anyone have such a thing? Thanks
Posted on 2000-11-26 14:57:00 by martin
Martin, There is a function in the MASM32 library to reverse a string. revstr proc lpszSource:DWORD,lpszDest:DWORD Regards, hutch@pbq.com.au
Posted on 2000-11-26 17:39:00 by hutch--
Here's one if you want the flipped string returned in the same buffer: mov edi, offset TextString mov esi, edi .WHILE 1 mov al, .IF al==0 .BREAK .ENDIF inc edi .ENDW mov ecx, edi dec edi sub ecx, esi shr ecx, 1 .WHILE ecx>0 mov al, mov ah, mov , ah mov , al inc esi dec edi dec ecx .ENDW Thomas
Posted on 2000-11-27 09:35:00 by Thomas