added DebugWrite and DebugWriteLn to the minimal msdos rtl

git-svn-id: branches/i8086@23753 -
This commit is contained in:
nickysn 2013-03-09 18:29:23 +00:00
parent 1937ef8300
commit 2393cd5eef
2 changed files with 29 additions and 10 deletions

View File

@ -3,25 +3,19 @@
cpu 8086
segment text use16
extern PASCALMAIN
..start:
mov ax, dgroup
mov ss, ax
mov sp, stacktop
mov ds, ax
mov es, ax
jmp PASCALMAIN
segment data use16
segment stack stack
resb 1024
resb 4096
stacktop:
segment bss
group dgroup data bss stack
group dgroup stack

View File

@ -7,6 +7,9 @@ interface
type
HRESULT = LongInt;
procedure DebugWrite(const S: string);
procedure DebugWriteLn(const S: string);
implementation
procedure fpc_Initialize_Units;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc;
@ -21,4 +24,26 @@ begin
end;
end;
procedure DebugWrite(const S: string);
begin
asm
mov si, S
lodsb
mov cl, al
xor ch, ch
mov ah, 2
@@1:
lodsb
mov dl, al
int 21h
loop @@1
end;
end;
procedure DebugWriteLn(const S: string);
begin
DebugWrite(S);
DebugWrite(#13#10);
end;
end.