Note: 

1)Download this code using JTAG Emulator

2) Connect a serial comm cable to pc And open terminal/ hyperterminal

3) on startup it will display a message and select the test accordingly

serial comm config: 115200 8bit, no parity,1 stopbit, flow control none.

I ran this code on DDR, in Nor flash mode.