Changeset 592 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm
r568 r592 78 78 ALIGN JUMP_ALIGN 79 79 Flash_SinglePageWithFlashvarsInSSBP: 80 %ifdef CLD_NEEDED 80 81 cld 82 %endif 81 83 call AreSourceAndDestinationPagesEqualFromFlashvarsInSSBP 82 84 je SHORT .NoNeedToFlashThePage ; CF cleared … … 305 307 ALIGN JUMP_ALIGN 306 308 WaitUntilEepromPageWriteHasCompleted: 307 call .InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP308 mov es, [bp+FLASHVARS.fpNextDestinationPage+2]309 mov di, [bp+FLASHVARS.wLastOffsetWritten]310 ALIGN JUMP_ALIGN311 .PollEeprom:312 call .HasWriteCycleCompleted313 je SHORT .PageWriteCompleted ; CF cleared314 call TimerTicks_GetTimeoutTicksLeftToAXfromDSBX315 jnc SHORT .PollEeprom316 ALIGN JUMP_ALIGN317 .PageWriteCompleted:318 ret319 320 ;--------------------------------------------------------------------321 ; .InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP322 ; Parameters:323 ; SS:BP: Ptr to FLASHVARS324 ; Returns:325 ; DS:BX: Ptr to timeout counter variable326 ; Corrupts registers:327 ; AX328 ;--------------------------------------------------------------------329 ALIGN JUMP_ALIGN330 .InitializeTimeoutCounterForEepromPollingWithFlashvarsInSSBP:331 309 push ss 332 310 pop ds 333 311 lea bx, [bp+FLASHVARS.wTimeoutCounter] 334 312 mov ax, EEPROM_POLLING_TIMEOUT_TICKS 335 jmp TimerTicks_InitializeTimeoutFromAX 336 337 ;-------------------------------------------------------------------- 338 ; .HasWriteCycleCompleted 339 ; Parameters: 340 ; ES:DI: Ptr to last written byte in EEPROM 341 ; SS:BP: Ptr to FLASHVARS 342 ; Returns: 343 ; ZF: Set if write cycle has completed 344 ; Cleared if write cycle in progress 345 ; Corrupts registers: 346 ; AX 347 ;-------------------------------------------------------------------- 348 ALIGN JUMP_ALIGN 349 .HasWriteCycleCompleted: 350 mov ah, [es:di] ; Load byte from EEPROM 351 mov al, [bp+FLASHVARS.bLastByteWritten] 352 and ax, 8080h ; Clear all but bit 7 from both bytes 353 cmp al, ah ; Set ZF if high bits are the same 354 ret 355 313 call TimerTicks_InitializeTimeoutFromAX 314 mov es, [bp+FLASHVARS.fpNextDestinationPage+2] 315 mov di, [bp+FLASHVARS.wLastOffsetWritten] 316 ALIGN JUMP_ALIGN 317 .PollEeprom: 318 mov al, [es:di] ; Load byte from EEPROM 319 xor al, [bp+FLASHVARS.bLastByteWritten] ; Clear SF if the most significant bits are the same 320 jns SHORT .PageWriteCompleted ; With CF cleared 321 call TimerTicks_GetTimeoutTicksLeftToAXfromDSBX 322 jnc SHORT .PollEeprom 323 ALIGN JUMP_ALIGN, ret 324 .PageWriteCompleted: 325 ret 356 326 357 327 ;--------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.