Hello Jonas,
Are you sure the error message is not that the selected *addressing* mode is not supported?
You cannot write to absolute addresses on most x86-64 platforms. Try using [rip + Selector_DS] instead.
Delphi 2 does not support x86-64.
No, the message does not refer to addressing mode. It refers to "assembler reader" (not mode as I incorrectly stated in the title).
Here is a bare bones example that reproduces the problem (code is in the attachment too):
{$APPTYPE CONSOLE}
program ConsoleAsmSelectorEntry;
uses
sysutils
;
procedure DoIt;
var
Selector_DS : word;
begin
{ we only get here when compiling for a 32bit target }
asm // it doesn't like this line
mov [Selector_DS], ds
end;
writeln('selector is : ', IntToHex(Selector_DS, 0));
end;
begin
DoIt;
writeln('Press <return>/<enter> to end this program');
readln;
end.
{ compiler error messages for target Win32 are: }
{
Compile Project, Mode: Win32, Target: lib\i386-win32\ConsoleAsmSelectorEntry.exe: Exit code 1, Errors: 1
ConsoleAsmSelectorEntry.lpr(16,3) Fatal: Selected assembler reader not supported
}
The program compiles fine with FPC for a 64bit target, won't compile for a 32bit target. Delphi 2 compiles it just fine (of course, 32bit target only since that's the only thing it can do.)
I attached the above code along with the Lazarus project files to provide the compile settings I am using.
The error message is:
Fatal: Selected assembler reader not supported
and I don't see why the compiler is emitting that error.
Thank you for looking at the problem.