Changeset 45 in xtideuniversalbios for trunk/Assembly_Library/Src/LibraryTests.asm


Ignore:
Timestamp:
Sep 29, 2010, 5:59:07 PM (14 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to assembly library:
Changed SetCharOutputFunctionFromAXwithAttribFlagInDL to SetCharOutputFunctionFromAXwithAttribFlagInBL since DX register gets corrupted by Display_FunctionFromDI.
Implemented quicksort.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/LibraryTests.asm

    r44 r45  
    3333    CALL_DISPLAY_LIBRARY ClearScreen
    3434
    35     call    LibraryTests_ForDisplayLibrary
     35    call    LibraryTests_Sort
     36    ;call   LibraryTests_ForDisplayLibrary
    3637    ;call   LibraryTests_ForKeyboardLibrary
    37     call    LibraryTests_ForMenuLibrary
     38    ;call   LibraryTests_ForMenuLibrary
    3839
    3940    ; Exit to DOS
     
    254255    mov     ax, si
    255256    CALL_DISPLAY_LIBRARY SetCharacterPointerFromBXAX
    256     mov     dl, ATTRIBUTES_NOT_USED
     257    mov     bl, ATTRIBUTES_NOT_USED
    257258    mov     ax, BUFFER_OUTPUT_WITH_CHAR_ONLY
    258     CALL_DISPLAY_LIBRARY SetCharOutputFunctionFromAXwithAttribFlagInDL
     259    CALL_DISPLAY_LIBRARY SetCharOutputFunctionFromAXwithAttribFlagInBL
    259260    lea     ax, [si+STRING_BUFFER_SIZE]
    260261    CALL_DISPLAY_LIBRARY SetCharacterOutputParameterFromAX
     
    551552.szRepeat:
    552553    db  "Repeating character '-':                   %A%t",LF,CR,NULL
    553        
     554
     555
     556;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     557LibraryTests_Sort:
     558    call    .PrintWords
     559    push    cs
     560    pop     ds
     561    mov     si, .rgwItems
     562    mov     dx, 7
     563    mov     cx, 2
     564    mov     bx, .Comparator
     565    call    Sort_ItemsFromDSSIwithCountInDXsizeInCXandComparatorInBX
     566    call    .PrintWords
     567    ret
     568
     569
     570.Comparator:
     571    push    ax
     572    mov     ax, [si]
     573    ;DISPLAY_DEBUG_CHARACTER 'I'
     574    ;DISPLAY_DEBUG_WORD_AND_WAIT_ANY_KEY ax, 10
     575    ;DISPLAY_DEBUG_CHARACTER ','
     576    ;DISPLAY_DEBUG_WORD_AND_WAIT_ANY_KEY [es:di], 10
     577    ;DISPLAY_DEBUG_CHARACTER ' '
     578    cmp     ax, [es:di]
     579    pop     ax
     580    ret
     581
     582.PrintWords:
     583    CALL_DISPLAY_LIBRARY PrintNewlineCharacters
     584    mov     cx, 7
     585    push    cs
     586    pop     ds
     587    mov     si, .rgwItems
     588    mov     bx, 10
     589.Loop:
     590    lodsw
     591    CALL_DISPLAY_LIBRARY PrintSignedWordFromAXWithBaseInBX
     592    CALL_DISPLAY_LIBRARY PrintNewlineCharacters
     593    loop    .Loop
     594    ret
     595
     596
     597.rgwItems:
     598    dw      435
     599    dw      -31551
     600    dw      345
     601    dw      0
     602    dw      -18
     603    dw      23
     604    dw      435
     605
    554606
    555607
Note: See TracChangeset for help on using the changeset viewer.