Why does far call "call far ptr label" MASM syntax not work as intended?

124 Views Asked by At

I have been trying to set up a 0x9A, absolute far call using MASM syntax in 32 bit mode and despite my code assembling succesfully, the result will always be call far 0:0. The valid MASM syntax call far ptr label seems to always zero the operands (9A 00000000 0000). I couldn't find an answer for this online. I have tried calling a label like this from different ".code" pages and the result is always call far 0:0. Why does it always nullify the operands?

All of my programs are based off the same .model type "flat, stdcall" and option casemap is set to :none.

.model flat, stdcall
option casemap :none

.code one

main proc far

call far ptr label_   ; intended MASM syntax for 0x9A call
call ExitProcess
main endp

.code two 

label_ proc far 

retf
label_ endp

end main

Which still assembles to

9A 00000000 0000   call far 0:0
E8 F4EFFFFF        call <project2._ExitProcess@4>
0000               add byte ptr ds:[eax],al
0000               add byte ptr ds:[eax],al
0000               add byte ptr ds:[eax],al
0

There are 0 best solutions below