a sample code for protect-mode.