Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GetFloppySize: //015 - | eax = size
- push es;
- push ebx;
- push ecx;
- push edx;
- mov es,floppy;
- mov ebx,65536; //stepsize
- mov eax,0; //output
- mov ecx,0; //the byte to be checked
- mov edx,0;
- mov es:#ecx,5;
- cmp es:#ecx,5;
- jne End_015;
- mov es:#ecx,0;
- add ecx,ebx;
- Loop_015:
- mov es:#ecx,5;
- out 4,#MemoryErrorFlag;
- cmp es:#ecx,5;
- jne NP_015;
- cmp #MemoryErrorFlag,1;
- je NP_015;
- mov es:#ecx,0;
- cmp ebx,1;
- je End_P_015;
- add ecx,ebx;
- jmp Loop_015;
- NP_015:
- mov #MemoryErrorFlag,0;
- cmp ebx,1;
- je End_NP_015;
- div ebx,2;
- sub ecx,ebx;
- jmp Loop_015;
- End_P_015:
- mov eax,ecx;
- inc eax;
- jmp End_015;
- End_NP_015:
- mov eax,ecx;
- jmp End_015;
- End_015:
- add esp,#MemoryErrorCounter;
- pop edx;
- pop ecx;
- pop ebx;
- pop es;
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement