Page 1 of 1

Please take a look at this code

Posted: Sun Aug 29, 2004 11:00 pm
by DIGO_RP
program test;
uses crt;
var
  F        : File of byte;
  FChar    : byte;
  Counter  : Word;

begin
  Clrscr;
  Counter := 0;
  Assign(F, 'c:\bp\bin\test.com');
  Reset(F);

  While not eof(F) do
  begin
    Read(F, FChar);
    Mem[$1000:$100+Counter] := FChar;
    Inc(Counter);
  end;

{ execute program }
  asm
    mov bx, 1000h
    mov ds, bx
    mov es, bx
    mov ss, bx
    xor sp, sp
    push es
    push 100h
    retf
  end;

  gotoxy(10,10);
  writeln('We´r back');
PS. The com program finish with ax = 4ch int 21h it´s simple com program compiled in TASM with tlink /tdc xxxx

this code sometime works sometimes it freeze! any idea ?

RE:Please take a look at this code

Posted: Mon Aug 30, 2004 11:00 pm
by jcmatias
You must clean the pascal stack frame at end of program before return to DOS.