How to load from memory

Bare metal programming in PureBasic, for experienced users
DennisLeh99
New User
New User
Posts: 2
Joined: Sat Jul 16, 2022 3:33 pm

How to load from memory

Post by DennisLeh99 »

Hey guys.I am a beginner. How can i load the value from memory to any Register.

https://ibb.co/j9N2jMd
User avatar
mk-soft
Always Here
Always Here
Posts: 6244
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: How to load from memory

Post by mk-soft »

Not just any registers may be taken. See PB-Help Assembler

What are you going to do?
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
DennisLeh99
New User
New User
Posts: 2
Joined: Sat Jul 16, 2022 3:33 pm

Re: How to load from memory

Post 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.
User avatar
Kiffi
Addict
Addict
Posts: 1500
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: How to load from memory

Post 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
Hygge
Bitblazer
Enthusiast
Enthusiast
Posts: 762
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: How to load from memory

Post by Bitblazer »

There are also the memory commands to read from and write to memory. ( click the memory commands link)
juergenkulow
Enthusiast
Enthusiast
Posts: 581
Joined: Wed Sep 25, 2019 10:18 am

Re: How to load from memory

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