Here is a LeftTrim function example. It reads a NULL terminated string and stops a the first non space or TAB character.
.386
.model flat,stdcall
option casemap:none
includelib \PellesC\lib\Win\kernel32.lib
includelib \PellesC\lib\Win\user32.lib
ExitProcess PROTO :DWORD
LeftTrim PROTO :DWORD
StdOut PROTO :DWORD
.data
LeftTrimTable db 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
teststr db ' This is a test',0
.code
start:
invoke LeftTrim,ADDR teststr
invoke StdOut,eax
invoke ExitProcess,0
LeftTrim PROC USES esi _str:DWORD
mov edx,1
mov eax,_str
mov esi,OFFSET LeftTrimTable
sub eax,edx
@@:
add eax,edx
movzx ecx,BYTE PTR [eax]
cmp BYTE PTR [esi+ecx],dl
je @b
ret
LeftTrim ENDP
END start