Changeset 293 in xtideuniversalbios for trunk/Assembly_Library


Ignore:
Timestamp:
Mar 4, 2012, 1:33:52 AM (13 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Commit 1/2 (Library, Configurators and Serial Server):

  • Changed Emulate.inc so that making 286 and 386 versions now works. Additionally, only one processor type define is needed in the makefile.
  • Minor optimizations.
  • Fixed spelling and did some cleaning.
Location:
trunk/Assembly_Library
Files:
10 edited

Legend:

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

    r223 r293  
    11; Project name  :   Emulation library
    2 ; Description   :   Macros for emulating later x86 instruction with older
     2; Description   :   Macros for emulating later x86 instructions with older
    33;                   processors.
    4 ;                   Macros are used so optimized builds could be done
     4;                   Macros are used so optimized builds can be done
    55;                   easily for different processors.
    66;
     
    1010%define EMULATE_INC
    1111
    12 ; Defines for processor support. Unsupported instructions will be
    13 ; emulated using macros.
    14 ; If using 286, define USE_186 and USE_286
    15 ; If using 386, define USE_186, USE_286 and USE_386
     12; Defines for processor support (should be set in makefile).
     13; Unsupported instructions will be emulated using macros.
    1614; If AT class PC is used (instead of XT), define USE_AT
     15
    1716;%define USE_186                ; Define to use 18x/V20/V30 instructions
    1817;%define USE_286                ; Define to use 286 instructions
    1918;%define USE_386                ; Define to use 386 instructions
    2019;%define USE_AT                 ; Define for AT class machine
    21 ; Above defines should be set on makefile!
    22 
    23 CPU 8086                        ; Allow 8088/8086 instructions only
    24 %ifdef USE_186
    25 CPU 186                         ; Allow instructions up to 188/186/V20/V30
     20
     21%ifdef USE_386
     22    %define USE_286             ; Define to use 286 instructions
     23%endif
     24%ifdef USE_286
     25    %define USE_186             ; Define to use 18x/V20/V30 instructions
     26%endif
     27
     28%ifdef USE_386
     29    CPU 386                     ; Allow instructions up to 386
    2630%elifdef USE_286
    27 CPU 286                         ; Allow instructions up to 286
    28 %elifdef USE_386
    29 CPU 386                         ; Allow instructions up to 386
    30 %endif
     31    CPU 286                     ; Allow instructions up to 286
     32%elifdef USE_186
     33    CPU 186                     ; Allow instructions up to 188/186/V20/V30
     34%else
     35    CPU 8086                    ; Allow 8088/8086 instructions only
     36%endif
     37
    3138BITS 16                         ; Set 16 bit code generation
    3239
  • trunk/Assembly_Library/Src/File/FileIO.asm

    r133 r293  
    3636;   Returns:
    3737;       AX:     DOS error code if CF set
    38 ;       CF:     Clear if successfull
     38;       CF:     Clear if successful
    3939;               Set if error
    4040;   Corrupts registers:
     
    5959;       DS:SI:  Ptr to destination buffer
    6060;   Returns:
    61 ;       AX:     Number of bytes actually read if successfull (0 if at EOF before call)
     61;       AX:     Number of bytes actually read if successful (0 if at EOF before call)
    6262;               DOS error code if CF set
    63 ;       CF:     Clear if successfull
     63;       CF:     Clear if successful
    6464;               Set if error
    6565;   Corrupts registers:
     
    8383;   Returns:
    8484;       AX:     DOS error code if CF set
    85 ;       CF:     Clear if successfull
     85;       CF:     Clear if successful
    8686;               Set if error
    8787;   Corrupts registers:
     
    106106;       DS:SI:  Ptr to source buffer
    107107;   Returns:
    108 ;       AX:     Number of bytes actually written if successfull (EOF check)
     108;       AX:     Number of bytes actually written if successful (EOF check)
    109109;               DOS error code if CF set
    110 ;       CF:     Clear if successfull
     110;       CF:     Clear if successful
    111111;               Set if error
    112112;   Corrupts registers:
     
    131131;   Returns:
    132132;       AX:     DOS error code if CF set
    133 ;       CF:     Clear if successfull
     133;       CF:     Clear if successful
    134134;               Set if error
    135135;   Corrupts registers:
     
    200200;       DX:AX:  Signed file size (if CF cleared)
    201201;       AX:     DOS error code (if CF set)
    202 ;       CF:     Clear if successfull
     202;       CF:     Clear if successful
    203203;               Set if error
    204204;   Corrupts registers:
     
    257257;       DX:AX:  New file position in bytes from start of file (if CF cleared)
    258258;       AX:     DOS error code (if CF set)
    259 ;       CF:     Clear if successfull
     259;       CF:     Clear if successful
    260260;               Set if error
    261261;   Corrupts registers:
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r181 r293  
    173173
    174174    lds     si, [bp+DIALOG.fpDialogIO]
    175     eMOVZX  cx, BYTE [si+FILE_DIALOG_IO.bFileAttributes]
     175    eMOVZX  cx, [si+FILE_DIALOG_IO.bFileAttributes]
    176176    lds     si, [si+FILE_DIALOG_IO.fpFileFilterString]
    177177    call    Directory_UpdateDTAForFirstMatchForDSSIwithAttributesInCX
     
    518518    xor     ax, ax
    519519    stosb                       ; Terminate with NULL
    520     jmp     SHORT CloseFileDialogAfterSuccessfullSelection
     520    jmp     SHORT CloseFileDialogAfterSuccessfulSelection
    521521
    522522;--------------------------------------------------------------------
     
    617617    test    al, al      ; User cancellation?
    618618    jnz     SHORT ReturnWithoutHandlingKeystroke
    619     jmp     CloseFileDialogAfterSuccessfullSelection
     619    jmp     CloseFileDialogAfterSuccessfulSelection
    620620
    621621ALIGN JUMP_ALIGN
     
    646646    test    al, FLG_FILEDIALOG_DIRECTORY
    647647    jz      SHORT ReturnWithoutHandlingKeystroke
    648     ; Fall to CloseFileDialogAfterSuccessfullSelection
    649 
    650 ;--------------------------------------------------------------------
    651 ; CloseFileDialogAfterSuccessfullSelection
     648    ; Fall to CloseFileDialogAfterSuccessfulSelection
     649
     650;--------------------------------------------------------------------
     651; CloseFileDialogAfterSuccessfulSelection
    652652;   Parameters:
    653653;       SS:BP:  Ptr to DIALOG
     
    658658;--------------------------------------------------------------------
    659659ALIGN JUMP_ALIGN
    660 CloseFileDialogAfterSuccessfullSelection:
     660CloseFileDialogAfterSuccessfulSelection:
    661661    lds     di, [bp+DIALOG.fpDialogIO]
    662662    mov     BYTE [di+FILE_DIALOG_IO.bUserCancellation], FALSE
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogWord.asm

    r58 r293  
    8585GetWordFromUser:
    8686    lds     si, [bp+DIALOG.fpDialogIO]
    87     eMOVZX  bx, BYTE [si+WORD_DIALOG_IO.bNumericBase]
     87    eMOVZX  bx, [si+WORD_DIALOG_IO.bNumericBase]
    8888ALIGN JUMP_ALIGN
    8989.GetUserInputIntilValidOrCancelled:
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r223 r293  
    118118ALIGN JUMP_ALIGN
    119119MenuBorders_GetNumberOfMiddleCharactersToDX:
    120     eMOVZX  dx, BYTE [bp+MENUINIT.bWidth]
     120    eMOVZX  dx, [bp+MENUINIT.bWidth]
    121121    sub     dx, BYTE MENU_HORIZONTAL_BORDER_LINES
    122122    ret
     
    136136RefreshTitleBorders:
    137137    call    DrawTopBorderLine
    138     eMOVZX  cx, BYTE [bp+MENUINIT.bTitleLines]
     138    eMOVZX  cx, [bp+MENUINIT.bTitleLines]
    139139    jmp     SHORT DrawTextBorderLinesByCXtimes
    140140
     
    152152RefreshInformationBorders:
    153153    call    DrawSeparationBorderLine
    154     eMOVZX  cx, BYTE [bp+MENUINIT.bInfoLines]
     154    eMOVZX  cx, [bp+MENUINIT.bInfoLines]
    155155    jmp     SHORT DrawTextBorderLinesByCXtimes
    156156
  • trunk/Assembly_Library/Src/Menu/MenuCharOut.asm

    r104 r293  
    6161    mov     al, CR
    6262    call    DisplayCharOut_BiosTeletypeOutput
    63     eMOVZX  ax, BYTE [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]
     63    eMOVZX  ax, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]
    6464    add     di, ax
    6565ReturnSinceNoNeedToStartLineWithControlCharacter:
  • trunk/Assembly_Library/Src/Menu/MenuLocation.asm

    r181 r293  
    114114ALIGN JUMP_ALIGN
    115115MenuLocation_GetMaxTextLineLengthToAX:
    116     eMOVZX  ax, BYTE [bp+MENUINIT.bWidth]
     116    eMOVZX  ax, [bp+MENUINIT.bWidth]
    117117    sub     ax, BYTE MENU_HORIZONTAL_BORDER_LINES + MENU_TEXT_COLUMN_OFFSET
    118118    ret
  • trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm

    r181 r293  
    245245ALIGN JUMP_ALIGN
    246246MenuScrollbars_GetMaxVisibleItemsOnPageToCX:
    247     eMOVZX  cx, BYTE [bp+MENUINIT.bHeight]
     247    eMOVZX  cx, [bp+MENUINIT.bHeight]
    248248    sub     cl, [bp+MENUINIT.bTitleLines]
    249249    sub     cl, [bp+MENUINIT.bInfoLines]
  • trunk/Assembly_Library/Src/Serial/SerialServer.asm

    r292 r293  
    33
    44%include "SerialServer.inc"
    5        
     5
    66; Section containing code
    77SECTION .text
    88
    99;--------------------------------------------------------------------
    10 ; SerialServer_SendReceive:     
     10; SerialServer_SendReceive:
    1111;   Parameters:
    1212;       DX:     Packed I/O port and baud rate
     
    2020;       AL, BX, CX, DX
    2121;--------------------------------------------------------------------
    22 SerialServer_SendReceive:       
    23        
     22SerialServer_SendReceive:
     23
    2424        push    si
    2525        push    di
     
    3737        mov     al,[bp+SerialServer_Command.bSectorCount]
    3838        mov     ah,[bp+SerialServer_Command.bCommand]
    39        
     39
    4040;
    4141; Command byte and sector count live at the top of the stack, pop/push are used to access
     
    4444        push    ax              ; working copy on the top of the stack
    4545
     46%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS   ; DF already cleared in Int13h.asm
    4647        cld
     48%endif
    4749
    4850;----------------------------------------------------------------------
     
    121123        jz      .zeroSectors
    122124%endif
    123        
     125
    124126;
    125127; Top of the read/write loop, one iteration per sector
     
    278280%endif
    279281        mov     ah, al          ;  for success, AL will already be zero
    280        
     282
    281283        pop     bx              ;  recover "ax" (command and count) from stack
    282284        pop     cx              ;  recover saved sector count
    283         mov     ch, 0
     285        xor     ch, ch
    284286        sub     cl, bl          ; subtract off the number of sectors that remained
    285287
     
    366368
    367369.writeTimeout1:
    368 %ifndef USE_186
    369         mov     ax,.writeByte1Ready
    370         push    ax              ; return address for ret at end of SC_writeTimeout2
    371 %else
    372         push    .writeByte1Ready
    373 %endif
     370        ePUSH_T ax, .writeByte1Ready    ; return address for ret at end of SC_writeTimeout2
    374371;;; fall-through
    375372
     
    381378;               One entry point fills in AH with 20h for write
    382379;       DX:     Port address (OK if already incremented to UART_lineStatus)
    383 ;       BX:     
     380;       BX:
    384381;       Stack:  2 words on the stack below the command/count word
    385382;   Returns:
     
    430427        pop     ax
    431428%endif
    432        
     429
    433430.WaitAndPoll:
    434431%ifndef SERIALSERVER_TIMER_LOCATION
     
    441438        pop     bx
    442439        pop     ax
    443 %endif     
     440%endif
    444441        jc      SerialServer_OutputWithParameters_ErrorAndPop4Words
    445442        in      al,dx
  • trunk/Assembly_Library/Src/String/String.asm

    r131 r293  
    3737;       CX:     Number of characters processed
    3838;       SI:     Updated
    39 ;       CF:     Cleared if successfull
     39;       CF:     Cleared if successful
    4040;               Set if error during conversion
    4141;   Corrupts registers:
Note: See TracChangeset for help on using the changeset viewer.