assembly - Hidden value included when putting ebx register into a DD variable -
at 1 moment while executing code turbo debugger, bx register has 0001 value in it.
(i can view bx register in turbo debugger, , not find how view whole ebx. side question: how view whole eax/ebx/... registers? )
immediately after, when send ebx dd variable sum1, sent value becomes 30310001h.
what reasons , how can avoid it?
my guess reason: sum1 recieved invisible value, included in ebx not bx (contained ebx).
(i new ebx/eax/... registers btw.)
if guessed right, how can access unseen part of ebx?
this shortened code, loop2a converts string decimal value, char-by-char, , puts ebx.
loop2a: mov eax, [di] mov ah, 0 sub eax, '0' imul eax, ecx add ebx, eax mov sum1, ebx imul ecx, ten dec di cmp di, jne loop2a mov sum1, ebx (compiler: turbo assembler, processor: intel x86.)
anywhere in code initialized bx (xor bx,bx or mov bx,0). change ebx (xor ebx,ebx or mov ebx,0). cannot separately access upper word of 32-bit-register.
Comments
Post a Comment