Page 1 of 1

How to move byte into al

Posted: Wed Jul 14, 2010 4:04 pm
by benco5000
Trying to do some basic assembler
for brevity, please assume that:
*lPointer is a valid pointer to some data, i.e.
'ABCDEFG'

Code: Select all

start:   MOV al, $00             ;; clear register for grins
         MOV al, [*lPointer]     ;; how do I get the character 'A' loaded into the register al?

Re: How to move byte into al

Posted: Wed Jul 14, 2010 4:24 pm
by srod
Something like the following I guess :

Code: Select all

start:   MOV al, $00             ;; clear register for grins
         MOV ebp, dword [p_lPointer]
         MOV al, [ebp]

Re: How to move byte into al

Posted: Wed Jul 14, 2010 4:47 pm
by Thorium
No need to clear the register. Only if you want to be sure that the whole eax or rax register is clear.
But the mov al,$00 is just unneeded.