PROGRAM TextSeiten;

VAR PageOffset,i : WORD;

PROCEDURE SetBlink(On : BOOLEAN); Assembler;
ASM
 mov ax,1003h
 mov bl,On
 int 10h
END;

PROCEDURE TextPage(Nummer : WORD); Assembler;
ASM
 mov ax,Nummer
 mov bx,2000
 mul bx
 mov PageOffset,ax

 mov dx,03d4h
 mov ah,BYTE PTR PageOffset
 mov al,0dh
 out dx,ax

 mov ah,BYTE PTR PageOffset+1
 mov al,0ch
 out dx,ax
END;

PROCEDURE ClearScreen(Attribut : BYTE); Assembler;
ASM
 mov ax,0b800h
 mov es,ax
 xor di,di

 mov ah,Attribut
 mov al,20h

 mov cx,16000
 rep stosw
END;

PROCEDURE WriteXY(x,y : WORD; Attribut : BYTE; s : STRING); Assembler;
ASM
 mov ax,y
 dec ax
 mov bx,160
 mul bx
 dec x
 shl x,1
 add ax,x
 mov di,PageOffset
 shl di,1
 add di,ax
 mov ax,0b800h
 mov es,ax
 push ds
  lds si,s
  xor cx,cx
  mov cl,[si]
  inc si
  mov al,Attribut
  @Loop:
   movsb
   stosb
  Loop @Loop
 pop ds
END;

BEGIN
 SetBlink(FALSE);
 ClearScreen($f0);
 TextPage(3);
 WriteXY(64,25,$f0,'Hallo Welt :) !!!');
 ReadLn;
END.
