This repository was archived by the owner on Jun 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patho1.asm
106 lines (98 loc) · 1.64 KB
/
o1.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.model tiny
.code
.386
org 100h
start:
mov ah, 0fh ; “§ ñ¬ áâà ¨ç¥çªã, ¨ ¢¨¤¥®à¥¦¨¬ç¨ª
int 10h
mov byte ptr sc_width, ah
mov byte ptr video_mode, al
mov byte ptr video_page, bh
sub ah, 31
shr ah, 1
mov byte ptr first_pos, ah
cmp al, 3
jg maybe_not_text_mode
mov bl, 1eh
it_is_text_mode:
mov ah, 0h
mov al, byte ptr video_mode
int 10h
xor dx, dx
mov al, byte ptr sc_width
mov cl, 25
mul cl
mov cx, ax
mov ax, 0920h
int 10h
mov bh, byte ptr video_page
mov ah, 02h ; áâ ¢¨¬ ªãàá®à稪
mov dh, 04h
mov dl, byte ptr first_pos
int 10h
mov al, 0
mov cx, 16
print_next:
push cx ; ¯¨è¥¬
mov ah, 09h
mov cx, 1
int 10h
mov ah, 02h ; ¤¢¨£ ¥¬áï
inc dl
int 10h
push ax ; ¯¨è¥¬
mov ah, 09h
mov cx, 1
mov al ,20h
int 10h
pop ax
mov ah, 02h ; ¤¢¨£ ¥¬áï
inc dl
int 10h
inc al
test al, al
je exit
pop cx
loop print_next
mov cx, 16 ; § àï¦ ¥¬áï ®¢ãî áâà®ç¥çªã
inc dh
mov dl, byte ptr first_pos
mov ah, 02
int 10h
jmp print_next
exit:
mov dl, 0
mov dh, 25
mov ah, 02h
int 10h
mov ah, 05h
mov al, byte ptr video_page
int 10h
mov ah, 0h
int 16h
mov ax, 0h
mov al, byte ptr video_mode
int 10h
mov ah, 05h
mov al, byte ptr video_page
int 10h
int 20h
maybe_not_text_mode:
mov bl, 70h
cmp al, 07h
je it_is_text_mode
mov bl, 1eh
cmp al, 0bh
je it_is_text_mode
cmp al, 0ch
je it_is_text_mode
mov ah, 09h
mov dx, offset error
int 21h
ret
error db ' ¡®â ¥â ⮫쪮 ¢ ⥪á⮢ëå ०¨¬ å', 24h
sc_width db ?
first_pos db ?
video_mode db ?
video_page db ?
end start