Page 1 of 1

How to load from memory

Posted: Sat Jul 16, 2022 3:38 pm
by DennisLeh99
Hey guys.I am a beginner. How can i load the value from memory to any Register.

https://ibb.co/j9N2jMd

Re: How to load from memory

Posted: Sat Jul 16, 2022 4:06 pm
by mk-soft
Not just any registers may be taken. See PB-Help Assembler

What are you going to do?

Re: How to load from memory

Posted: Sat Jul 16, 2022 4:13 pm
by DennisLeh99
I want to learn to move values from memory to register and vise versa because i want to add numbers.

What do you mean with PB-Help Assembler.

Re: How to load from memory

Posted: Sat Jul 16, 2022 4:18 pm
by Kiffi
DennisLeh99 wrote: Sat Jul 16, 2022 4:13 pmWhat do you mean with PB-Help Assembler.
https://www.purebasic.com/documentation ... edasm.html

Re: How to load from memory

Posted: Sat Jul 16, 2022 5:53 pm
by Bitblazer
There are also the memory commands to read from and write to memory. ( click the memory commands link)

Re: How to load from memory

Posted: Sat Jul 16, 2022 6:55 pm
by juergenkulow

Code: Select all

; x64 ASM Register add - only ASM-Backend
Define result.q
EnableASM
Mov rax,[l_a]      ; Load $11 in Register rax.
Mov rbx,[l_b]      ; Load $4700 in Register rbx.
Add rax,rbx        ; Add $4700 to $11 
Mov [v_result],rax ; Store $4711 in result. 
Debug Hex(result)
End
a: ; Memory with two 64 bit values: 
!  dq     $11
b:
!  dq     $4700
; 4711