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 cpu 8086
segment text use16 segment text use16
extern PASCALMAIN extern PASCALMAIN
..start: ..start:
mov ax, dgroup mov ax, dgroup
mov ss, ax mov ss, ax
mov sp, stacktop mov sp, stacktop
mov ds, ax mov ds, ax
mov es, ax mov es, ax
jmp PASCALMAIN jmp PASCALMAIN
segment data use16
segment stack stack segment stack stack
resb 1024 resb 4096
stacktop: stacktop:
segment bss group dgroup stack
group dgroup data bss stack

View File

@ -7,6 +7,9 @@ interface
type type
HRESULT = LongInt; HRESULT = LongInt;
procedure DebugWrite(const S: string);
procedure DebugWriteLn(const S: string);
implementation implementation
procedure fpc_Initialize_Units;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc; procedure fpc_Initialize_Units;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc;
@ -21,4 +24,26 @@ begin
end; end;
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. end.