Changeset 186 in xtideuniversalbios for trunk/Assembly_Library/Src
- Timestamp:
- Nov 15, 2011, 10:35:17 AM (13 years ago)
- google:author:
- gregli@hotmail.com
- Location:
- trunk/Assembly_Library/Src
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/AssemblyLibrary.asm
r172 r186 13 13 %include "DisplayCursor.asm" 14 14 %include "DisplayPage.asm" 15 %include "DisplayPrint.asm" 16 %include "DisplayFormat.asm" 15 %include "DisplayPrint.asm" ; must come before DisplayFormat/DisplayFormatCompressed 16 %ifdef MODULE_STRINGS_COMPRESSED 17 %include "DisplayFormatCompressed.asm" 18 %else 19 %include "DisplayFormat.asm" 20 %endif 17 21 %endif 18 22 -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r181 r186 5 5 SECTION .text 6 6 7 7 8 ;-------------------------------------------------------------------- 8 9 ; Supports following formatting types: … … 61 62 pop si 62 63 pop bp 64 63 65 ret 64 66 … … 102 104 ; AX, DX 103 105 ;-------------------------------------------------------------------- 106 107 %ifndef MODULE_STRINGS_COMPRESSED 108 104 109 ALIGN JUMP_ALIGN 105 110 DisplayPrint_WordFromAXWithBaseInBX: … … 131 136 .rgcDigitToCharacter: db "0123456789ABCDEF" 132 137 138 %endif ; MODULE_STRINGS_COMPRESSED 139 133 140 134 141 ;-------------------------------------------------------------------- … … 165 172 166 173 167 ;--------------------------------------------------------------------168 ; DisplayPrint_NullTerminatedStringFromCSSI169 ; Parameters:170 ; CS:SI: Ptr to NULL terminated string171 ; DS: BDA segment (zero)172 ; ES:DI: Ptr to cursor location in video RAM173 ; Returns:174 ; DI: Updated offset to video RAM175 ; Corrupts registers:176 ; AX, DX177 ;--------------------------------------------------------------------178 ALIGN JUMP_ALIGN179 DisplayPrint_NullTerminatedStringFromCSSI:180 push bx181 mov bx, cs182 call DisplayPrint_NullTerminatedStringFromBXSI183 pop bx184 ret185 186 187 ;--------------------------------------------------------------------188 ; DisplayPrint_NullTerminatedStringFromBXSI189 ; Parameters:190 ; DS: BDA segment (zero)191 ; BX:SI: Ptr to NULL terminated string192 ; ES:DI: Ptr to cursor location in video RAM193 ; Returns:194 ; DI: Updated offset to video RAM195 ; Corrupts registers:196 ; AX, DX197 ;--------------------------------------------------------------------198 ALIGN JUMP_ALIGN199 DisplayPrint_NullTerminatedStringFromBXSI:200 push si201 push cx202 203 xor cx, cx204 ALIGN JUMP_ALIGN205 .PrintNextCharacter:206 mov ds, bx ; String segment to DS207 lodsb208 mov ds, cx ; BDA segment to DS209 test al, al ; NULL?210 jz SHORT .EndOfString211 call DisplayPrint_CharacterFromAL212 jmp SHORT .PrintNextCharacter213 214 ALIGN JUMP_ALIGN215 .EndOfString:216 pop cx217 pop si218 ret219 174 220 175 … … 320 275 pop cx 321 276 .NothingToRepeat: 322 ret 323 277 278 ret 279 280 ;-------------------------------------------------------------------- 281 ; DisplayPrint_NullTerminatedStringFromCSSI 282 ; Parameters: 283 ; CS:SI: Ptr to NULL terminated string 284 ; DS: BDA segment (zero) 285 ; ES:DI: Ptr to cursor location in video RAM 286 ; Returns: 287 ; DI: Updated offset to video RAM 288 ; Corrupts registers: 289 ; AX, DX 290 ;-------------------------------------------------------------------- 291 292 %ifndef MODULE_STRINGS_COMPRESSED 293 ;;; 294 ;;; Take care when using this routine with compressed strings (which is why it is disabled). 295 ;;; All strings in CSSI should go through the DisplayFormatCompressed code to be decoded. 296 ;;; 297 ALIGN JUMP_ALIGN 298 DisplayPrint_NullTerminatedStringFromCSSI: 299 push bx 300 mov bx, cs 301 call DisplayPrint_NullTerminatedStringFromBXSI 302 pop bx 303 304 ret 305 %endif 306 307 308 309 310 ;;; 311 ;;; Note that the following routines need to be at the bottom of this file 312 ;;; to accomodate short jumps from the next file (DisplayFormat/DisplayFormatCompressed) 313 ;;; 324 314 325 315 ;-------------------------------------------------------------------- … … 333 323 ; AX, DX 334 324 ;-------------------------------------------------------------------- 335 ALIGN JUMP_ALIGN 325 %ifdef MODULE_STRINGS_COMPRESSED 326 ALIGN JUMP_ALIGN 327 DisplayPrint_Newline_FormatAdjustBP: 328 inc bp ; we didn't need a parameter after all, readjust BP 329 inc bp 330 ;;; fall-through 331 %endif 332 333 ALIGN JUMP_ALIGN 334 336 335 DisplayPrint_Newline: 337 336 mov al, LF … … 344 343 ; Parameters: 345 344 ; AL: Character to display 345 ; Zero value is ignored (no characer is printed) 346 346 ; DS: BDA segment (zero) 347 347 ; ES:DI: Ptr to cursor location in video RAM … … 353 353 ALIGN JUMP_ALIGN 354 354 DisplayPrint_CharacterFromAL: 355 %ifdef MODULE_STRINGS_COMPRESSED 356 test al,al 357 jz DisplayPrint_Ret 358 %endif 355 359 mov ah, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute] 356 360 jmp [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut] 361 362 363 364 ;-------------------------------------------------------------------- 365 ; DisplayPrint_NullTerminatedStringFromBXSI 366 ; Parameters: 367 ; DS: BDA segment (zero) 368 ; BX:SI: Ptr to NULL terminated string 369 ; ES:DI: Ptr to cursor location in video RAM 370 ; Returns: 371 ; DI: Updated offset to video RAM 372 ; Corrupts registers: 373 ; AX, DX 374 ;-------------------------------------------------------------------- 375 ALIGN JUMP_ALIGN 376 DisplayPrint_NullTerminatedStringFromBXSI: 377 push si 378 push cx 379 380 xor cx, cx 381 ALIGN JUMP_ALIGN 382 .PrintNextCharacter: 383 mov ds, bx ; String segment to DS 384 lodsb 385 mov ds, cx ; BDA segment to DS 386 test al, al ; NULL? 387 jz SHORT .EndOfString 388 call DisplayPrint_CharacterFromAL 389 jmp SHORT .PrintNextCharacter 390 391 ALIGN JUMP_ALIGN 392 .EndOfString: 393 pop cx 394 pop si 395 396 DisplayPrint_Ret: ; random ret to jump to 397 ret 398 399
Note:
See TracChangeset
for help on using the changeset viewer.