'*****************************************************************************
'* INT 10H AH=06h (CGA BIOS) SCROLL PAGE UP
'* PArams: AL - line count
'*         BH - attribute/bgcolor to fill
'*         CX - top-left corner
'*         DX - down-right corner
'*****************************************************************************

use module "Tools" 'cga tools

protected function Exec as boolean

//params
dim Page as byte=mem.Byte(0x462) 'video page
dim Left as integer=cpu.CL : dim Top as integer=cpu.CH 'left-top corner
dim Right as integer=cpu.DL : dim Bottom as integer=cpu.DH 'right-bottom corner
dim Lines as byte=cpu.AL 'rows/lines to scroll

//scrolling by -Lines count
if IsTextMode then
   result=ScrollTextRect(Page,Left,Top,Right,Bottom,-Lines,0,cpu.BH)
else 
   result=ScrollGraphRect(Page,Left,Top,Right,Bottom,-Lines,0,cpu.BH)
end if

end