git-svn-id: branches/i8086@24044 -
@@ -42,8 +42,12 @@ begin
regs.DS := DSeg;
regs.DX := Word(addr);
MsDos(regs);
- { TODO: add error checking }
- do_write := len;
+ if (regs.Flags and fCarry) <> 0 then
+ begin
+ GetInOutRes(regs.AX);
+ exit(0);
+ end;
+ do_write := regs.AX;
end;
@@ -90,6 +94,7 @@ begin
regs.AX := $4400;
regs.BX := handle;
do_isdevice := (regs.DL and $80) <> 0;
@@ -14,3 +14,21 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
+
+procedure GetInOutRes(def: Word);
+var
+ regs : Registers;
+begin
+ regs.AX:=$5900;
+ regs.BX:=$0;
+ MsDos(regs);
+ InOutRes:=regs.AX;
+ case InOutRes of
+ 19 : InOutRes:=150;
+ 21 : InOutRes:=152;
+ 32 : InOutRes:=5;
+ if InOutRes=0 then
+ InOutRes:=Def;
+end;
@@ -63,6 +63,9 @@ procedure DebugWriteLn(const S: string);
implementation
+const
+ fCarry = 1;
{$I registers.inc}
procedure Intr(IntNo: Byte; var Regs: Registers); external name 'FPC_INTR';