- Timestamp:
- Dec 21, 2014, 5:37:53 PM (10 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/Delay.inc
r567 r568 5 5 6 6 ;-------------------------------------------------------------------- 7 ; Clears prefetch queue by jumping to next instruction.8 ; This delays much more than nop instruction offast systems.7 ; Clears prefetch queue by jumping to the next instruction. 8 ; This delays much more than the nop instruction on fast systems. 9 9 ; 10 10 ; JMP_DELAY -
trunk/Assembly_Library/Inc/Emulate.inc
r510 r568 74 74 ;-------------------------------------------------------------------- 75 75 %macro eSALC 0 76 db 0D6h 76 ; db 0D6h 77 salc 77 78 %endmacro 78 79 -
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r526 r568 623 623 mov cx, STRING_DIALOG_IO_size 624 624 call Memory_ReserveCXbytesFromStackToDSSI 625 call .InitializeStringDialogIoInDSSIforInputtingFileName 626 627 CALL_MENU_LIBRARY GetStringWithIoInDSSI 628 mov al, [si+STRING_DIALOG_IO.bUserCancellation] 629 add sp, BYTE STRING_DIALOG_IO_size 630 test al, al ; User cancellation? 631 jnz SHORT ReturnWithoutHandlingKeystroke 632 jmp CloseFileDialogAfterSuccessfulSelection 633 634 ALIGN JUMP_ALIGN 635 .InitializeStringDialogIoInDSSIforInputtingFileName: 625 626 ;;; InitializeStringDialogIoInDSSIforInputtingFileName 636 627 call InitializeNullStringsToDialogInputInDSSI 637 628 mov WORD [si+DIALOG_INPUT.fszTitle], g_szEnterNewFileOrDirectory … … 642 633 mov [si+STRING_DIALOG_IO.fpReturnBuffer], ax 643 634 mov [si+STRING_DIALOG_IO.fpReturnBuffer+2], es 644 ret 635 ;;; 636 637 CALL_MENU_LIBRARY GetStringWithIoInDSSI 638 mov al, [si+STRING_DIALOG_IO.bUserCancellation] 639 add sp, BYTE STRING_DIALOG_IO_size 640 test al, al ; User cancellation? 641 jnz SHORT ReturnWithoutHandlingKeystroke 642 jmp CloseFileDialogAfterSuccessfulSelection 645 643 646 644 -
trunk/Assembly_Library/Src/Menu/Dialog/DialogString.asm
r526 r568 99 99 mov cx, [si+STRING_DIALOG_IO.wBufferSize] 100 100 les di, [si+STRING_DIALOG_IO.fpReturnBuffer] 101 call .GetCharacterFilterFunctionToDX 101 mov dx, [si+STRING_DIALOG_IO.fnCharFilter] 102 test dx, dx 103 jnz SHORT .CharacterFilterFunctionInDX 104 mov dx, Char_CharIsValid 102 105 106 .CharacterFilterFunctionInDX: 103 107 call Keyboard_ReadUserInputtedStringToESDIWhilePrinting 104 108 jz SHORT .UserCancellation … … 108 112 .UserCancellation: 109 113 ret 110 111 ;--------------------------------------------------------------------112 ; .GetCharacterFilterFunctionToDX113 ; Parameters114 ; DS:SI: Ptr to STRING_DIALOG_IO115 ; SS:BP: Ptr to DIALOG116 ; Returns:117 ; CS:DX: Ptr to character filter function118 ; Corrupts registers:119 ; Nothing120 ;--------------------------------------------------------------------121 ALIGN JUMP_ALIGN122 .GetCharacterFilterFunctionToDX:123 mov dx, [si+STRING_DIALOG_IO.fnCharFilter]124 test dx, dx125 jnz SHORT .ReturnFilterFunctionInDX126 mov dx, Char_CharIsValid127 ALIGN JUMP_ALIGN, ret128 .ReturnFilterFunctionInDX:129 ret -
trunk/Assembly_Library/Src/Menu/Dialog/DialogWord.asm
r526 r568 93 93 ; Nothing (User input stored to WORD_DIALOG_IO) 94 94 ; Corrupts registers: 95 ; AX, BX, DX, SI, DI95 ; AX, BX, CX, DX, SI, DI 96 96 ;-------------------------------------------------------------------- 97 97 ALIGN JUMP_ALIGN … … 100 100 eMOVZX bx, [si+WORD_DIALOG_IO.bNumericBase] 101 101 ALIGN JUMP_ALIGN 102 .GetUserInput IntilValidOrCancelled:102 .GetUserInputUntilValidOrCancelled: 103 103 call Keyboard_ReadUserInputtedWordWhilePrinting 104 104 jz SHORT .UserCancellation … … 116 116 .InputtedWordNotInRange: 117 117 call Keyboard_PlayBellForUnwantedKeystroke 118 call .ClearInputtedWordFromDialog 119 jmp SHORT .GetUserInputIntilValidOrCancelled 120 121 ;-------------------------------------------------------------------- 122 ; .ClearInputtedWordFromDialog 123 ; Parameters 124 ; SS:BP: Ptr to DIALOG 125 ; Returns: 126 ; Nothing 127 ; Corrupts registers: 128 ; AX, CX, DX, DI 129 ;-------------------------------------------------------------------- 130 ALIGN JUMP_ALIGN 131 .ClearInputtedWordFromDialog: 118 ; Clear inputted word from dialog 132 119 CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX 133 120 xchg dx, ax … … 138 125 139 126 xchg ax, dx 140 JMP_DISPLAY_LIBRARY SetCursorCoordinatesFromAX141 127 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 128 jmp SHORT .GetUserInputUntilValidOrCancelled -
trunk/Assembly_Library/Src/Menu/MenuBorders.asm
r526 r568 56 56 push RefreshTitleBorders 57 57 push MenuBorders_GetNumberOfMiddleCharactersToDX 58 jmp MenuBorders_AdjustDisplayContextForDrawingBorders58 jmp SHORT MenuBorders_AdjustDisplayContextForDrawingBorders 59 59 %endif 60 60 … … 120 120 CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX 121 121 122 mov si,ATTRIBUTE_CHARS.cBordersAndBackground122 xor si, si ; SI = ATTRIBUTE_CHARS.cBordersAndBackground 123 123 jmp MenuAttribute_SetToDisplayContextFromTypeInSI 124 124 … … 141 141 142 142 ;-------------------------------------------------------------------- 143 ; RefreshItemBorders 143 144 ; RefreshTitleBorders 144 ; Parameters145 ; DX: Number of times to repeat middle character146 ; SS:BP: Ptr to MENU147 ; Returns:148 ; Nothing149 ; Corrupts registers:150 ; AX, BX, CX, SI, DI151 ;--------------------------------------------------------------------152 ALIGN MENU_JUMP_ALIGN153 RefreshTitleBorders:154 call DrawTopBorderLine155 eMOVZX cx, [bp+MENUINIT.bTitleLines]156 jmp SHORT DrawTextBorderLinesByCXtimes157 158 ;--------------------------------------------------------------------159 145 ; RefreshInformationBorders 160 ; Parameters161 ; DX: Number of times to repeat middle character162 ; SS:BP: Ptr to MENU163 ; Returns:164 ; Nothing165 ; Corrupts registers:166 ; AX, BX, CX, SI, DI167 ;--------------------------------------------------------------------168 ALIGN MENU_JUMP_ALIGN169 RefreshInformationBorders:170 call DrawSeparationBorderLine171 eMOVZX cx, [bp+MENUINIT.bInfoLines]172 jmp SHORT DrawTextBorderLinesByCXtimes173 174 ;--------------------------------------------------------------------175 ; RefreshItemBorders176 146 ; Parameters 177 147 ; DX: Number of times to repeat middle character … … 186 156 call DrawSeparationBorderLine 187 157 call MenuScrollbars_GetMaxVisibleItemsOnPageToCX 188 ; Fall to DrawTextBorderLinesByCXtimes 189 190 ;-------------------------------------------------------------------- 158 jmp SHORT DrawTextBorderLinesByCXtimes 159 160 ALIGN MENU_JUMP_ALIGN 161 RefreshTitleBorders: 162 call DrawTopBorderLine 163 mov cl, [bp+MENUINIT.bTitleLines] 164 jmp SHORT DrawTextBorderLinesByCLtimes 165 166 ALIGN MENU_JUMP_ALIGN 167 RefreshInformationBorders: 168 call DrawSeparationBorderLine 169 mov cl, [bp+MENUINIT.bInfoLines] 170 ; Fall to DrawTextBorderLinesByCLtimes 171 172 ;-------------------------------------------------------------------- 173 ; DrawTextBorderLinesByCLtimes 191 174 ; DrawTextBorderLinesByCXtimes 192 175 ; Parameters 193 ; C X:Number of border lines to draw176 ; CL/CX: Number of border lines to draw 194 177 ; DX: Number of times to repeat middle character 195 178 ; SS:BP: Ptr to MENU … … 199 182 ; AX, CX, SI, DI 200 183 ;-------------------------------------------------------------------- 184 DrawTextBorderLinesByCLtimes: 185 xor ch, ch 201 186 DrawTextBorderLinesByCXtimes: 202 187 jcxz .NoBorderLinesToDraw … … 213 198 ; DrawSeparationBorderLine 214 199 ; DrawBottomBorderLine 215 ; DrawTimeoutCounterOverBottomBorderLine216 200 ; DrawBottomShadowLine 217 201 ; DrawTextBorderLine … … 242 226 243 227 call DrawTimeoutCounterString 228 push dx 244 229 sub dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS 245 230 mov si, g_BottomBorderWithTimeoutCharacters 246 231 call PrintBorderCharactersFromCSSIandShadowCharacter 247 add dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS232 pop dx 248 233 ret 249 234 … … 403 388 mov si, ATTRIBUTE_CHARS.cNormalTimeout 404 389 cmp di, BYTE MENU_TIMEOUT_SECONDS_FOR_HURRY 405 eCMOVB si, ATTRIBUTE_CHARS.cHurryTimeout 390 jnb SHORT .NormalTimeout 391 dec si ; SI = ATTRIBUTE_CHARS.cHurryTimeout 392 .NormalTimeout: 406 393 call MenuAttribute_GetToAXfromTypeInSI 407 394 -
trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm
r526 r568 116 116 ALIGN MENU_JUMP_ALIGN 117 117 MenuScrollbars_MoveHighlightedItemByAX: 118 mov cx, [bp+MENUINIT.wHighlightedItem]119 add cx, ax120 ; Fall to .RotateItemInCX121 122 ;--------------------------------------------------------------------123 ; .RotateItemInCX124 ; Parameters125 ; CX: Possibly under of overflown item to be rotated126 ; SS:BP: Ptr to MENU127 ; Returns:128 ; CX: Valid item index129 ; Corrupts registers:130 ; DX131 ;--------------------------------------------------------------------132 ;.RotateItemInCX:133 118 mov dx, [bp+MENUINIT.wItems] 134 test cx, cx 119 add ax, [bp+MENUINIT.wHighlightedItem] 120 xchg cx, ax 135 121 js SHORT .RotateNegativeItemInCX 136 122 sub cx, dx -
trunk/Assembly_Library/Src/Serial/SerialServer.asm
r567 r568 83 83 84 84 %ifdef USE_UNDOC_INTEL 85 eSALC; Clear AL using CF85 salc ; Clear AL using CF 86 86 %else 87 xor a x,ax87 xor al, al 88 88 %endif 89 89 inc dx ; divisor high … … 108 108 pop dx ; base, interrupts disabled 109 109 %ifdef USE_UNDOC_INTEL 110 eSALC; Clear AL using CF110 salc ; Clear AL using CF 111 111 %else 112 xor a x,ax112 xor al, al 113 113 %endif 114 114 out dx,al -
trunk/Serial_Server/win32/Win32Serial.h
r526 r568 55 55 log( 0, "Opening named pipe %s (simulating %s baud)", name, baudRate->display ); 56 56 57 pipe = CreateNamedPipeA( name, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE |PIPE_REJECT_REMOTE_CLIENTS, 2, 1024, 1024, 0, NULL );57 pipe = CreateNamedPipeA( name, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE, 2, 1024, 1024, 0, NULL ); 58 58 if( pipe == INVALID_HANDLE_VALUE ) 59 59 log( -1, "Could not CreateNamedPipe " PIPENAME ); -
trunk/Tools/StringsCompress.pl
r526 r568 217 217 for( $g = 0; $translate_index[$g]; $g++ ) 218 218 { 219 print " db ".$translate_index[$g]."; ".$g."\n";219 print "\t\tdb ".$translate_index[$g]."\t; ".$g."\n"; 220 220 } 221 221 … … 231 231 for( $t = $format_begin; $format_index[$t]; $t++ ) 232 232 { 233 print " db (DisplayFormatCompressed_BaseFormatOffset - ".$format_index[$t]."); ".$t."\n";233 print "\t\tdb (DisplayFormatCompressed_BaseFormatOffset - ".$format_index[$t].")\t; ".$t."\n"; 234 234 } 235 235 -
trunk/Tools/checksum.pl
r526 r568 57 57 58 58 $fixzero = chr(0); 59 60 # 61 # Compatibility fix for 3Com 3C503 cards. They use 8 KB ROMs and return 8080h as the last word of the ROM. 62 # 63 if( $desiredSize == 8192 ) { 64 if( $bytes < $desiredSize - 3 ) { 65 while( $bytes < $desiredSize - 3 ) { 66 print FILE $fixzero; 67 $bytes++; 68 } 69 $fixl = ($cs == 0 ? 0 : 256 - $cs); 70 $fix = chr($fixl).chr($cs); 71 print FILE $fix; 72 $bytes += 2; 73 } else { 74 print "Warning! ".$ARGV[0]." cannot be used on a 3Com 3C503 card!\n"; 75 } 76 } 77 59 78 while( $bytes < $desiredSize - 1 ) 60 79 { -
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r526 r568 47 47 %ifdef MODULE_SERIAL ; IDE + Serial 48 48 Device_FinalizeDPT: 49 ; needs to check IDEVARS vs. checking the DPT as the serial bit in the DPT is set in the Finalize routine 50 CMP_USING_IDEVARS_IN_CSBP_AND_JUMP_IF DEVICE_SERIAL_PORT, .FinalizeDptForSerialPortDevice 49 ; Needs to check IDEVARS vs. checking the DPT as the serial bit in the DPT is set in the Finalize routine 50 cmp BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 51 %ifdef USE_386 52 jne IdeDPT_Finalize 53 jmp SerialDPT_Finalize 54 %else 55 je SHORT .FinalizeDptForSerialPortDevice 51 56 jmp IdeDPT_Finalize 52 57 .FinalizeDptForSerialPortDevice: 53 58 jmp SerialDPT_Finalize 59 %endif 54 60 55 61 %else ; IDE … … 94 100 %ifdef MODULE_SERIAL ; IDE + Serial 95 101 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH: 96 CMP_USING_IDEVARS_IN_CSBP_AND_JUMP_IF DEVICE_SERIAL_PORT, .IdentifyDriveFromSerialPort 102 cmp BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 103 %ifdef USE_386 104 jne IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 105 jmp SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 106 %else 107 je SHORT .IdentifyDriveFromSerialPort 97 108 jmp IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 98 109 .IdentifyDriveFromSerialPort: 99 110 jmp SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 111 %endif 100 112 101 113 %else ; IDE … … 122 134 ALIGN JUMP_ALIGN 123 135 Device_OutputCommandWithParameters: 124 TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE .OutputCommandToSerialPort 136 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 137 %ifdef USE_386 138 jz IdeCommand_OutputWithParameters 139 jmp SerialCommand_OutputWithParameters 140 %else 141 jnz SHORT .OutputCommandToSerialPort 125 142 jmp IdeCommand_OutputWithParameters 126 143 … … 128 145 .OutputCommandToSerialPort: 129 146 jmp SerialCommand_OutputWithParameters 147 %endif 130 148 131 149 %else ; IDE … … 147 165 %ifdef MODULE_SERIAL ; IDE + Serial 148 166 Device_SelectDrive: 149 TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort 167 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 168 %ifndef USE_386 169 jnz SHORT ReturnSuccessForSerialPort 150 170 jmp IdeCommand_SelectDrive 171 %else 172 jz IdeCommand_SelectDrive 173 ; Fall to ReturnSuccessForSerialPort 174 %endif 151 175 152 176 %else ; IDE -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r567 r568 189 189 mov cl, [bp+PIOVARS.bSectorsLeft] ; CH is already zero 190 190 push cx 191 %ifdef USE_186192 push CheckErrorsAfterTransferringLastBlock193 jmp [bp+PIOVARS.fnXfer] ; Transfer possibly partial block194 %else195 191 call [bp+PIOVARS.fnXfer] ; Transfer possibly partial block 196 192 jmp SHORT CheckErrorsAfterTransferringLastBlock 197 %endif198 193 199 194 … … 241 236 242 237 ; Convert ES:SI to physical address 243 %ifdef USE_186 238 %ifdef USE_386 239 240 mov dx, es 241 xor ax, ax 242 shld ax, dx, 4 243 shl dx, 4 244 add si, dx 245 adc al, ah 246 mov es, ax 247 248 %elifdef USE_186 244 249 ; Bytes EU Cycles(286) 245 250 mov ax, es ; 2 2 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r567 r568 322 322 323 323 ;-------------------------------------------------------------------- 324 ; Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber 324 325 ; Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH 325 326 ; Int13h_SetErrorCodeToIntpackInSSBPfromAH … … 330 331 ; SS:BP: Ptr to IDEPACK with error condition set 331 332 ; Corrupts registers: 332 ; DS, DI333 ; DS, BX, DI 333 334 ;-------------------------------------------------------------------- 334 335 ALIGN JUMP_ALIGN -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm
r526 r568 38 38 ; Returns with INTPACK in SS:BP: 39 39 ; AH: Int 13h/40h floppy return status 40 ; AL: Number of sectors actually verified (only valid if CF set for some BIOSes)40 ; AL: Number of sectors actually verified (only valid if CF set for some BIOSes) 41 41 ; CF: 0 if successful, 1 if error 42 42 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm
r526 r568 48 48 mov ah, [cs:bx+g_rgbWriteCommandLookup] 49 49 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ) 50 %ifdef USE_18651 push AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX52 jmp Idepack_ConvertDapToIdepackAndIssueCommandFromAH53 %else54 50 call Idepack_ConvertDapToIdepackAndIssueCommandFromAH 55 51 jmp SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX 56 %endif -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm
r526 r568 43 43 mov ah, [cs:bx+g_rgbVerifyCommandLookup] 44 44 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY) 45 %ifdef USE_18646 push AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX47 jmp Idepack_ConvertDapToIdepackAndIssueCommandFromAH48 %else49 45 call Idepack_ConvertDapToIdepackAndIssueCommandFromAH 50 46 jmp SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX 51 %endif -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
r550 r568 147 147 ; from previously scanned drive. 148 148 .DoNotSetChsFlag: 149 eMOVZX dx, BYTE[es:si+DPT.bPchsHeads]149 eMOVZX dx, [es:si+DPT.bPchsHeads] 150 150 mov [di+EDRIVE_INFO.dwHeads], dx 151 151 mov [di+EDRIVE_INFO.dwHeads+2], cx … … 159 159 mov [di+EDRIVE_INFO.dwCylinders+2], cx 160 160 161 .ReturnWithSuccess: 162 xor ax, ax 163 .ReturnWithError: 161 xor ax, ax ; Success 164 162 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
r542 r568 37 37 ALIGN JUMP_ALIGN 38 38 Address_ExtractLCHSparametersFromOldInt13hAddress: 39 mov bl, cl ; Copy sector number...40 and bl, 3Fh ; ...and limit to 1...6339 mov bl, 3Fh ; Load sector number mask 40 and bl, cl ; Sector number now in BL 41 41 sub cl, bl ; Remove from cylinder number high 42 42 eROL_IM cl, 2 ; High bits to beginning … … 75 75 ; (LCylinder << n) + (LHead / PHeadCount) 76 76 mov dx, cx ; Copy L-CHS Cylinder number to DX 77 mov cl, [di+DPT.bFlagsLow] ; Load shift count78 and cl, MASKL_DPT_CHS_SHIFT_COUNT77 mov cl, MASKL_DPT_CHS_SHIFT_COUNT ; Load shift count mask 78 and cl, [di+DPT.bFlagsLow] ; Shift count now in CL 79 79 shl dx, cl ; DX = LCylinder << n 80 80 add ax, dx ; AX = P-CHS Cylinder number … … 83 83 ret 84 84 85 ; *FIXME* The above function description doesn't match the code. 86 ; If CX has a maximum value of 1023 on entry then there is no way CX can be 16382 on return. 87 ; 1023 SHL 3 (MASKL_DPT_CHS_SHIFT_COUNT) is 8184. With the addition of AX (at most 255?) 88 ; the result is 8439. 85 89 86 90 ;-------------------------------------------------------------------- … … 102 106 ALIGN JUMP_ALIGN 103 107 Address_OldInt13hAddressToIdeAddress: 104 call Address_ExtractLCHSparametersFromOldInt13hAddress 105 ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 108 call Address_ExtractLCHSparametersFromOldInt13hAddress 109 mov al, [di+DPT.bFlagsLow] 110 and al, MASKL_DPT_TRANSLATEMODE 106 111 107 112 ;;; 0: ADDRESSING_MODE_NORMAL 108 113 jz SHORT DoNotConvertLCHS 109 114 110 115 ;;; 1: ADDRESSING_MODE_LARGE 111 112 116 test al, FLGL_DPT_ASSISTED_LBA 117 jz SHORT ConvertLargeModeLCHStoPCHS 113 118 114 119 ;;; 2: ADDRESSING_MODE_ASSISTED_LBA 115 ; Fall throughto ConvertAssistedLBAModeLCHStoLBARegisterValues120 ; Fall to ConvertAssistedLBAModeLCHStoLBARegisterValues 116 121 117 122 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm
r567 r568 46 46 ; Make sure that sector count is valid 47 47 %ifdef USE_UNDOC_INTEL 48 eSALC; Clear AL using CF (CF is cleared since JB above fell through)48 salc ; Clear AL using CF (CF is cleared since JB above fell through) 49 49 or al, [es:si+DAP.wSectorCount] 50 50 %else -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
r528 r568 42 42 ; display error code every time user intends to boot from hard disk 43 43 ; when A then C boot order is used. 44 test dl, dl 44 45 js SHORT .PrintFailedToLoadErrorCode ; Hard Drive 45 46 cmp ah, RET_HD_TIMEOUT … … 48 49 je SHORT .ReturnWithCFclearSinceFailedToLoadBootSector 49 50 .PrintFailedToLoadErrorCode: 50 %ifdef USE_18651 push .ReturnWithCFclearSinceFailedToLoadBootSector52 jmp DetectPrint_FailedToLoadFirstSector53 %else54 51 call DetectPrint_FailedToLoadFirstSector 55 jmp .ReturnWithCFclearSinceFailedToLoadBootSector 56 %endif 52 jmp SHORT .ReturnWithCFclearSinceFailedToLoadBootSector 57 53 58 54 … … 63 59 jne SHORT .FirstHardDiskSectorNotBootable 64 60 .AlwaysBootFromFloppyDriveForBooterGames: 65 stc ; Boot Sector loaded succes fully61 stc ; Boot Sector loaded successfully 66 62 jmp SHORT Int19_JumpToBootSectorOrRomBoot 67 63 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r567 r568 136 136 mov cx, [di+DPT_ADVANCED_ATA.wMinPioCycleTime] 137 137 test si, si 138 jz SHORT .PioTimingsLoadedTo AXandCX138 jz SHORT .PioTimingsLoadedToBXandCX 139 139 MIN_U bl, [si+DPT_ADVANCED_ATA.bPioMode] 140 140 MAX_U cx, [si+DPT_ADVANCED_ATA.wMinPioCycleTime] 141 .PioTimingsLoadedTo AXandCX:141 .PioTimingsLoadedToBXandCX: 142 142 ret -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r567 r568 107 107 call AccessDPT_GetPointerToDRVPARAMStoCSBX 108 108 push ds 109 110 push cs 111 pop ds 112 113 ; Load User Defined CHS or LBA to CX:AX 114 mov dx, [bx+DRVPARAMS.wFlags] 115 mov ax, [bx+DRVPARAMS.wCylinders] ; Or .dwMaximumLBA 116 mov cx, [bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2 117 109 118 push es 110 119 pop ds ; DS:SI now points to ATA information 111 112 ; Load User Defined CHS or LBA to CX:AX113 mov dx, [cs:bx+DRVPARAMS.wFlags]114 mov ax, [cs:bx+DRVPARAMS.wCylinders] ; Or .dwMaximumLBA115 mov cx, [cs:bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2116 120 117 121 ; * User defined CHS * -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r567 r568 72 72 %endif 73 73 74 mov al, [cs:ROMVARS.wFlags] ; Configurator set to always scan?75 or al, [es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key?76 and al, 8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT74 mov al, [cs:ROMVARS.wFlags] ; Configurator set to always scan? 75 or al, [es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key? 76 and al, 8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT 77 77 jnz .DriveDetectLoop 78 78 %endif … … 89 89 ; 90 90 mov cx, [RAMVARS.wDrvCntAndFlopCnt] ; Our count of hard disks 91 92 91 mov al, [es:BDA.bHDCount] 93 add cl, al ; Add our drives to the system count 94 mov [es:BDA.bHDCount], cl 92 add [es:BDA.bHDCount], cl ; Add our drives to the system count 95 93 or al, 80h ; Or in hard disk flag 96 94 mov [RAMVARS.bFirstDrv], al ; Store first drive number … … 118 116 inc ax ; low order bit, indicating floppy drive exists 119 117 120 mov ah, [es:BDA.wEquipment] ; Load Equipment WORD low byte121 and ah, 03eh ; Mask off drive number and drives present bit118 mov ah, 3Eh ; AND mask to AH (all bits set except floppy drive count/present) 119 and ah, [es:BDA.wEquipment] ; Load Equipment WORD low byte and mask off drive number and drives present bit 122 120 or al, ah ; Or in new values 123 121 mov [es:BDA.wEquipment], al ; and store 124 122 125 mov al, 1 eh ; BDA pointer to Floppy DPT123 mov al, 1Eh ; BDA pointer to Floppy DPT 126 124 mov si, AH8h_FloppyDPT 127 125 call Interrupts_InstallHandlerToVectorInALFromCSSI -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r567 r568 181 181 push ax 182 182 push di ; BIOS segment 183 add al, ROMVARS.szVersion - ROMVARS.szTitle183 mov al, ROMVARS.szVersion & 0FFh 184 184 push ax 185 185 %else -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm
r550 r568 56 56 ;-------------------------------------------------------------------- 57 57 .PushAddressingMode: 58 ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 58 mov al, [di+DPT.bFlagsLow] 59 and ax, BYTE MASKL_DPT_TRANSLATEMODE 59 60 ;; 60 61 ;; This multiply both shifts the addressing mode bits down to low order bits, and … … 107 108 eCMOVZ ah, [di+DPT_ATA.bDevice] ; DPT_ATA contains up to date device information for IDE drives 108 109 %ifdef USE_UNDOC_INTEL 109 eSALC; Clear AL using CF (from TEST above)110 salc ; Clear AL using CF (from TEST above) 110 111 eAAD g_szDeviceTypeValues_Displacement 111 112 %else -
trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
r567 r568 69 69 .PrintFloppyDriveHotkeys: 70 70 call FloppyDrive_GetCountToAX 71 test ax, ax ; Any Floppy Drives?72 j z SHORT.SkipFloppyDriveHotkeys71 xchg cx, ax ; Any Floppy Drives? 72 jcxz .SkipFloppyDriveHotkeys 73 73 74 74 mov ax, (ANGLE_QUOTE_RIGHT << 8) | DEFAULT_FLOPPY_DRIVE_LETTER -
trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm
r536 r568 491 491 492 492 StringsCompressed_TranslatesAndFormats: 493 db 32; 0494 db 172; 1495 db 171; 2496 db 179; 3497 db 175; 4498 db 33; 5499 db 34; 6500 db 44; 7501 db 45; 8502 db 46; 9503 db 47; 10504 db 49; 11505 db 50; 12506 db 51; 13507 db 53; 14508 db 54; 15509 db 56; 16510 db 200; 17511 db 181; 18512 db 48; 19513 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_I); 20514 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_u); 21515 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_u); 22516 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_x); 23517 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_x); 24518 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_nl); 25519 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_u); 26520 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_A); 27521 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_c); 28522 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_s); 29523 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_z); 30493 db 32 ; 0 494 db 172 ; 1 495 db 171 ; 2 496 db 179 ; 3 497 db 175 ; 4 498 db 33 ; 5 499 db 34 ; 6 500 db 44 ; 7 501 db 45 ; 8 502 db 46 ; 9 503 db 47 ; 10 504 db 49 ; 11 505 db 50 ; 12 506 db 51 ; 13 507 db 53 ; 14 508 db 54 ; 15 509 db 56 ; 16 510 db 200 ; 17 511 db 181 ; 18 512 db 48 ; 19 513 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_I) ; 20 514 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_u) ; 21 515 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_u) ; 22 516 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_x) ; 23 517 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_x) ; 24 518 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_nl) ; 25 519 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_u) ; 26 520 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_A) ; 27 521 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_c) ; 28 522 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_s) ; 29 523 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_z) ; 30 524 524 525 525 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS … … 560 560 561 561 ;; translated usage stats 562 ;; 33:1 563 ;; 32:35 564 ;; 181:1 565 ;; 53:2 566 ;; 48:2 567 ;; 200:1 568 ;; 46:3 569 ;; 179:8 562 ;; 54:1 563 ;; 47:2 564 ;; 175:1 565 ;; 49:1 570 566 ;; 44:1 571 567 ;; 50:2 568 ;; 200:1 569 ;; 181:1 570 ;; 172:2 571 ;; 45:2 572 ;; 56:8 573 ;; 33:1 574 ;; 53:2 575 ;; 179:8 576 ;; 171:2 572 577 ;; 51:3 573 ;; 47:2574 ;; 172:2575 578 ;; 34:3 576 ;; 49:1 577 ;; 56:8 578 ;; 45:2 579 ;; 175:1 580 ;; 171:2 581 ;; 54:1 579 ;; 48:2 580 ;; 46:3 581 ;; 32:35 582 582 ;; total translated: 20 583 583 584 584 ;; format usage stats 585 ;; nl:12 586 ;; x:5 585 587 ;; A:4 588 ;; 5-x:1 586 589 ;; 2-u:1 590 ;; z:2 587 591 ;; 5-u:2 588 ;; x:5589 592 ;; s:14 590 ;; 5-x:1591 ;; nl:12592 593 ;; 2-I:1 593 594 ;; u:6 594 595 ;; c:13 595 ;; z:2596 596 ;; total format: 11 597 597 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
r567 r568 58 58 59 59 %ifdef USE_UNDOC_INTEL 60 eSALC; Clears AL using CF while preserving flags60 salc ; Clears AL using CF while preserving flags 61 61 %endif 62 62 … … 163 163 ;-------------------------------------------------------------------- 164 164 AccessDPT_GetIdevarsToCSBX: 165 eMOVZX bx, BYTE[di+DPT.bIdevarsOffset]165 eMOVZX bx, [di+DPT.bIdevarsOffset] 166 166 ret 167 167 168 169 ;--------------------------------------------------------------------170 ; ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF171 ; Parameters:172 ; DS:DI: Ptr to Disk Parameter Table173 ; Returns:174 ; AX: Translate Mode (TRANSLATEMODE_NORMAL, TRANSLATEMODE_LARGE or TRANSLATEMODE_ASSISTED_LBA)175 ; unshifted (still shifted where it is in bFlagsLow)176 ; ZF: Set based on value in AL177 ; Corrupts registers:178 ; Nothing179 ;--------------------------------------------------------------------180 ;181 ; Converted to a macro since only called in two places, and the call/ret overhead182 ; is not worth it for these two instructions (4 bytes total)183 ;184 %macro ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 0185 mov al, [di+DPT.bFlagsLow]186 and ax, BYTE MASKL_DPT_TRANSLATEMODE187 %endmacro -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm
r567 r568 142 142 ; GetSectorCountToDXAXfromCHSinAXBLBH 143 143 ; Parameters: 144 ; ES:SI: Ptr to 512-byte ATA information read from the drive145 144 ; AX: Number of cylinders (1...16383) 146 145 ; BL: Number of heads (1...255) … … 328 327 cmp ax, cx 329 328 jbe SHORT .NumberOfHeadsNowInCX 330 eSHL_IM c l, 1 ; Double number of heads331 j nzSHORT .CompareNextValidNumberOfHeads ; Reached 256 heads?332 dec c l; If so, limit heads to 255329 eSHL_IM cx, 1 ; Double number of heads 330 jpo SHORT .CompareNextValidNumberOfHeads ; Reached 256 heads? 331 dec cx ; If so, limit heads to 255 333 332 .NumberOfHeadsNowInCX: 334 333 mov bx, cx ; Number of heads are returned in BL -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm
r558 r568 114 114 ;-------------------------------------------------------------------- 115 115 FillTranslatedDPTtoESDIfromDPTinDSSI: 116 xor dx, dx; Clear for checksum116 cwd ; Clear for checksum 117 117 call StoswThenAddALandAHtoDL ; Bytes 0 and 1 (Logical number of cylinders) 118 118 119 mov al, BYTE[si+DPT.bLchsHeads]119 mov al, [si+DPT.bLchsHeads] 120 120 mov ah, TRANSLATED_DPT_SIGNATURE 121 121 call StoswThenAddALandAHtoDL ; Bytes 2 (Logical number of heads) and 3 (Axh signature to indicate Translated DPT) 122 122 123 eMOVZX ax, BYTE[si+DPT.bPchsSectorsPerTrack]123 eMOVZX ax, [si+DPT.bPchsSectorsPerTrack] 124 124 call StoswThenAddALandAHtoDL ; Bytes 4 (Physical sectors per track) and 5 (Write Precompensation Cylinder low) 125 125 126 mov al, ah 127 call StoswThenAddALandAHtoDL; Bytes 6 (Write Precompensation Cylinder high) and 7128 129 xchg ax, cx ; Device Control byte to AL126 mov al, ah ; Zero AX 127 stosw ; Bytes 6 (Write Precompensation Cylinder high) and 7 128 129 xchg cx, ax ; Device Control byte to AL, zero to CX 130 130 mov ah, [si+DPT.wPchsCylinders] 131 131 call StoswThenAddALandAHtoDL ; Bytes 8 (Drive Control Byte) and 9 (Physical number of cylinders low) … … 135 135 call StoswThenAddALandAHtoDL ; Bytes 10 (Physical number of cylinders high) and 11 (Physical number of heads) 136 136 137 x or ax, ax138 call StoswThenAddALandAHtoDL; Bytes 12 and 13 (Landing Zone Cylinder)137 xchg cx, ax ; Zero to AX 138 stosw ; Bytes 12 and 13 (Landing Zone Cylinder) 139 139 140 140 mov al, [si+DPT.bLchsSectorsPerTrack] … … 158 158 ; DI: Incremented by 2 159 159 ; Corrupts registers: 160 ; Nothing160 ; AH 161 161 ;-------------------------------------------------------------------- 162 162 StoswALandChecksumFromDL: … … 182 182 FillStandardDPTtoESDIfromDPTinDSSI: 183 183 stosw ; Bytes 0 and 1 (Physical number of cylinders) 184 eMOVZX ax, BYTE[si+DPT.bLchsHeads]184 eMOVZX ax, [si+DPT.bLchsHeads] 185 185 stosw ; Bytes 2 (Physical number of heads) and 3 186 %ifdef USE_UNDOC_INTEL 187 %ifdef USE_386 188 xor al, al ; Zero AX and clear CF 189 %else 190 salc ; Zero AX (CF cleared by eMOVZX above) 191 %endif 192 %else 186 193 mov al, ah ; Zero AX 194 %endif 187 195 stosw ; Bytes 4 and 5 (Write Precompensation Cylinder low) 188 196 stosw ; Bytes 6 (Write Precompensation Cylinder high) and 7 189 197 mov al, cl ; Device control byte to AL 190 198 stosw ; Bytes 8 (Drive Control Byte) and 9 199 %ifdef USE_UNDOC_INTEL 200 salc ; Zero AX (CF cleared above) 201 %else 191 202 mov al, ah ; Zero AX 203 %endif 192 204 stosw ; Bytes 10 and 11 193 205 stosw ; Bytes 12 and 13 (Landing Zone Cylinder) … … 208 220 ; ES:BX: Ptr to Device Parameter Table Extension (DPTE) 209 221 ; Corrupts registers: 210 ; AX, CX, D X, DI222 ; AX, CX, DL, DI 211 223 ;-------------------------------------------------------------------- 212 224 CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI: 213 call GetTemporaryBufferForDPTEtoESDI ; valid until next AH=48h call225 call GetTemporaryBufferForDPTEtoESDI ; Valid until next AH=48h call 214 226 215 227 ; Set 32-bit flag for 32-bit controllers … … 218 230 eCMOVE cl, FLG_LBA_TRANSLATION_ENABLED | FLG_32BIT_XFER_MODE 219 231 232 xor dl, dl ; Clear DL for checksum 233 220 234 ; DPTE.wBasePort 221 235 mov ax, [si+DPT.wBasePort] … … 223 237 224 238 ; DPTE.wControlBlockPort 225 eMOVZX bx, BYTE[si+DPT.bIdevarsOffset]239 eMOVZX bx, [si+DPT.bIdevarsOffset] 226 240 mov ax, [cs:bx+IDEVARS.wControlBlockPort] 227 241 call StoswThenAddALandAHtoDL ; Bytes 2 and 3 … … 244 258 ; DPTE.bDmaChannelAndType and DPTE.bPioMode 245 259 xor ax, ax 246 %ifdef MODULE_ADVANCED_ATA 260 %ifndef MODULE_ADVANCED_ATA 261 stosw ; Bytes 8 and 9 262 %else 247 263 or ah, [si+DPT_ADVANCED_ATA.bPioMode] 248 264 jz SHORT .DoNotSetFastPioFlag 249 cmp WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 0 250 je SHORT .DoNotSetFastPioFlag 251 inc cx ; FLG_FAST_PIO_ENABLED 265 cmp WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 1 266 sbb cl, -1 ; FLG_FAST_PIO_ENABLED (if .wControllerID > 0) 252 267 .DoNotSetFastPioFlag: 253 %endif254 268 call StoswThenAddALandAHtoDL ; Bytes 8 and 9 269 %endif 255 270 256 271 ; Set CHS translation flags and store DPTE.wFlags … … 261 276 test al, FLGL_DPT_ASSISTED_LBA 262 277 jz SHORT .NoChsTranslationOrBitShiftTranslationSet 263 or c x, LBA_ASSISTED_TRANSLATION << TRANSLATION_TYPE_FIELD_POSITION278 or ch, LBA_ASSISTED_TRANSLATION << (TRANSLATION_TYPE_FIELD_POSITION - 8) 264 279 .NoChsTranslationOrBitShiftTranslationSet: 265 280 xchg ax, cx … … 268 283 ; DPTE.wReserved (must be zero) 269 284 xor ax, ax 270 call StoswThenAddALandAHtoDL; Bytes 12 and 13285 stosw ; Bytes 12 and 13 271 286 272 287 ; DPTE.bRevision and DPTE.bChecksum 273 288 mov al, DPTE_REVISION 274 call StoswALandChecksumFromDL ; Bytes 14 and 15 275 lea bx, [di-DPTE_size] 276 ret 289 lea bx, [di+2-DPTE_size] ; The +2 compensates for the last WORD yet to be stored 290 jmp StoswALandChecksumFromDL ; Bytes 14 and 15 277 291 %endif ; MODULE_EBIOS 278 292 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
r567 r568 116 116 jnz SHORT .NothingToChange 117 117 118 .LimitHeadsForLargeAddressingMode:119 118 ; We cannot have 16 P-Heads heads in Revised ECHS mode (8193 or more cylinders) 120 119 ; but 16 heads are allowed when there are 8192 or less cylinders (ECHS). 121 120 ; Both of these are LARGE modes so do not confuse with NORMAL mode. 122 121 call AtaGeometry_IsDriveSmallEnoughForECHS 123 jc SHORT .NothingToChange 124 dec bx ; Adjust 16 P-Heads to 15 122 adc bx, -1 ; Adjust 16 P-Heads to 15 if needed 125 123 126 124 .NothingToChange: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
r558 r568 159 159 call Buffers_IsXtideUniversalBiosSignatureInESDI 160 160 je SHORT .RomFound 161 add b h, 2 ; Increment by 8kB161 add bx, 80h ; Increment by 2kB (minimum possible distance from the beginning of one option ROM to the next) 162 162 jnc SHORT .SegmentLoop ; Loop until segment overflows 163 163 clc -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm
r526 r568 83 83 84 84 push cx 85 call .GetSdpCommandFunctionTo DXwithFlashvarsInSSBP85 call .GetSdpCommandFunctionToAXwithFlashvarsInSSBP 86 86 mov cx, [bp+FLASHVARS.wEepromPageSize] 87 87 mov si, [bp+FLASHVARS.fpNextSourcePage] … … 94 94 95 95 ;-------------------------------------------------------------------- 96 ; .GetSdpCommandFunctionTo DXwithFlashvarsInSSBP97 ; Parameters: 98 ; SS:BP: Ptr to FLASHVARS 99 ; Returns: 100 ; DX: Ptr to SDP Command function96 ; .GetSdpCommandFunctionToAXwithFlashvarsInSSBP 97 ; Parameters: 98 ; SS:BP: Ptr to FLASHVARS 99 ; Returns: 100 ; AX: Ptr to SDP Command function 101 101 ; Corrupts registers: 102 102 ; BX, SI 103 103 ;-------------------------------------------------------------------- 104 104 ALIGN JUMP_ALIGN 105 .GetSdpCommandFunctionTo DXwithFlashvarsInSSBP:105 .GetSdpCommandFunctionToAXwithFlashvarsInSSBP: 106 106 eMOVZX bx, [bp+FLASHVARS.bEepromSdpCommand] 107 107 mov si, [cs:bx+.rgpSdpCommandToEepromTypeLookupTable] 108 108 mov bl, [bp+FLASHVARS.bEepromType] 109 mov dx, [cs:bx+si]109 mov ax, [cs:bx+si] 110 110 ret 111 111 … … 182 182 ; Nothing 183 183 ; Corrupts registers: 184 ; Nothing184 ; AX 185 185 ;-------------------------------------------------------------------- 186 186 %macro DISABLE_SDP 2 187 mov BYTE [%1], 0AAh 188 mov BYTE [%2], 55h 189 mov BYTE [%1], 80h 190 mov BYTE [%1], 0AAh 191 mov BYTE [%2], 55h 192 mov BYTE [%1], 20h 187 mov ax, 80AAh 188 %%Again: 189 mov [%1], al ; 0AAh 190 shr al, 1 191 mov [%2], al ; 55h 192 mov [%1], ah ; 80h/20h 193 xor ax, 0A0FFh 194 jns SHORT %%Again 193 195 %endmacro 194 196 … … 215 217 WriteSdpEnableCommandFor2864mod: 216 218 ENABLE_SDP 155Ch, 0AA3h 217 jmp ReturnFromSdpCommand219 jmp SHORT ReturnFromSdpCommand 218 220 219 221 ALIGN JUMP_ALIGN 220 222 WriteSdpEnableCommandFor28256or28512: 221 223 ENABLE_SDP 5555h, 2AAAh 222 jmp ReturnFromSdpCommand224 jmp SHORT ReturnFromSdpCommand 223 225 224 226 … … 241 243 WriteSdpDisableCommandFor28256or28512: 242 244 DISABLE_SDP 5555h, 2AAAh 243 DoNotWriteAnySdpCommand: 244 jmp SHORT ReturnFromSdpCommand 245 246 247 ;-------------------------------------------------------------------- 248 ; WriteNextChangedByteFromPageToEeprom 249 ; Parameters: 245 jmp SHORT ReturnFromSdpCommand 246 247 DoNotWriteAnySdpCommand EQU ReturnFromSdpCommand 248 249 250 ;-------------------------------------------------------------------- 251 ; WriteAllChangedBytesFromPageToEeprom 252 ; Parameters: 253 ; AX: Offset to SDP command function 254 ; BX: Offset to next destination byte 250 255 ; CX: Number of bytes left to write 251 ; DX: Offset to SDP command function252 ; BX: Offset to next destination byte253 256 ; SI: Offset to next source byte 254 257 ; ES:DI: Ptr to next comparison byte … … 258 261 ; Cleared if page written successfully 259 262 ; Corrupts registers: 260 ; AX, BX, CX, SI, DI, DS, ES263 ; AX, BX, CX, DX, SI, DI, DS, ES 261 264 ;-------------------------------------------------------------------- 262 265 ALIGN JUMP_ALIGN 263 266 WriteAllChangedBytesFromPageToEeprom: 264 mov ax, [bp+FLASHVARS.fpNextSourcePage+2] ; AX = Source segment267 mov dx, [bp+FLASHVARS.fpNextSourcePage+2] ; DX = Source segment 265 268 mov ds, [bp+FLASHVARS.fpNextDestinationPage+2] ; DS = EEPROM segment 266 269 cli ; Disable interrupts 267 jmp dx ; Write SDP command (once to the beginning of page)270 jmp ax ; Write SDP command (once to the beginning of page) 268 271 ALIGN JUMP_ALIGN 269 272 ReturnFromSdpCommand: 270 mov ds, ax ; DS:SI now points to source byte273 mov ds, dx ; DS:SI now points to source byte 271 274 272 275 ALIGN JUMP_ALIGN … … 278 281 mov ds, [bp+FLASHVARS.fpNextDestinationPage+2] ; DS:BX now points to EEPROM 279 282 mov [bx], al ; Write byte to EEPROM 280 mov ds, [bp+FLASHVARS.fpNextSourcePage+2]; Restore DS283 mov ds, dx ; Restore DS 281 284 mov [bp+FLASHVARS.wLastOffsetWritten], bx 282 285 mov [bp+FLASHVARS.bLastByteWritten], al -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r526 r568 185 185 pop ds 186 186 187 cmp word[cs:g_cfgVars+CFGVARS.wEepromSegment], 0188 jn z.alreadySet187 cmp WORD [cs:g_cfgVars+CFGVARS.wEepromSegment], 0 188 jne .alreadySet 189 189 190 190 push es … … 198 198 mov ax, DEFAULT_EEPROM_SEGMENT 199 199 .storeEepromSegment: 200 mov word[cs:g_cfgVars+CFGVARS.wEepromSegment], ax200 mov WORD [cs:g_cfgVars+CFGVARS.wEepromSegment], ax 201 201 202 202 .alreadySet:
Note:
See TracChangeset
for help on using the changeset viewer.