汇编下如何处理字符串?
汇编环境下,如何操作字符串的某位?
例子如下:
procedure StringFunc;
var
S: String;
begin
S := '12345';
asm
push eax
push ebx
push ecx
mov eax, S //Pointer(S)
mov ecx, [eax - 4] //Length(S)
@@LOOP:
test ecx, ecx
je @@RET
mov bl, byte ptr [eax + ecx - 1] //S[ecx]
//... //这里对bl进行处理
//mov byte ptr [eax + ecx - 1] //问题出现这里,编译有错误,该内存不能写入
//注释上句掉就没有问题,但是我需要把处理完的数据重新写入,请问如何操作???
dec ecx
jmp @@LOOP
@@RET:
pop ecx
pop ebx
pop eax
end;
end;
顺便帮忙看看还有没有问题,或者还可以怎么改进更简洁更精练.