Assembly Language for Beginners
3.21. MORE ABOUT POINTERS printf ("%d\n", *ptr); }; Hard to believe, but it works, with error upon exit, though: Listing 3.121: ...
3.21. MORE ABOUT POINTERS TheMS-DOSmemorymodelwasreallyweird(11.6)andprobablynotworthlookingintoitunlessyou’refan of retrocomput ...
3.21. MORE ABOUT POINTERS (libio.h file) void*is a data type reflecting the fact it’s the pointer, but to a value of unknown dat ...
3.21. MORE ABOUT POINTERS Who will want to call a function at address 0? This is portable way to jump at zero address. Many low- ...
3.21. MORE ABOUT POINTERS If the keyword static also appears within the [ and ] of the array type derivation, then for each call ...
3.22 Loop optimizations. Apparently, Microsoft “hides” that fact to provide better forward compatibility. Also, HMODULE and HIN- ...
3.22. LOOP OPTIMIZATIONS je SHORT $LN1@f mov eax, DWORD PTR _dst$[esp-4] push esi mov esi, DWORD PTR _src$[esp] sub esi, eax ; E ...
3.22. LOOP OPTIMIZATIONS while ( counter ); } } Nevertheless,thisoptimizationtrickisoftenusedbyMSVC(notjustinDIY^43 homebrewmemc ...
3.23 More about structures. extern:0804A240 ; main+5D extern:0804A244 extrn __printf_chk@@GLIBC_2_3_4:near extern:0804A248 extrn ...
3.23. MORE ABOUT STRUCTURES for (int i=0; i<len; i++) sum=sum+a[i]; return sum/len; }; struct five_ints { int a0; int a1; int ...
3.23. MORE ABOUT STRUCTURES 3.23.2 Unsized array in C structure. In some win32 structures we can find ones with last field defin ...
3.23. MORE ABOUT STRUCTURES Read more about it in GCC documentation^45 , MSDN documentation^46. Dennis Ritchie (one of C creator ...
3.23. MORE ABOUT STRUCTURES if (s->SizeOfStruct>=sizeof(int)*5) { // this is at least ver3, fill_brush_type field is prese ...
3.23. MORE ABOUT STRUCTURES Figure 3.4:High score table Now we can see that the file has changed after we added our name isBLSCO ...
3.23. MORE ABOUT STRUCTURES char name[11]; // incl. terminating zero uint32_t score; char date[11]; // incl. terminating zero } ...
3.23. MORE ABOUT STRUCTURES }; Let’s run Blockout: Figure 3.5:High score table First two digits (1 or 2) are choked. Perhaps, th ...
3.24 memmove() and memcpy() But: if you work on some kind of low-costMCUwith simpleOSon it and you have your structures allocate ...
3.25 setjmp/longjmp `|.|.|h|e|l|l|o|...` -> `|h|e|l|l|o|...` memcpy()which copies 32-bit or 64-bit words at once, or evenSIMD ...
3.25. SETJMP/LONGJMP ... /* return if bits() or decode() tries to read past available input */ if (setjmp(s.env) != 0) /* if cam ...
3.25. SETJMP/LONGJMP jmp_bufstructure usually comes undocumented, to preserve forward compatibility. Let’s see how setjmp() impl ...
«
28
29
30
31
32
33
34
35
36
37
»
Free download pdf