BASM = Borland/Codegear/Embarcadero's Built-In Assembler, the Delphi inline assembler
Questions tagged [basm]
50 questions
1
vote
2 answers
Delphi assembler: understanding the Result register
I'm messing around with ASM in Delphi. From my understanding, EAX holds Result. In the following, I have to put RET at the end, otherwise Result is not correct (it is correct if the input is 0). What am I doing wrong, or should I say, what don't I…

IamIC
- 17,747
- 20
- 91
- 154
1
vote
1 answer
Store function variable in ASM functions in Delphi
How can I properly store n in functions like the following one ? Because of value in n changes for some reason after I use it once.
function Test(n: Integer): Byte;
asm
mov eax, n
add eax, eax
add eax, n
mov ecx, eax
mov ebx, eax
mov…

DanilGholtsman
- 2,354
- 4
- 38
- 69
0
votes
0 answers
Setup function with no stack frame in C++Builder?
I have a small __msfastcall function with nothing but inline __asm { } code. How do I tell c++builder to not generated a stack frame for the function when generating it for both x86 and x64 architectures?
WARNING: When using the modern c++ compiler…

user3161924
- 1,849
- 18
- 33
0
votes
0 answers
Call Exception.CreateRes in inline assembler
How do I call an Exception with a resource string message using inline assembler?
I tried various things, but nothing seems to work. I get things like inline assembler syntax error or operant sizes does not match.
resourcestring
sMessage = 'Test…

Daniel Marschall
- 3,739
- 2
- 28
- 67
0
votes
1 answer
64 bit inline assembly in Delphi XE3
I ran into this issue using 64-bit inline assembler in Delphi XE3 that I don't understand.
I tried this, and it works on both 32-bit and 64-bit
function test(a, b: integer): integer; assembler; register;
asm
mov eax, a
add eax,…

justyy
- 5,831
- 4
- 40
- 73