Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. GetFloppySize: //015 - | eax = size
  2.  push es;
  3.  push ebx;
  4.  push ecx;
  5.  push edx;
  6.  
  7.  mov es,floppy;
  8.  mov ebx,65536; //stepsize
  9.  mov eax,0; //output
  10.  mov ecx,0; //the byte to be checked
  11.  mov edx,0;
  12.  mov es:#ecx,5;
  13.  cmp es:#ecx,5;
  14.  jne End_015;
  15.  mov es:#ecx,0;
  16.  add ecx,ebx;
  17.  
  18.  Loop_015:
  19.  
  20.   mov es:#ecx,5;
  21.   out 4,#MemoryErrorFlag;
  22.   cmp es:#ecx,5;
  23.   jne NP_015;
  24.   cmp #MemoryErrorFlag,1;
  25.   je NP_015;
  26.   mov es:#ecx,0;
  27.   cmp ebx,1;
  28.   je End_P_015;
  29.   add ecx,ebx;
  30.  
  31.  jmp Loop_015;
  32.  
  33.  NP_015:
  34.   mov #MemoryErrorFlag,0;
  35.   cmp ebx,1;
  36.   je End_NP_015;
  37.   div ebx,2;
  38.   sub ecx,ebx;
  39.   jmp Loop_015;
  40.  
  41. End_P_015:
  42.  mov eax,ecx;
  43.  inc eax;
  44.  jmp End_015;
  45.  
  46. End_NP_015:
  47.  mov eax,ecx;
  48.  jmp End_015;
  49.  
  50. End_015:
  51.  add esp,#MemoryErrorCounter;
  52.  pop edx;
  53.  pop ecx;
  54.  pop ebx;
  55.  pop es;
  56. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement