Hi Frank,
That worked, with the added statement after the shrd instruction (see below), because you also must shift EDX, but as blanks are shifted out on one end zeros are shifted in on the other, just as you said.
That may be adequate. I need to go through the code that calls it to see what's what.
Fortran has a character variable but it's kind of funky so I'm sticking characters in a 64-bit word using a Hollerith field for generality. So, I can store an 8-byte integer, an 8-byte real (float) or 8 characters in a 64-bit word.
iword1 = 8hABCDEFGH
iword2 = 8h_CHICAGO (underscore represents blank)
Also, Fortran doesn't require the \0 at the end.
Thanks,
Michael
global lanorm_
section .text ;shift leading blanks out of 64-bit word
lanorm_:
push ebp
mov ebp, esp
mov eax, [ebp+8]
pop ebp
mov edx, [eax+4]
mov eax, [eax]
.loop:
cmp byte al,0x20
jne .done
shrd eax,edx,8
shr edx,8
jmp short .loop
.done:
ret