mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-07 22:34:22 +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
@ -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
|
|
||||||
|
|||||||
@ -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.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user