diff --git a/.gitattributes b/.gitattributes
index 07b21207f8..81d508e2b5 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -13706,6 +13706,7 @@ tests/webtbf/tw18058b.pp svneol=native#text/plain
 tests/webtbf/tw18058c.pp svneol=native#text/plain
 tests/webtbf/tw18096.pp svneol=native#text/pascal
 tests/webtbf/tw18096c.pp svneol=native#text/pascal
+tests/webtbf/tw18225b.pp svneol=native#text/pascal
 tests/webtbf/tw18267.pp svneol=native#text/plain
 tests/webtbf/tw1827.pp svneol=native#text/plain
 tests/webtbf/tw1830.pp svneol=native#text/plain
@@ -14619,6 +14620,7 @@ tests/webtbs/tw18127.pp svneol=native#text/pascal
 tests/webtbs/tw18131.pp svneol=native#text/pascal
 tests/webtbs/tw1820.pp svneol=native#text/plain
 tests/webtbs/tw18222.pp svneol=native#text/pascal
+tests/webtbs/tw18225.pp svneol=native#text/pascal
 tests/webtbs/tw1825.pp svneol=native#text/plain
 tests/webtbs/tw18266.pp svneol=native#text/plain
 tests/webtbs/tw18334.pp svneol=native#text/plain
diff --git a/compiler/x86/rax86int.pas b/compiler/x86/rax86int.pas
index b476bbca85..22852c8bea 100644
--- a/compiler/x86/rax86int.pas
+++ b/compiler/x86/rax86int.pas
@@ -1842,7 +1842,10 @@ Unit Rax86int;
                       Message(asmr_e_syn_operand);
                   end;
                 Consume(AS_PTR);
-                oper.InitRef;
+                { in delphi mode, allow e.g. call dword ptr eax,
+                  see also webtbs/tw18225.pp }
+                if not(m_delphi in current_settings.modeswitches) then
+                  oper.InitRef;
                 { if the operand subscripts a record, the typesize will be
                   rest -> save it here and restore it afterwards }
                 l:=oper.typesize;
diff --git a/tests/webtbf/tw18225b.pp b/tests/webtbf/tw18225b.pp
new file mode 100644
index 0000000000..6e8a19360c
--- /dev/null
+++ b/tests/webtbf/tw18225b.pp
@@ -0,0 +1,10 @@
+{ %fail }
+{ %cpu=i386,x86_64 }
+{$asmmode intel}
+procedure CallProc(p: pointer); assembler;
+asm
+          call dword ptr p
+          call dword ptr CallProc
+end; { CallProc }
+begin
+end.
diff --git a/tests/webtbs/tw18225.pp b/tests/webtbs/tw18225.pp
new file mode 100644
index 0000000000..72e41b58a2
--- /dev/null
+++ b/tests/webtbs/tw18225.pp
@@ -0,0 +1,10 @@
+{ %cpu=i386,x86_64 }
+{$mode delphi}
+{$asmmode intel}
+procedure CallProc(p: pointer); assembler;
+asm
+          call dword ptr p
+          call dword ptr CallProc
+end; { CallProc }
+begin
+end.