-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path35.asm
68 lines (45 loc) · 937 Bytes
/
35.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
[org 0x100]
jmp start
scrolldown:
;takes the number of lines to be scrolldown
push bp
mov bp, sp
;saving registers
push ax
push cx
push si
push di
push ds
push es
mov ax, 80 ;number of characters per row
mul byte [bp + 4] ;mulitiplying by number of lines
push ax ;savng number of lines for later use
shl ax, 1 ;turning into byte offset
mov si, 3998 ;moving last location of screen
sub si, ax ;calculating source position in ax
mov cx, 2000 ;moving number of locations
sub cx, ax ;count of words to move
mov ax, 0xb800
mov es, ax
mov ds, ax
mov di, 3998 ;point di to lower right coloumn
std ;set auto decrement mode
rep movsw
mov ax, 0x720
pop cx
rep stosw
pop es
pop ds
pop di
pop si
pop cx
pop ax
pop bp
ret 2
start:
mov ax, 5
push ax
call scrolldown
finish:
mov ax, 0x4c00
int 21h