supporting Semi-host

Reference: zzz0072, fboris
adjusted the memory allocation and added some commands Prototype

(1)Adjusted the memory allocation to avoid the program crash
(2)Added "clear" command and some commands' prototype