Welcome back. I think you're correct about the strings.
I've been busy. After my last message I poked around some and finally wrote some code that will count blanks in my 8 character 64-bit variables. I'm using ECX as a counter (code below). Tried using ESI so I wouldn't have to set it for the later shifting but got segmentation errors. Compiler, don't know which, perhaps both, seem to flake out on me, was giving me segmentation errors for the code below earlier, so I removed both NASM and gfortran and reinstalled both, after rebooting. The code then ran fine. Weird, huh? I'll try ESI again tomorrow. I knew the code was good because when I finally got it to run I emailed a copy to myself. I'm aware that EAX must be restored before
shifting occurs. Will try out your code tomorrow.
-mjrice
mrice@debian10-uni:~/work$ ./test
ABCDEFG
ABCDEFG
1
mrice@debian10-uni:~/work$ ./test
A
A
7
;;;;;;;;;;;;;;;;;;;
bits 32 ; to be sure.
struc kjunk_stk
resd 1
.ptr: resd 1
endstruc
global kjunk_
kjunk_:
mov eax,[esp+kjunk_stk.ptr] ; get pointer
mov edx, [eax+4] ; get QWORD from pointer.
mov eax, [eax]
mov ecx, 0
l1:
cmp al, 32
jnz l2
inc ecx
l2:
ror eax, 8
cmp al, 32
jnz l3
inc ecx
l3:
ror eax, 8
cmp al, 32
jnz l4
inc ecx
l4:
ror eax, 8
cmp al, 32
jnz l5
inc ecx
l5:
; ror eax, 8
mov eax, edx
l6:
cmp al, 32
jnz l7
inc ecx
l7:
ror eax, 8
cmp al, 32
jnz l8
inc ecx
l8:
ror eax, 8
cmp al, 32
jnz l9
inc ecx
l9:
ror eax, 8
cmp al, 32
jnz finished
inc ecx
finished:
mov eax, ecx
mov edx, 0
ret