Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
div64 inline asm
//for http://rextester.com/l/cpp_online_compiler_visual //Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86 //#include <iostream> #include <string> #include <boost/filesystem.hpp> #include <Windows.h> //#include <direct.h> using namespace std; static string my_exe(void){ char buf[MAX_PATH]; DWORD tmp = GetModuleFileNameA( NULL, // self buf, MAX_PATH); return buf; //cout << "GMFN: " << tmp << ' ' << buf << endl; } int main() { string dircmd = "dir "; boost::filesystem::path p( my_exe() ); //boost::filesystem::path dir = p.parent_path(); p.remove_filename(); //p.replace_extension(".asm"); system ( (dircmd + p.string()).c_str() ); auto subdir = p.end(); subdir--; // cout << "subdir: " << subdir->c_str() << endl; p /= *subdir; p.replace_extension(".asm"); // cout << "p: " << p.string() << endl; system ( (string("type ") + p.string()).c_str() ); } // MSVC // we could return a struct, but that would complicate thing int div64(int hi, int lo, int divisor, int *premainder) { int quotient, tmp; __asm { mov edx, hi; mov eax, lo; idiv divisor mov quotient, eax mov tmp, edx; // mov ecx, premainder // Or this I guess? // mov [ecx], edx } *premainder = tmp; return quotient; }
run
|
edit
|
history
|
help
0
Full System Specifications version 2
dharmesh
"Mostly invalid states" and unordered_set
ExtThes_Uniquify
bitfields_msvc
MSVC initializer code
C++ standard library formatted input hexadecimal float without prefix or exponent test case
Program_2
Hangman
codecvt wide string conversion with multibyte chars and locale + concatenation