Changeset 293 in xtideuniversalbios for trunk/Assembly_Library
- Timestamp:
- Mar 4, 2012, 1:33:52 AM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/Assembly_Library
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/Emulate.inc
r223 r293 1 1 ; Project name : Emulation library 2 ; Description : Macros for emulating later x86 instruction with older2 ; Description : Macros for emulating later x86 instructions with older 3 3 ; processors. 4 ; Macros are used so optimized builds c ouldbe done4 ; Macros are used so optimized builds can be done 5 5 ; easily for different processors. 6 6 ; … … 10 10 %define EMULATE_INC 11 11 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. 16 14 ; If AT class PC is used (instead of XT), define USE_AT 15 17 16 ;%define USE_186 ; Define to use 18x/V20/V30 instructions 18 17 ;%define USE_286 ; Define to use 286 instructions 19 18 ;%define USE_386 ; Define to use 386 instructions 20 19 ;%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 26 30 %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 31 38 BITS 16 ; Set 16 bit code generation 32 39 -
trunk/Assembly_Library/Src/File/FileIO.asm
r133 r293 36 36 ; Returns: 37 37 ; AX: DOS error code if CF set 38 ; CF: Clear if successful l38 ; CF: Clear if successful 39 39 ; Set if error 40 40 ; Corrupts registers: … … 59 59 ; DS:SI: Ptr to destination buffer 60 60 ; Returns: 61 ; AX: Number of bytes actually read if successful l(0 if at EOF before call)61 ; AX: Number of bytes actually read if successful (0 if at EOF before call) 62 62 ; DOS error code if CF set 63 ; CF: Clear if successful l63 ; CF: Clear if successful 64 64 ; Set if error 65 65 ; Corrupts registers: … … 83 83 ; Returns: 84 84 ; AX: DOS error code if CF set 85 ; CF: Clear if successful l85 ; CF: Clear if successful 86 86 ; Set if error 87 87 ; Corrupts registers: … … 106 106 ; DS:SI: Ptr to source buffer 107 107 ; Returns: 108 ; AX: Number of bytes actually written if successful l(EOF check)108 ; AX: Number of bytes actually written if successful (EOF check) 109 109 ; DOS error code if CF set 110 ; CF: Clear if successful l110 ; CF: Clear if successful 111 111 ; Set if error 112 112 ; Corrupts registers: … … 131 131 ; Returns: 132 132 ; AX: DOS error code if CF set 133 ; CF: Clear if successful l133 ; CF: Clear if successful 134 134 ; Set if error 135 135 ; Corrupts registers: … … 200 200 ; DX:AX: Signed file size (if CF cleared) 201 201 ; AX: DOS error code (if CF set) 202 ; CF: Clear if successful l202 ; CF: Clear if successful 203 203 ; Set if error 204 204 ; Corrupts registers: … … 257 257 ; DX:AX: New file position in bytes from start of file (if CF cleared) 258 258 ; AX: DOS error code (if CF set) 259 ; CF: Clear if successful l259 ; CF: Clear if successful 260 260 ; Set if error 261 261 ; Corrupts registers: -
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r181 r293 173 173 174 174 lds si, [bp+DIALOG.fpDialogIO] 175 eMOVZX cx, BYTE[si+FILE_DIALOG_IO.bFileAttributes]175 eMOVZX cx, [si+FILE_DIALOG_IO.bFileAttributes] 176 176 lds si, [si+FILE_DIALOG_IO.fpFileFilterString] 177 177 call Directory_UpdateDTAForFirstMatchForDSSIwithAttributesInCX … … 518 518 xor ax, ax 519 519 stosb ; Terminate with NULL 520 jmp SHORT CloseFileDialogAfterSuccessful lSelection520 jmp SHORT CloseFileDialogAfterSuccessfulSelection 521 521 522 522 ;-------------------------------------------------------------------- … … 617 617 test al, al ; User cancellation? 618 618 jnz SHORT ReturnWithoutHandlingKeystroke 619 jmp CloseFileDialogAfterSuccessful lSelection619 jmp CloseFileDialogAfterSuccessfulSelection 620 620 621 621 ALIGN JUMP_ALIGN … … 646 646 test al, FLG_FILEDIALOG_DIRECTORY 647 647 jz SHORT ReturnWithoutHandlingKeystroke 648 ; Fall to CloseFileDialogAfterSuccessful lSelection649 650 ;-------------------------------------------------------------------- 651 ; CloseFileDialogAfterSuccessful lSelection648 ; Fall to CloseFileDialogAfterSuccessfulSelection 649 650 ;-------------------------------------------------------------------- 651 ; CloseFileDialogAfterSuccessfulSelection 652 652 ; Parameters: 653 653 ; SS:BP: Ptr to DIALOG … … 658 658 ;-------------------------------------------------------------------- 659 659 ALIGN JUMP_ALIGN 660 CloseFileDialogAfterSuccessful lSelection:660 CloseFileDialogAfterSuccessfulSelection: 661 661 lds di, [bp+DIALOG.fpDialogIO] 662 662 mov BYTE [di+FILE_DIALOG_IO.bUserCancellation], FALSE -
trunk/Assembly_Library/Src/Menu/Dialog/DialogWord.asm
r58 r293 85 85 GetWordFromUser: 86 86 lds si, [bp+DIALOG.fpDialogIO] 87 eMOVZX bx, BYTE[si+WORD_DIALOG_IO.bNumericBase]87 eMOVZX bx, [si+WORD_DIALOG_IO.bNumericBase] 88 88 ALIGN JUMP_ALIGN 89 89 .GetUserInputIntilValidOrCancelled: -
trunk/Assembly_Library/Src/Menu/MenuBorders.asm
r223 r293 118 118 ALIGN JUMP_ALIGN 119 119 MenuBorders_GetNumberOfMiddleCharactersToDX: 120 eMOVZX dx, BYTE[bp+MENUINIT.bWidth]120 eMOVZX dx, [bp+MENUINIT.bWidth] 121 121 sub dx, BYTE MENU_HORIZONTAL_BORDER_LINES 122 122 ret … … 136 136 RefreshTitleBorders: 137 137 call DrawTopBorderLine 138 eMOVZX cx, BYTE[bp+MENUINIT.bTitleLines]138 eMOVZX cx, [bp+MENUINIT.bTitleLines] 139 139 jmp SHORT DrawTextBorderLinesByCXtimes 140 140 … … 152 152 RefreshInformationBorders: 153 153 call DrawSeparationBorderLine 154 eMOVZX cx, BYTE[bp+MENUINIT.bInfoLines]154 eMOVZX cx, [bp+MENUINIT.bInfoLines] 155 155 jmp SHORT DrawTextBorderLinesByCXtimes 156 156 -
trunk/Assembly_Library/Src/Menu/MenuCharOut.asm
r104 r293 61 61 mov al, CR 62 62 call DisplayCharOut_BiosTeletypeOutput 63 eMOVZX ax, BYTE[VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]63 eMOVZX ax, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam] 64 64 add di, ax 65 65 ReturnSinceNoNeedToStartLineWithControlCharacter: -
trunk/Assembly_Library/Src/Menu/MenuLocation.asm
r181 r293 114 114 ALIGN JUMP_ALIGN 115 115 MenuLocation_GetMaxTextLineLengthToAX: 116 eMOVZX ax, BYTE[bp+MENUINIT.bWidth]116 eMOVZX ax, [bp+MENUINIT.bWidth] 117 117 sub ax, BYTE MENU_HORIZONTAL_BORDER_LINES + MENU_TEXT_COLUMN_OFFSET 118 118 ret -
trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm
r181 r293 245 245 ALIGN JUMP_ALIGN 246 246 MenuScrollbars_GetMaxVisibleItemsOnPageToCX: 247 eMOVZX cx, BYTE[bp+MENUINIT.bHeight]247 eMOVZX cx, [bp+MENUINIT.bHeight] 248 248 sub cl, [bp+MENUINIT.bTitleLines] 249 249 sub cl, [bp+MENUINIT.bInfoLines] -
trunk/Assembly_Library/Src/Serial/SerialServer.asm
r292 r293 3 3 4 4 %include "SerialServer.inc" 5 5 6 6 ; Section containing code 7 7 SECTION .text 8 8 9 9 ;-------------------------------------------------------------------- 10 ; SerialServer_SendReceive: 10 ; SerialServer_SendReceive: 11 11 ; Parameters: 12 12 ; DX: Packed I/O port and baud rate … … 20 20 ; AL, BX, CX, DX 21 21 ;-------------------------------------------------------------------- 22 SerialServer_SendReceive: 23 22 SerialServer_SendReceive: 23 24 24 push si 25 25 push di … … 37 37 mov al,[bp+SerialServer_Command.bSectorCount] 38 38 mov ah,[bp+SerialServer_Command.bCommand] 39 39 40 40 ; 41 41 ; Command byte and sector count live at the top of the stack, pop/push are used to access … … 44 44 push ax ; working copy on the top of the stack 45 45 46 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS ; DF already cleared in Int13h.asm 46 47 cld 48 %endif 47 49 48 50 ;---------------------------------------------------------------------- … … 121 123 jz .zeroSectors 122 124 %endif 123 125 124 126 ; 125 127 ; Top of the read/write loop, one iteration per sector … … 278 280 %endif 279 281 mov ah, al ; for success, AL will already be zero 280 282 281 283 pop bx ; recover "ax" (command and count) from stack 282 284 pop cx ; recover saved sector count 283 mov ch, 0285 xor ch, ch 284 286 sub cl, bl ; subtract off the number of sectors that remained 285 287 … … 366 368 367 369 .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 374 371 ;;; fall-through 375 372 … … 381 378 ; One entry point fills in AH with 20h for write 382 379 ; DX: Port address (OK if already incremented to UART_lineStatus) 383 ; BX: 380 ; BX: 384 381 ; Stack: 2 words on the stack below the command/count word 385 382 ; Returns: … … 430 427 pop ax 431 428 %endif 432 429 433 430 .WaitAndPoll: 434 431 %ifndef SERIALSERVER_TIMER_LOCATION … … 441 438 pop bx 442 439 pop ax 443 %endif 440 %endif 444 441 jc SerialServer_OutputWithParameters_ErrorAndPop4Words 445 442 in al,dx -
trunk/Assembly_Library/Src/String/String.asm
r131 r293 37 37 ; CX: Number of characters processed 38 38 ; SI: Updated 39 ; CF: Cleared if successful l39 ; CF: Cleared if successful 40 40 ; Set if error during conversion 41 41 ; Corrupts registers:
Note:
See TracChangeset
for help on using the changeset viewer.