[Doc] Minor fix in x86::Assembler documentation

This commit is contained in:
kobalicek
2023-11-06 14:13:33 +01:00
parent 7e64eabca4
commit 30b83beda7

View File

@@ -284,21 +284,21 @@ ASMJIT_BEGIN_SUB_NAMESPACE(x86)
//! #include <asmjit/x86.h> //! #include <asmjit/x86.h>
//! using namespace asmjit; //! using namespace asmjit;
//! //!
//! void embedData(x86::Assembler& a, const Label& L_Data) { //! void processData(x86::Assembler& a, const Label& L_Data) {
//! x86::Gp addr = a.zax(); // EAX or RAX. //! x86::Gp addr = a.zax(); // EAX or RAX.
//! x86::Gp val = x86::edi; // Where to store some value... //! x86::Gp val = x86::edi; // Where to store some value...
//! //!
//! // Approach 1 - Load the address to register through LEA. This approach //! // Approach 1 - Load the address to register through LEA. This approach
//! // is flexible as the address can be then manipulated, for //! // is flexible as the address can be then manipulated, for
//! // example if you have a data array, which would need index. //! // example if you have a data array, which would need index.
//! a.lea(addr, L_Data); // Loads the address of the label to EAX or RAX. //! a.lea(addr, x86::ptr(L_Data));
//! a.mov(val, dword_ptr(addr)); //! a.mov(val, x86::dword_ptr(addr));
//! //!
//! // Approach 2 - Load the data directly by using L_Data in address. It's //! // Approach 2 - Load the data directly by using L_Data in address. It's
//! // worth noting that this doesn't work with indexes in X64 //! // worth noting that this doesn't work with indexes in X64
//! // mode. It will use absolute address in 32-bit mode and //! // mode. It will use absolute address in 32-bit mode and
//! // relative address (RIP) in 64-bit mode. //! // relative address (RIP) in 64-bit mode.
//! a.mov(val, dword_ptr(L_Data)); //! a.mov(val, x86::dword_ptr(L_Data));
//! } //! }
//! ``` //! ```
//! //!