From e7454f87d1eb7765ff82fec3eb4e5b6b94f10a38 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Mon, 2 Mar 2026 18:23:22 -0600 Subject: [PATCH] Fix LES instruction: Delphi 1.0 inline ASM can't resolve object fields Replace 'les di, FGlyphBuf' with explicit GlyphBase/GlyphSeg locals that are extracted in Pascal before the ASM block. Co-Authored-By: Claude Opus 4.6 --- delphi/KPANSI.PAS | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/delphi/KPANSI.PAS b/delphi/KPANSI.PAS index 17e7c68..78460f9 100644 --- a/delphi/KPANSI.PAS +++ b/delphi/KPANSI.PAS @@ -2123,6 +2123,7 @@ var I: Integer; Ofs: Integer; GlyphSeg: Word; + GlyphBase: Word; { Offset component of FGlyphBuf (nibble table at +0) } PixSeg: Word; GlyphOfs: Word; PixOfs: Word; @@ -2137,9 +2138,10 @@ begin Stride := Word(FCols) * Word(FCellWidth); CellH := FCellHeight; - { Extract segments from far pointers -- pure Pascal, no register clobber } - GlyphSeg := Seg(PPixelBuf(FGlyphBuf)^); - PixSeg := Seg(PPixelBuf(FRowBuf)^); + { Extract segments/offsets from far pointers -- pure Pascal, no register clobber } + GlyphSeg := Seg(PPixelBuf(FGlyphBuf)^); + GlyphBase := Ofs(PPixelBuf(FGlyphBuf)^); + PixSeg := Seg(PPixelBuf(FRowBuf)^); { Determine which line to render (handles scrollback view) } if FScrollPos <> 0 then @@ -2251,7 +2253,8 @@ begin push di push bx push es - les di, FGlyphBuf + mov es, GlyphSeg + mov di, GlyphBase mov al, BGIdx mov ah, al { AX = BG:BG } mov dl, FGIdx