More fixes to the extlinux installer; change back to writable types
[profile/ivi/syslinux.git] / rawcon.inc
1 ;
2 ; writechr:     Write a single character in AL to the console without
3 ;               mangling any registers.  This does raw console writes,
4 ;               since some PXE BIOSes seem to interfere regular console I/O.
5 ;
6 %if IS_ISOLINUX
7 writechr_full:
8 %else
9 writechr:
10 %endif
11                 push ds
12                 push cs
13                 pop ds
14                 call write_serial       ; write to serial port if needed
15                 pushfd
16                 pushad
17                 mov bh,[BIOS_page]
18                 push ax
19                 mov ah,03h              ; Read cursor position
20                 int 10h
21                 pop ax
22                 cmp al,8
23                 je .bs
24                 cmp al,13
25                 je .cr
26                 cmp al,10
27                 je .lf
28                 push dx
29                 mov bh,[BIOS_page]
30                 mov bl,07h              ; White on black
31                 mov cx,1                ; One only
32                 mov ah,09h              ; Write char and attribute
33                 int 10h
34                 pop dx
35                 inc dl
36                 cmp dl,[VidCols]
37                 jna .curxyok
38                 xor dl,dl
39 .lf:            inc dh
40                 cmp dh,[VidRows]
41                 ja .scroll
42 .curxyok:       mov bh,[BIOS_page]
43                 mov ah,02h              ; Set cursor position
44                 int 10h                 
45 .ret:           popad
46                 popfd
47                 pop ds
48                 ret
49 .scroll:        dec dh
50                 mov bh,[BIOS_page]
51                 mov ah,02h
52                 int 10h
53                 mov ax,0601h            ; Scroll up one line
54                 mov bh,[ScrollAttribute]
55                 xor cx,cx
56                 mov dx,[ScreenSize]     ; The whole screen
57                 int 10h
58                 jmp short .ret
59 .cr:            xor dl,dl
60                 jmp short .curxyok
61 .bs:            sub dl,1
62                 jnc .curxyok
63                 mov dl,[VidCols]
64                 sub dh,1
65                 jnc .curxyok
66                 xor dh,dh
67                 jmp short .curxyok
68