The route is usually in any language, but you need to worry for a day or two, because these things are not always documented
Declare a global memory space at your taste HLL. DIM LABELNAME1(0)
Then find the asm syntax that puts the address in eax
mov eax, ^LABELNAME(0) mov eax, dword [_lablename] mov eax, ^_lablename etc etc etc
then put it in asm
You will not find pop [^
anywhere google, but it is one that works in certain HLL
push eax pop [^LABELNAME1(0)]
Now your HLL and asm can communicate with each other when you like
So it's worth a look
Undefined symbol _labelname
Probability should be announced at the very beginning of the program.
._labelname mov dword [_lablename], 0
and used later by asm as a label
As I said, you have to get confused and talk about your particular taste for HLL, and it seems that globals work best
You also need to figure out how to declare separate memory zones for storing dynamic asm variables and executing opcodes, or you will get cache overwrites that will distort the benefits of ASM
The small program that I wrote without dividing these areas took 20 hours. Split took 1 hour
mov ax, OFFSET _labelname
This is 16-bit stuff (DOS, etc., with the correct memory rules), you are not doing 32-bit stuff with HLL ???
If this does not happen in one segment, you will need a double-memory operand to find _labelname
, dx:ax
, etc., and as mentioned earlier, you are 20 years late.
jmp cs:_labelname
It works in the same segment, but for a larger program, the cs part should be tied to a specific segment and down-jump / return
In addition, if your asm dynamic variables are embedded in your asm code segment, then the basic rule for maximizing asm speed has been violated