xor eax, eax ; mov ds, ax ; DS = ES = 0 mov es, ax sti
mov al, 98h out 80h, al
; ; You may add your code here to RW 32bit memory Start ;
;london:can i add pusha and popa? pusha will not affect flags register
mov di,offset spi_rom_256_bytes mov ecx,7fff00h
read_spi_rom_256_bytes: ;set the linear addr(the offset to read) spibar=0fed1f800h mov esi,0fed1f808h ;FADDR--DWORD mov eax,ecx mov dword ptr es:[esi],eax ;"es:" must be added,don't know why?
mov esi,0fed1f806h mov ax,0301h mov word ptr es:[esi],ax
;wait and test if scip(spi cycle in progress) bit cleared and fdone(flash cycle done) bit set,double check? testz: mov esi,0fed1f804h ;HSFS--WORD mov ax, word ptr es:[esi] and ax,0021h ;0000,0000,0010,0001b cmp ax,1h jnz testz
mov esi,0fed1f804h mov ax, word ptr es:[esi] and ax,06h cmp ax,0 jnz endz