Add the support for ret. Fix many bugs to run the full fugure 4.8 code while the data is in big endian.