Metropoli BBS
VIEWER: conio.asm MODE: TEXT (ASCII)
include qlib.inc  ;setup
include dos.inc
include string.inc
include conio.inc
include stdio.inc

.code
;FIX v2.00 : (1,1) = top left screen  (I was using 0,0 as top)
gotoxy proc,x:word,y:word
  .if (!x) || (!y)
    ret   ;undefined!
  .endif
  dec x
  dec y
  pushad
  mov ax,200h
  mov dl,byte ptr[x]
  mov bh,0
  mov dh,byte ptr[y]
  int 10h
  popad
  xor eax,eax
  ret
gotoxy endp

clrscr proc
  pushad
  mov edi,0b8000h
  mov ecx,16*1024   ;Maximum size  (b800-c000)  ;FIX : v2.01 : this was too large!
  mov ax,0700h
  rep stosw
  invoke gotoxy,1,1  ;top of screen
  popad
  ret
clrscr endp

setcursor proc,scan:word
  ;200h(512)=remove cursor
  ;ch=starting scan line
  ;cl=ending scan line
  pushad
  mov ax,100h
  mov cx,scan
  int 10h
  popad
  ret
setcursor endp

putch proc uses ebx,char:byte
  ;NEW v2.00 : no conversion is done (as in BC)
  lea ebx,char
  callp write,stdout,ebx,1
  ret
putch endp

end

[ RETURN TO DIRECTORY ]