program findlpt; { from address 40:008 } const MAXLPT = 3; type nybble = 0..$F; var lpt: array[1..MAXLPT] of Integer; index: 1..MAXLPT; function dec2hex(n: nybble): char; begin if n <10 then dec2hex := chr(n+ord('0')) else dec2hex := chr(n-10+ord('A')) end; begin { main } for index := 1 to MAXLPT do begin lpt[index] := MemW[$40:$008+(index-1)*2]; if lpt[index] = 0 then writeln('LPT',index:1,' not found') else writeln('LPT',index:1,' found at ', dec2hex((lpt[index] div 256) div 16), dec2hex((lpt[index] div 256) mod 16), dec2hex((lpt[index] mod 256) div 16), dec2hex((lpt[index] mod 256) mod 16),'H') end end.
What's all this $40:$008 stuff ? - see A note on 8086/88 Memory Segmentation
last updated: 12-Mar-97 Ian Harries <ih@doc.ic.ac.uk>