Difference between revisions of "Assembler:Commands:CALL"
Jump to navigation
Jump to search
(Created page with ''''command''' call ''mnemonic'' ''operand'' Calls the given operand (address or function). A RET must be hit for a CALL to work properly, best to use JMPs if unsure. === Comman…') |
|||
Line 2: | Line 2: | ||
Calls the given operand (address or function). | Calls the given operand (address or function). | ||
+ | Jumps to the given operand then returns. | ||
A RET must be hit for a CALL to work properly, best to use JMPs if unsure. | A RET must be hit for a CALL to work properly, best to use JMPs if unsure. | ||
Line 13: | Line 14: | ||
|- | |- | ||
|operand | |operand | ||
− | |The address or symbol to | + | |The address or symbol to call |
|} | |} | ||
== Examples == | == Examples == | ||
− | call +1A // | + | call +1A // Call from end of command to +1A (hex). |
− | call 00123ABC // | + | call 00123ABC // Call the address. |
− | call 0000123456ABCDEF // | + | call 0000123456ABCDEF // Call the address. |
− | call eax // | + | call eax // Call the value of eax. |
− | call rax // | + | call rax // Call the value of rax. |
− | call someSymbol // | + | call someSymbol // Call the user defined symbol. |
− | call someLabel // | + | call someLabel // Call the label. |
− | call short someLabel // | + | call short someLabel // Call the label with short byte code. |
− | call long someLabel // | + | call long someLabel // Call the label with full address. |
− | call @b // | + | call @b // Call back the closest anonymous label (''@@:''). |
− | call @f // | + | call @f // Call forward the closest anonymous label (''@@:''). |
Revision as of 09:47, 13 March 2017
command call mnemonic operand
Calls the given operand (address or function). Jumps to the given operand then returns. A RET must be hit for a CALL to work properly, best to use JMPs if unsure.
Command Parameters
Parameter | Description |
---|---|
mnemonic OPTIONAL | The preferred size of the assembled address |
operand | The address or symbol to call |
Examples
call +1A // Call from end of command to +1A (hex).
call 00123ABC // Call the address.
call 0000123456ABCDEF // Call the address.
call eax // Call the value of eax.
call rax // Call the value of rax.
call someSymbol // Call the user defined symbol.
call someLabel // Call the label.
call short someLabel // Call the label with short byte code.
call long someLabel // Call the label with full address.
call @b // Call back the closest anonymous label (@@:).
call @f // Call forward the closest anonymous label (@@:).
Running this script in 64 bit mode:
globalAlloc(memTest, 0x200) label(testLbl) memTest: add [rax],al // db 00 00 @@: add [rax],al ret call short @b call short @f add [rax],al @@: add [rax],al ret add [rax],al call short -8 call short +2 add [rax],al testLbl: add [rax],al ret call 01160002 add [rax],al call rax add [rax],al call memTest add [rax],al call testLbl add [rax],al call short testLbl add [rax],al call long testLbl add [rax],al db 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 ret