02-03-2025, 01:13 AM
(This post was last modified: 02-03-2025, 01:32 AM by Dale Yarker.)
" This method cannot be used when the target function has the following"
I don't see any ! PUSH register operands in your code (nor &h50 in the strings), so of course some things will fail.
I mentioned this before in PB Forum when it became clear you going to do it in any case.
from pb Help:
"There are special conditions with register preservation that apply when writing mixed assembler and BASIC code. PowerBASIC is a highly optimized compiler and among its optimizations are reductions in the stack overhead between BASIC code statements. Therefore, compiled PowerBASIC code is designed to expect that the EBX, ESI, and EDI registers will remain unchanged between lines of BASIC code.
This means that if your assembler algorithm uses any of the EBX, ESI, or EDI registers, you must preserve their original state from the last line of BASIC code that precedes the Inline Assembler code. This is, you must PUSH them before your ASM code, and POP them again right before the BASIC code commences." (bold added)
Memory addresses for jumps are also wrong because you're lifting code compiled with labels and putting it somewhere else where the relative address is different.
Have a nice day
I don't see any ! PUSH register operands in your code (nor &h50 in the strings), so of course some things will fail.
I mentioned this before in PB Forum when it became clear you going to do it in any case.
from pb Help:
"There are special conditions with register preservation that apply when writing mixed assembler and BASIC code. PowerBASIC is a highly optimized compiler and among its optimizations are reductions in the stack overhead between BASIC code statements. Therefore, compiled PowerBASIC code is designed to expect that the EBX, ESI, and EDI registers will remain unchanged between lines of BASIC code.
This means that if your assembler algorithm uses any of the EBX, ESI, or EDI registers, you must preserve their original state from the last line of BASIC code that precedes the Inline Assembler code. This is, you must PUSH them before your ASM code, and POP them again right before the BASIC code commences." (bold added)
Memory addresses for jumps are also wrong because you're lifting code compiled with labels and putting it somewhere else where the relative address is different.
Have a nice day