Difference between revisions of "Lua:getInstructionSize"
Jump to navigation
Jump to search
m (Reverted edits by This content is not available (Talk) to last revision by TheyCallMeTim13) |
m (Added CodeBox Template.) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[Category:Lua]] | [[Category:Lua]] | ||
| − | '''function''' getInstructionSize('' | + | {{CodeBox|'''function''' getInstructionSize(''address'') ''':''' Integer}} |
| − | Returns the size of | + | Returns the size (in bytes) of the instruction at the given address. |
| + | Basically, it disassembles the instruction and returns how many bytes it occupies. | ||
| − | === Function Parameters === | + | ===Function Parameters=== |
| − | + | {|width="85%" cellpadding="5%" cellspacing="0" border="0" | |
| − | {|width="85 | ||
!align="left"|Parameter | !align="left"|Parameter | ||
!align="left"|Type | !align="left"|Type | ||
!style="width: 80%;background-color:white;" align="left"|Description | !style="width: 80%;background-color:white;" align="left"|Description | ||
|- | |- | ||
| − | | | + | |address |
| − | | | + | |Integer |
| − | |The address of the instruction | + | |The memory address of the instruction to analyze. |
|} | |} | ||
| + | ===Example=== | ||
| + | <pre> | ||
| + | local size = getInstructionSize(0x401000) | ||
| + | print("Instruction size:", size) | ||
| + | </pre> | ||
{{LuaSeeAlso}} | {{LuaSeeAlso}} | ||
| − | + | {{Assembly}} | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Latest revision as of 00:21, 5 December 2025
| <> Function function getInstructionSize(address) : Integer |
Returns the size (in bytes) of the instruction at the given address. Basically, it disassembles the instruction and returns how many bytes it occupies.
Function Parameters[edit]
| Parameter | Type | Description |
|---|---|---|
| address | Integer | The memory address of the instruction to analyze. |
Example[edit]
local size = getInstructionSize(0x401000)
print("Instruction size:", size)
See also[edit]
| Lua |
| Script Engine |
Related Functions[edit]
| autoAssemble |
| autoAssembleCheck |
| disassemble |
| splitDisassembledString |
| getInstructionSize |
| getPreviousOpcode |
| registerAssembler |
| unregisterAssembler |