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

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

Removed align directives for initalization code and added define for align in boot-time calls to the assembly library (defaulting to 1), resulting in a significant savings for the AT and 386 builds. Fixed a bug with switch command line handling in the serial server. Put in CR characters in licesnse.txt, so that it properly displays on Windows. In the configurator, added default values for user supplied CHS and LBA values, defaulting to values within range when those features are enabled. Updated the copyright message in the configurator as the literal word Copyright is important.

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 DISPLAY_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 DISPLAY_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 DISPLAY_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.