-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFONT.C
76 lines (68 loc) · 960 Bytes
/
FONT.C
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
unsigned font_seg,font_off;
void init_font(void)
{
asm {
push bp
push es
mov ax,01130h
mov bh,03h
int 10h
mov font_seg,es
mov font_off,bp
pop es
pop bp }
}
void put_char(char ascii_code,int x,int y,
unsigned char color,unsigned char *where)
{
asm {
push ds
push es
mov si,font_off
mov ds,font_seg
les di,where
mov ax,y
mov bx,ax
shl ax,6
shl bx,8
add ax,bx
add ax,x
add di,ax
xor ah,ah
mov al,ascii_code
shl ax,3
add si,ax
mov dl,color
mov ch,8 }
ver:
asm {
lodsb
mov cl,8 }
hor:
asm {
rcl al,1
jae next
mov byte ptr es:[di],dl }
next:
asm {
inc di
dec cl
jnz hor
add di,312
inc dl
dec ch
jnz ver
pop es
pop ds }
}
void put_string(char *text,int x,int y,
unsigned char color,unsigned char *where)
{
int i=0;
while(text[i])
{
put_char(text[i],x,y,color,where);
i++;
x+=8;
}
}