User Tools

Site Tools


NMI Lock Without Kernal

Modification of the example given at NMI lock. The NMI is locked without using kernal routines and without using RAM at $0318/$0319.

  ; 'Disable NMI' without using kernal and $0318/$0319 by Sokrates

  sei  ;; switch off interrupt
  lda #$35 ;; all RAM except D000-Dfff 
  sta $01  ;; write to $FFFA/$FFFB now possible
  lda #<nmiRoutine ;; change nmi vector to nmiRoutine
  sta $FFFA		     
  lda #>nmiRoutine
  sta $FFFB 			
  lda #$00  ;; stop Timer A
  sta $DD0E 
  sta $DD04 ;; set Timer A to 0, after starting
  sta $DD05 ;; NMI will occur immediately
  lda #$81  
  sta $DD0D ;; set Timer A as source for NMI 
  lda #$01  
  sta $DD0E ;; start Timer A -> NMI
  ;; from here on NMI is disabled

  rti ;; exit interrupt not acknowledged 
base/nmi_lock_without_kernal.txt · Last modified: 2016-10-05 12:05 by sokrates