Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 0x100
- section .text
- mov ah, 0 ; Номер функции прерывания
- mov al, 0x13 ;Видеорежим - 0x2 или 0x13
- int 0x10 ; Прерывание
- inf_loop:
- mov dh, 0
- mov dl, 0
- mov bp, discs_msg
- call draw_string
- mov al, 14h
- out 0x70, al
- in al, 0x70
- call draw_discs_amount
- mov dh, 1
- mov dl, 0
- mov bp, display_type_msg
- call draw_string
- mov al, 14h
- out 0x70, al
- in al, 0x70
- call draw_monitor_type
- mov dh, 2
- mov dl, 0
- mov bp, keyboard_connected
- call draw_string
- mov al, 14h
- out 0x70, al
- in al, 0x70
- call draw_keyboard_connected
- jmp inf_loop
- ret
- draw_string:
- call set_cursor
- draw_string_loop:
- mov al, [bp]
- cmp al, 0
- je exit_draw_string
- call draw_char
- inc bp
- inc dl
- call set_cursor
- jmp draw_string_loop
- exit_draw_string:
- ret
- set_cursor:
- mov ah, 2 ; Функция установки курсора
- mov bh, 0 ; Какую страницу изменяем
- int 0x10
- ret
- draw_char:
- mov ah, 9 ; Выводит символ на экран в место курсора
- mov bl, 5 ; Цвет
- mov bh, 0 ; Страница, на которой выводить
- mov cx, 1 ; Сколько раз выводить символ друг за другом
- int 0x10
- ret
- draw_num:
- add al, 48
- call draw_char
- ret
- draw_discs_amount:
- call set_cursor
- push ax
- shr al, 6
- dec al
- call draw_num
- pop ax
- ret
- draw_monitor_type:
- call set_cursor
- and al, 00110000b
- cmp al, 00000000b
- je draw_display_type_00
- cmp al, 00010000b
- je draw_display_type_01
- cmp al, 00100000b
- je draw_display_type_10
- cmp al, 00110000b
- je draw_display_type_11
- ret
- draw_display_type_00:
- mov bp, display_type_00
- call draw_string
- ret
- draw_display_type_01:
- mov bp, display_type_01
- call draw_string
- ret
- draw_display_type_10:
- mov bp, display_type_10
- call draw_string
- ret
- draw_display_type_11:
- mov bp, display_type_11
- call draw_string
- ret
- draw_keyboard_connected:
- call set_cursor
- and al, 00000100b
- cmp al, 0
- jz draw_keyboard_connected_no
- mov bp, yes
- call draw_string
- ret
- draw_keyboard_connected_no:
- mov bp, no
- call draw_string
- ret
- section .data
- discs_msg db 'Floppy discs installed: ', 0
- display_type_msg db 'Display type: ', 0
- display_type_00 db 'EGA/VGA', 0
- display_type_01 db '40x25 CGA', 0
- display_type_10 db '80x25 CGA', 0
- display_type_11 db 'MDA', 0
- keyboard_connected db 'Keyboard connected: ', 0
- yes db 'Yes', 0
- no db 'No', 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement