Apr 12th, 2014
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //#define LIMIT 255
  2. //Cho User2System là một lớp của machine luôn cho dễ sử dụng
  3. //nachos-3.4/code.../
  4. case SC_ReadString:
  5. {//begin ReadString
  7.     int buffAddr = machine->ReadRegister(4); // đọc địa chỉ chuỗi buff từ thanh ghi 4 (con trỏ giữ vùng nhớ buff)
  8.     int leng = machine->ReadRegister(5); // đọc giá trị length từ thanh ghi 5
  9.     char* buffer = new buffer[LIMIT];
  10.     buffer = machine->User2System(buffAddr, LIMIT); // chuyển chuỗi trong con trỏ buffAddr sang vùng nhớ buffer
  11.     delete buffer;
  14. }//end ReadString
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add to your ad blocker whitelist or disable your adblocking software.