Changeset 602 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
May 9, 2019, 8:11:46 PM (5 years ago)
Author:
krille_n_
Message:

Changes:

  • SerDrive: Fixed a bug that prevented use of 3.5" 720 KB floppy disk images.
  • Also added support for Microsoft DMF (Distribution Media Format) floppy disk images.
  • XTIDECFG / Library: Minor size optimizations. Added a new macro (SKIP1B) as part of that.
  • BIOS: A small size optimization (2 bytes) to MODULE_8BIT_IDE_ADVANCED that is enabled only when USE_NEC_V is defined.
Location:
trunk/Assembly_Library
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Macros.inc

    r596 r602  
    44%ifndef MACROS_INC
    55%define MACROS_INC
     6
     7
     8;--------------------------------------------------------------------
     9; Skips the immediately following 1 byte instruction by using it
     10; as an immediate value to a dummy instruction.
     11; Destroys the contents of %1.
     12;
     13; SKIP1B
     14;   Parameters:
     15;       %1:     Any 8 bit general purpose register or F for flags.
     16;   Returns:
     17;       Nothing
     18;   Corrupts registers:
     19;       %1
     20;--------------------------------------------------------------------
     21%macro SKIP1B 1.nolist
     22    %ifidni     %1, f
     23        db  03Ch                    ; Opcode byte for CMP AL, <immed>
     24        ;db 0A8h                    ; Alt. version TEST AL, <immed>
     25    %elifidni   %1, al
     26        db  0B0h                    ; Opcode byte for MOV AL, <immed>
     27    %elifidni   %1, ah
     28        db  0B4h                    ; Opcode byte for MOV AH, <immed>
     29    %elifidni   %1, bl
     30        db  0B3h                    ; Opcode byte for MOV BL, <immed>
     31    %elifidni   %1, bh
     32        db  0B7h                    ; Opcode byte for MOV BH, <immed>
     33    %elifidni   %1, cl
     34        db  0B1h                    ; Opcode byte for MOV CL, <immed>
     35    %elifidni   %1, ch
     36        db  0B5h                    ; Opcode byte for MOV CH, <immed>
     37    %elifidni   %1, dl
     38        db  0B2h                    ; Opcode byte for MOV DL, <immed>
     39    %elifidni   %1, dh
     40        db  0B6h                    ; Opcode byte for MOV DH, <immed>
     41    %else
     42        %error "Invalid parameter passed to SKIP1B"
     43    %endif
     44%endmacro
    645
    746;--------------------------------------------------------------------
  • trunk/Assembly_Library/Src/Keyboard/Keyboard.asm

    r592 r602  
    4444    push    cx
    4545
    46     mov     cx, BUFFER_SIZE_FOR_WORD_INPUT
    47     call    Memory_ReserveCXbytesFromStackToDSSI
     46    mov     cl, BUFFER_SIZE_FOR_WORD_INPUT
     47    call    Memory_ReserveCLbytesFromStackToDSSI
    4848
    4949    call    Char_GetFilterFunctionToDXforNumericBaseInBX
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r601 r602  
    612612    jz      SHORT ReturnWithoutHandlingKeystroke
    613613
    614     mov     cx, STRING_DIALOG_IO_size
    615     call    Memory_ReserveCXbytesFromStackToDSSI
     614    mov     cl, STRING_DIALOG_IO_size
     615    call    Memory_ReserveCLbytesFromStackToDSSI
    616616
    617617;;; InitializeStringDialogIoInDSSIforInputtingFileName
     
    682682
    683683    call    DisplayLoadingMessageInInformationArea
    684     mov     cx, DRIVE_DIALOG_IO_size
    685     call    Memory_ReserveCXbytesFromStackToDSSI
     684    mov     cl, DRIVE_DIALOG_IO_size
     685    call    Memory_ReserveCLbytesFromStackToDSSI
    686686    call    .DisplayDriveSelectionDialogWithIoInDSSI
    687687    call    .ChangeDriveToUserSelectionFromIoInDSSI
     
    741741    push    ss
    742742    pop     ds
    743     ePUSH_T ax, CURRENTDIR_CHARACTERS
     743    ePUSH_T ax, CURRENTDIR_CHARACTERS           ; The high byte is zero
    744744    mov     cx, FLG_FILEATTR_DIRECTORY
    745745    mov     dx, sp
  • trunk/Assembly_Library/Src/Util/Memory.asm

    r592 r602  
    122122
    123123;--------------------------------------------------------------------
     124; Memory_ReserveCLbytesFromStackToDSSI
    124125; Memory_ReserveCXbytesFromStackToDSSI
    125126;   Parameters
    126 ;       CX:     Number of bytes to reserve
     127;       CL/CX:  Number of bytes to reserve
    127128;   Returns:
    128129;       DS:SI:  Ptr to reserved buffer
     
    132133%ifndef EXCLUDE_FROM_XUB
    133134ALIGN JUMP_ALIGN
     135Memory_ReserveCLbytesFromStackToDSSI:
     136    xor     ch, ch
    134137Memory_ReserveCXbytesFromStackToDSSI:
    135138    pop     ax
  • trunk/Assembly_Library/Src/Util/Sort.asm

    r592 r602  
    3232;       ES:DI:  Ptr to second item to compare
    3333;   Returns:
    34 ;       FLAGS:  Signed comparition between first and second item
     34;       FLAGS:  Signed comparison between first and second item
    3535;   Corrupts registers:
    3636;       Nothing
     
    5656Sort_ItemsFromDSSIwithCountInDXsizeInCXandComparatorInBX:
    5757    push    es
    58     push    di
    59     mov     di, cx
    60     eSHL_IM cx, 1                       ; Reserve temp and pivot items
    61     add     cx, BYTE QSORT_PARAMS_size
    62     eENTER_STRUCT cx
    63     push    cx
     58    mov     ax, cx
     59    eSHL_IM ax, 1                       ; Reserve temp and pivot items
     60    add     ax, BYTE QSORT_PARAMS_size
     61    eENTER_STRUCT ax
     62    push    ax
    6463
    6564%ifdef CLD_NEEDED
    6665    cld
    6766%endif
    68     mov     cx, di                      ; Restore item size to CX
    6967    xor     ax, ax                      ; Zero starting index
    7068    dec     dx                          ; Count to index of last item
     
    7674    pop     ax
    7775    eLEAVE_STRUCT ax
    78     pop     di
    7976    pop     es
    8077    ret
Note: See TracChangeset for help on using the changeset viewer.