ok two snippets:
Code:
;--------------------------------------------------
; erase single sector ... X MUST have the bankvalue!
ssectorerase:
LDA #$11
STA $de01 ;set bank
LDA #$aa
STA $9555 ;this is a write to $5555 of the chip - cycle one
LDA #$09
STA $de01 ;set bank
LDA #$55
STA $8aaa ;this is a write to $2aaa of the chip - cycle two
LDA #$11
STA $de01 ;set bank
LDA #$80
STA $9555 ;write $80 to $5555 - cycle four
LDA #$11
STA $de01 ;set bank
LDA #$aa
STA $9555 ;this is a write to $5555 of the chip - cycle five
LDA #$09
STA $de01 ;set bank
LDA #$55
STA $8aaa ;this is a write to $2aaa of the chip - cyclce six
; - unlock sequence complete
;-------------------- each of the sector erases need to happen within
;-------------------- 50 microseconds after the last erase command
STX $de01 ;set sector you wish to erase
LDA #$30
STA $8000 ;erase the sector SA/30
and
Code:
;=========================================================
; X has bank - y has data - $fa/$fb have address
byteprogram:
LDA #$11
STA $de01 ;set bank
LDA #$aa
STA $9555 ;this is a write to $5555 of the chip
LDA #$09
STA $de01 ;set bank
LDA #$55
STA $8aaa ;this is a write to $2aaa of the chip
LDA #$11
STA $de01 ;set bank
LDA #$a0
STA $9555 ;write $a0 to $5555
STX $de01 ;set bank you desire
tya
ldy #$00
STA ($fa),y ;write to address you wish to write
hope that gives you an idea of how it works