source: xtideuniversalbios/trunk/Assembly_Library/Src/Menu/MenuCharOut.asm@ 594

Last change on this file since 594 was 526, checked in by krille_n_@…, 12 years ago

Changes:

  • Update of the copyright notices to include the year 2013.
File size: 3.0 KB
RevLine 
[41]1; Project name : Assembly Library
[526]2; Description : Character out function for printing within menu window.
[41]3
[376]4;
[526]5; XTIDE Universal BIOS and Associated Tools
6; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
[376]7;
8; This program is free software; you can redistribute it and/or modify
9; it under the terms of the GNU General Public License as published by
10; the Free Software Foundation; either version 2 of the License, or
11; (at your option) any later version.
[526]12;
[376]13; This program is distributed in the hope that it will be useful,
14; but WITHOUT ANY WARRANTY; without even the implied warranty of
15; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[526]16; GNU General Public License for more details.
[376]17; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
18;
19
[526]20
[41]21; Section containing code
22SECTION .text
23
24;--------------------------------------------------------------------
[52]25; MenuCharOut_MenuTeletypeOutputWithAutomaticLineChange
26; MenuCharOut_MenuTeletypeOutput
[41]27; Parameters:
28; AL: Character to output
29; AH: Attribute to output
30; DS: BDA segment (zero)
31; ES:DI: Ptr to video memory where to output
[52]32; [DISPLAY_CONTEXT.wCharOutParam]:
33; Low byte = First column offset (after CR)
34; High byte = Last column offset (when using automatic line change)
[41]35; Returns:
36; DI: Incremented for next character
37; Corrupts registers:
38; AX, DX
39;--------------------------------------------------------------------
[369]40ALIGN MENU_JUMP_ALIGN
[52]41MenuCharOut_MenuTeletypeOutputWithAutomaticLineChange:
42 call CharOutLineSplitter_IsCursorAtTheEndOfTextLine
43 jnc SHORT MenuCharOut_MenuTeletypeOutput
44 cmp al, ' '
45 jb SHORT ReturnSinceNoNeedToStartLineWithControlCharacter
46 call CharOutLineSplitter_MovePartialWordToNewTextLine
[48]47 ; Fall to MenuCharOut_MenuTextTeletypeOutputWithAttribute
48
[369]49ALIGN MENU_JUMP_ALIGN
[52]50MenuCharOut_MenuTeletypeOutput:
51 cmp al, CR
52 je SHORT PrintCRandAdjustOffsetForStartOfLine
[41]53 jmp DisplayCharOut_TeletypeOutputWithAttribute
54
[48]55
56;--------------------------------------------------------------------
[52]57; MenuCharOut_PrintLFCRandAdjustOffsetForStartOfLine
58; PrintCRandAdjustOffsetForStartOfLine
[48]59; Parameters:
60; DS: BDA segment (zero)
61; ES:DI: Ptr to cursor location
[52]62; [DISPLAY_CONTEXT.wCharOutParam]:
63; Low byte = First column offset (after CR)
64; High byte = Last column offset (when using automatic line change)
[48]65; Returns:
66; ES:DI: Ptr to beginning of new line
67; Corrupts registers:
68; AX, DX
69;--------------------------------------------------------------------
[369]70ALIGN MENU_JUMP_ALIGN
[52]71MenuCharOut_PrintLFCRandAdjustOffsetForStartOfLine:
[48]72 mov al, LF
73 call DisplayCharOut_BiosTeletypeOutput
[52]74 ; Fall to PrintCRandAdjustOffsetForStartOfLine
[48]75
[369]76ALIGN MENU_JUMP_ALIGN
[52]77PrintCRandAdjustOffsetForStartOfLine:
78 mov al, CR
[48]79 call DisplayCharOut_BiosTeletypeOutput
[293]80 eMOVZX ax, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]
[52]81 add di, ax
82ReturnSinceNoNeedToStartLineWithControlCharacter:
[41]83 ret
Note: See TracBrowser for help on using the repository browser.