mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 16:49:31 +01:00
added DebugWrite and DebugWriteLn to the minimal msdos rtl
git-svn-id: branches/i8086@23753 -
This commit is contained in:
parent
1937ef8300
commit
2393cd5eef
@ -8,20 +8,14 @@
|
||||
|
||||
..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
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user