[41] | 1 | ; Project name : Assembly Library
|
---|
| 2 | ; Description : Character out function for printing withing menu window.
|
---|
| 3 |
|
---|
| 4 | ; Section containing code
|
---|
| 5 | SECTION .text
|
---|
| 6 |
|
---|
| 7 | ;--------------------------------------------------------------------
|
---|
[52] | 8 | ; MenuCharOut_MenuTeletypeOutputWithAutomaticLineChange
|
---|
| 9 | ; MenuCharOut_MenuTeletypeOutput
|
---|
[41] | 10 | ; Parameters:
|
---|
| 11 | ; AL: Character to output
|
---|
| 12 | ; AH: Attribute to output
|
---|
| 13 | ; DS: BDA segment (zero)
|
---|
| 14 | ; ES:DI: Ptr to video memory where to output
|
---|
[52] | 15 | ; [DISPLAY_CONTEXT.wCharOutParam]:
|
---|
| 16 | ; Low byte = First column offset (after CR)
|
---|
| 17 | ; High byte = Last column offset (when using automatic line change)
|
---|
[41] | 18 | ; Returns:
|
---|
| 19 | ; DI: Incremented for next character
|
---|
| 20 | ; Corrupts registers:
|
---|
| 21 | ; AX, DX
|
---|
| 22 | ;--------------------------------------------------------------------
|
---|
| 23 | ALIGN JUMP_ALIGN
|
---|
[52] | 24 | MenuCharOut_MenuTeletypeOutputWithAutomaticLineChange:
|
---|
| 25 | call CharOutLineSplitter_IsCursorAtTheEndOfTextLine
|
---|
| 26 | jnc SHORT MenuCharOut_MenuTeletypeOutput
|
---|
| 27 | cmp al, ' '
|
---|
| 28 | jb SHORT ReturnSinceNoNeedToStartLineWithControlCharacter
|
---|
| 29 | call CharOutLineSplitter_MovePartialWordToNewTextLine
|
---|
[48] | 30 | ; Fall to MenuCharOut_MenuTextTeletypeOutputWithAttribute
|
---|
| 31 |
|
---|
| 32 | ALIGN JUMP_ALIGN
|
---|
[52] | 33 | MenuCharOut_MenuTeletypeOutput:
|
---|
| 34 | cmp al, CR
|
---|
| 35 | je SHORT PrintCRandAdjustOffsetForStartOfLine
|
---|
[41] | 36 | jmp DisplayCharOut_TeletypeOutputWithAttribute
|
---|
| 37 |
|
---|
[48] | 38 |
|
---|
| 39 | ;--------------------------------------------------------------------
|
---|
[52] | 40 | ; MenuCharOut_PrintLFCRandAdjustOffsetForStartOfLine
|
---|
| 41 | ; PrintCRandAdjustOffsetForStartOfLine
|
---|
[48] | 42 | ; Parameters:
|
---|
| 43 | ; DS: BDA segment (zero)
|
---|
| 44 | ; ES:DI: Ptr to cursor location
|
---|
[52] | 45 | ; [DISPLAY_CONTEXT.wCharOutParam]:
|
---|
| 46 | ; Low byte = First column offset (after CR)
|
---|
| 47 | ; High byte = Last column offset (when using automatic line change)
|
---|
[48] | 48 | ; Returns:
|
---|
| 49 | ; ES:DI: Ptr to beginning of new line
|
---|
| 50 | ; Corrupts registers:
|
---|
| 51 | ; AX, DX
|
---|
| 52 | ;--------------------------------------------------------------------
|
---|
| 53 | ALIGN JUMP_ALIGN
|
---|
[52] | 54 | MenuCharOut_PrintLFCRandAdjustOffsetForStartOfLine:
|
---|
[48] | 55 | mov al, LF
|
---|
| 56 | call DisplayCharOut_BiosTeletypeOutput
|
---|
[52] | 57 | ; Fall to PrintCRandAdjustOffsetForStartOfLine
|
---|
[48] | 58 |
|
---|
| 59 | ALIGN JUMP_ALIGN
|
---|
[52] | 60 | PrintCRandAdjustOffsetForStartOfLine:
|
---|
| 61 | mov al, CR
|
---|
[48] | 62 | call DisplayCharOut_BiosTeletypeOutput
|
---|
[293] | 63 | eMOVZX ax, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]
|
---|
[52] | 64 | add di, ax
|
---|
| 65 | ReturnSinceNoNeedToStartLineWithControlCharacter:
|
---|
[41] | 66 | ret
|
---|