source: xtideuniversalbios/trunk/Assembly_Library/Src/Display/DisplayPage.asm @ 194

Last change on this file since 194 was 194, checked in by gregli@…, 12 years ago

ifdef'd out more unused code. Also added a tool for looking through the listing and the output of the precompiler to aid in finding dead code. Some changes in the files are to add annotations for the tool to avoid false positives.

File size: 1.8 KB
Line 
1; Project name  :   Assembly Library
2; Description   :   Functions for managing display page.
3
4; Section containing code
5SECTION .text
6
7;--------------------------------------------------------------------
8; DisplayPage_SetFromAL
9;   Parameters:
10;       AL:     New display page
11;       DS:     BDA segment (zero)
12;   Returns:
13;       Nothing
14;   Corrupts registers:
15;       AX, DX
16;--------------------------------------------------------------------
17%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
18ALIGN JUMP_ALIGN
19DisplayPage_SetFromAL:
20    xor     ah, ah
21    mul     WORD [VIDEO_BDA.wBytesPerPage]      ; AX = Offset to page
22    mov     [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], ax
23    ret
24%endif
25
26
27;--------------------------------------------------------------------
28; DisplayPage_GetColumnsToALandRowsToAH
29;   Parameters:
30;       DS:     BDA segment (zero)
31;   Returns:
32;       AL:     Number of columns in selected text mode
33;       AH:     Number of rows in selected text mode
34;   Corrupts registers:
35;       Nothing
36;--------------------------------------------------------------------
37ALIGN JUMP_ALIGN
38DisplayPage_GetColumnsToALandRowsToAH:
39    mov     al, [VIDEO_BDA.wColumns]        ; 40 or 80
40    mov     ah, 25                          ; Always 25 rows on standard text modes
41    ret
42
43
44;--------------------------------------------------------------------
45; DisplayPage_SynchronizeToHardware
46;   Parameters:
47;       DS:     BDA segment (zero)
48;   Returns:
49;       Nothing
50;   Corrupts registers:
51;       AX, DX
52;--------------------------------------------------------------------
53ALIGN JUMP_ALIGN
54DisplayPage_SynchronizeToHardware:
55    xor     dx, dx
56    mov     ax, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition]
57    div     WORD [VIDEO_BDA.wBytesPerPage]  ; AX = Page
58
59    cmp     al, [VIDEO_BDA.bActivePage]
60    je      SHORT .Return                   ; Same page, no need to synchronize
61    mov     ah, SELECT_ACTIVE_DISPLAY_PAGE
62    int     BIOS_VIDEO_INTERRUPT_10h
63.Return:
64    ret
Note: See TracBrowser for help on using the repository browser.