Save_Parameters:
  CLR   EA                ; Temporarily disable all interrupts
  MOV   PSCTL, #003H      ; Set PSEE and PSWE. FLASH can now be erased
  MOV   FLKEY, #0A5H    
  MOV   FLKEY, #0F1H      ; Flash unlock sequence
  MOV   DPTR, #3A00H      ; Set the DPTR to the start of the non-volatile parameter table
  MOVX  @DPTR, A          ; Perform a memory write; this will erase the page
  MOV   PSCTL, #001H      ; Clear PSEE. FLASH can now be written
  MOV   R0, #Parameters   ; Use R0 as readpointer to the working parameter table
  MOV   R6, #15           ; The table is 14 bytes long
Write_loop:
  MOV   FLKEY, #0A5H
  MOV   FLKEY, #0F1H      ; Flash unlock sequence
  MOV   A,@R0             ; Get a byte from the table
  MOVX  @DPTR,A           ; Write it to FLASH
  INC   R0                ; Increment the readpointer
  INC   DPTR              ; Increment the writepointer
  DJNZ  R6, Write_loop    ; Repeat for all bytes in the table

  MOV   PSCTL,#000H       ; Clear PSWE. FLASH can now only be read
  SETB  EA                ; Re-enable interrupts 
  RET