How to move byte into al

Just starting out? Need help? Post your questions and find answers here.
benco5000
User
User
Posts: 13
Joined: Mon Mar 01, 2010 8:56 pm

How to move byte into al

Post 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?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: How to move byte into al

Post 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]
I may look like a mule, but I'm not a complete ass.
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

Re: How to move byte into al

Post 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.
Post Reply