|
@@ -1867,6 +1867,32 @@ implementation
|
|
|
(tloadnode(p1).symtableentry.name='MEMW') or
|
|
|
(tloadnode(p1).symtableentry.name='MEML')) then
|
|
|
begin
|
|
|
+{$if defined(i8086)}
|
|
|
+ if try_to_consume(_COLON) then
|
|
|
+ begin
|
|
|
+ p2:=ctypeconvnode.create_explicit(p2,u32inttype);
|
|
|
+ p3:=cshlshrnode.create(shln,p2,cordconstnode.create($10,s16inttype,false));
|
|
|
+ p2:=comp_expr(true,false);
|
|
|
+ p2:=caddnode.create(addn,p2,p3);
|
|
|
+ case tloadnode(p1).symtableentry.name of
|
|
|
+ 'MEM': p2:=ctypeconvnode.create_explicit(p2,bytefarpointertype);
|
|
|
+ 'MEMW': p2:=ctypeconvnode.create_explicit(p2,wordfarpointertype);
|
|
|
+ 'MEML': p2:=ctypeconvnode.create_explicit(p2,longintfarpointertype);
|
|
|
+ else
|
|
|
+ internalerror(2013053102);
|
|
|
+ end;
|
|
|
+ p1:=cderefnode.create(p2);
|
|
|
+ end
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ { TODO: fix, this is broken for now... }
|
|
|
+ if try_to_consume(_POINTPOINT) then
|
|
|
+ { Support mem[$80000000..$80000002] which returns array [0..2] of memtype.}
|
|
|
+ p2:=crangenode.create(p2,comp_expr(true,false));
|
|
|
+ p1:=cvecnode.create(p1,p2);
|
|
|
+ include(tvecnode(p1).flags,nf_memindex);
|
|
|
+ end;
|
|
|
+{$elseif defined(i386)}
|
|
|
if try_to_consume(_COLON) then
|
|
|
begin
|
|
|
p3:=caddnode.create(muln,cordconstnode.create($10,s32inttype,false),p2);
|
|
@@ -1887,6 +1913,9 @@ implementation
|
|
|
p1:=cvecnode.create(p1,p2);
|
|
|
include(tvecnode(p1).flags,nf_memindex);
|
|
|
end;
|
|
|
+{$else}
|
|
|
+ internalerror(2013053101);
|
|
|
+{$endif}
|
|
|
end
|
|
|
else
|
|
|
begin
|