QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: NOVARSEG on November 17, 2020, 08:26:38 pm
-
Can QB64 compile this?
**** Quick Basic source code
CALL trythis ' a label in assembler
****
****the assembler code (example A86 assembler)
trythis:
RETF
****
****Quick Basic source code
PRINT "we made it back!!"
end
****
A86 will produce an object file from the assembler code. Does QB64 support "CALL label " where the label is in assembler code.
-
Nope.
-
If you're interested, freebasic's got it all: https://www.freebasic.net/wiki/KeyPgAsm (https://www.freebasic.net/wiki/KeyPgAsm)
-
OK thanks
It looks like inline ASM.
I think the CPU must be in virtual mode (VM) to apply the real mode x86 instruction rules so are real mode x86 ASM in freebasic a problem?
-
I can see problems arising since the DS selector value must be derived from freebasic at compile time?
If DS selector value is known then just a matter of using say EAX for memory addressing so a real mode x86 address needs to be converted to a protected mode address. I guess?
-
There is no real mode with freebasic. Even freebasic for DOS runs in 32 bit protected mode requiring at least a 386
-
Most the time, anymore, stuff like that is simply emulated or workarounds cause modern OSes don't want to allow you to access low level actions like that anymore.
-
Cobalt
yep because the OS makers don't want others to control the machine.
-
Vince
That's Ok as long as the ASM code addresses are protected mode ones
32 bit registers and 32 bit addressing can be done in 16 bit assembler like A86 with the 66h and 67h opcode prefixes. I've done that. Tricky though.