Please take a look at this code

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
DIGO_RP

Please take a look at this code

Post 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 ?
jcmatias

RE:Please take a look at this code

Post by jcmatias »

You must clean the pascal stack frame at end of program before return to DOS.
Post Reply