This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:papc:chapter_6_9 [2026/02/20 12:00] – [Compatibility with HLL Compilers (C++, C#) and Operating Systems] pczekalski | en:multiasm:papc:chapter_6_9 [2026/02/27 02:50] (current) – [Merging of the High-Level Languages and Assembler Code] jtokarz | ||
|---|---|---|---|
| Line 31: | Line 31: | ||
| ==== Dynamic memory management considerations ==== | ==== Dynamic memory management considerations ==== | ||
| - | Using dynamic memory management at the level of the assembler code is troublesome: | + | Using dynamic memory management at the assembler |
| <note tip> | <note tip> | ||
| + | <figure dynamicmemory> | ||
| + | {{ : | ||
| + | < | ||
| + | </ | ||
| ==== Pure Assembler Applications for Windows CMD ==== | ==== Pure Assembler Applications for Windows CMD ==== | ||
| It is possible to write an application for Windows solely in assembler. While the reason to do it is doubtful, some hints presented below, such as calling system functions, may be helpful. | It is possible to write an application for Windows solely in assembler. While the reason to do it is doubtful, some hints presented below, such as calling system functions, may be helpful. | ||
| Line 128: | Line 132: | ||
| int main() | int main() | ||
| { | { | ||
| - | dllHandle = LoadLibrary(TEXT(" | + | |
| - | if (!dllHandle) | + | if (!dllHandle) |
| - | { | + | { |
| - | std::cerr << " | + | std::cerr << " |
| - | return 1; | + | return 1; |
| - | } | + | } |
| - | MyProc myAsmProcedure = (MyProc)GetProcAddress(dllHandle, | + | MyProc myAsmProcedure = (MyProc)GetProcAddress(dllHandle, |
| - | if (!myAsmProcedure) | + | if (!myAsmProcedure) |
| - | { | + | { |
| - | std::cerr << " | + | std::cerr << " |
| - | FreeLibrary(dllHandle); | + | FreeLibrary(dllHandle); |
| - | return 2; | + | return 2; |
| - | } | + | } |
| - | std::cout << myAsmProcedure(); | + | std::cout << myAsmProcedure(); |
| - | FreeLibrary(dllHandle); | + | FreeLibrary(dllHandle); |
| - | return 0; | + | return 0; |
| } | } | ||
| Line 270: | Line 274: | ||
| std::cout << " | std::cout << " | ||
| returnValue = addInAsm(a, | returnValue = addInAsm(a, | ||
| - | std::cout << "Sum of " << a << " and " << b << " is " << returnValue << std::endl; | + | std::cout << "Sum of " << a << " and " << b << " is " << returnValue |
| + | | ||
| return 0; | return 0; | ||
| } | } | ||
| </ | </ | ||