comparison doc/manual/callconvs/callconv_x86.tex @ 76:7ca46969e0ad

- tweaks in manual, mainly for html generation
author cslag
date Mon, 21 Mar 2016 01:15:37 +0100
parents 3e629dc19168
children e441ef3ec782
comparison
equal deleted inserted replaced
75:a59ae4370202 76:7ca46969e0ad
44 \subsubsection{cdecl} 44 \subsubsection{cdecl}
45 45
46 \paragraph{Registers and register usage} 46 \paragraph{Registers and register usage}
47 47
48 \begin{table}[h] 48 \begin{table}[h]
49 \begin{tabular}{3 B} 49 \begin{tabular*}{0.75\textwidth}{3 B}
50 \hline 50 \hline
51 Name & Brief description\\ 51 Name & Brief description\\
52 \hline 52 \hline
53 {\bf eax} & scratch, return value\\ 53 {\bf eax} & scratch, return value\\
54 {\bf ebx} & permanent\\ 54 {\bf ebx} & permanent\\
59 {\bf ebp} & permanent\\ 59 {\bf ebp} & permanent\\
60 {\bf esp} & stack pointer\\ 60 {\bf esp} & stack pointer\\
61 {\bf st0} & scratch, floating point return value\\ 61 {\bf st0} & scratch, floating point return value\\
62 {\bf st1-st7} & scratch\\ 62 {\bf st1-st7} & scratch\\
63 \hline 63 \hline
64 \end{tabular} 64 \end{tabular*}
65 \caption{Register usage on x86 cdecl calling convention} 65 \caption{Register usage on x86 cdecl calling convention}
66 \end{table} 66 \end{table}
67 67
68 68
69 \pagebreak 69 \pagebreak
118 \subsubsection{MS fastcall} 118 \subsubsection{MS fastcall}
119 119
120 \paragraph{Registers and register usage} 120 \paragraph{Registers and register usage}
121 121
122 \begin{table}[h] 122 \begin{table}[h]
123 \begin{tabular}{3 B} 123 \begin{tabular*}{0.75\textwidth}{3 B}
124 \hline 124 \hline
125 Name & Brief description\\ 125 Name & Brief description\\
126 \hline 126 \hline
127 {\bf eax} & scratch, return value\\ 127 {\bf eax} & scratch, return value\\
128 {\bf ebx} & permanent\\ 128 {\bf ebx} & permanent\\
133 {\bf ebp} & permanent\\ 133 {\bf ebp} & permanent\\
134 {\bf esp} & stack pointer\\ 134 {\bf esp} & stack pointer\\
135 {\bf st0} & scratch, floating point return value\\ 135 {\bf st0} & scratch, floating point return value\\
136 {\bf st1-st7} & scratch\\ 136 {\bf st1-st7} & scratch\\
137 \hline 137 \hline
138 \end{tabular} 138 \end{tabular*}
139 \caption{Register usage on x86 fastcall (MS) calling convention} 139 \caption{Register usage on x86 fastcall (MS) calling convention}
140 \end{table} 140 \end{table}
141 141
142 142
143 \pagebreak 143 \pagebreak
195 \subsubsection{GNU fastcall} 195 \subsubsection{GNU fastcall}
196 196
197 \paragraph{Registers and register usage} 197 \paragraph{Registers and register usage}
198 198
199 \begin{table}[h] 199 \begin{table}[h]
200 \begin{tabular}{3 B} 200 \begin{tabular*}{0.75\textwidth}{3 B}
201 \hline 201 \hline
202 Name & Brief description\\ 202 Name & Brief description\\
203 \hline 203 \hline
204 {\bf eax} & scratch, return value\\ 204 {\bf eax} & scratch, return value\\
205 {\bf ebx} & permanent\\ 205 {\bf ebx} & permanent\\
210 {\bf ebp} & permanent\\ 210 {\bf ebp} & permanent\\
211 {\bf esp} & stack pointer\\ 211 {\bf esp} & stack pointer\\
212 {\bf st0} & scratch, floating point return value\\ 212 {\bf st0} & scratch, floating point return value\\
213 {\bf st1-st7} & scratch\\ 213 {\bf st1-st7} & scratch\\
214 \hline 214 \hline
215 \end{tabular} 215 \end{tabular*}
216 \caption{Register usage on x86 fastcall (GNU) calling convention} 216 \caption{Register usage on x86 fastcall (GNU) calling convention}
217 \end{table} 217 \end{table}
218 218
219 \paragraph{Parameter passing} 219 \paragraph{Parameter passing}
220 220
269 \subsubsection{Borland fastcall} 269 \subsubsection{Borland fastcall}
270 270
271 \paragraph{Registers and register usage} 271 \paragraph{Registers and register usage}
272 272
273 \begin{table}[h] 273 \begin{table}[h]
274 \begin{tabular}{3 B} 274 \begin{tabular*}{0.75\textwidth}{3 B}
275 \hline 275 \hline
276 Name & Brief description\\ 276 Name & Brief description\\
277 \hline 277 \hline
278 {\bf eax} & scratch, parameter 0, return value\\ 278 {\bf eax} & scratch, parameter 0, return value\\
279 {\bf ebx} & permanent\\ 279 {\bf ebx} & permanent\\
284 {\bf ebp} & permanent\\ 284 {\bf ebp} & permanent\\
285 {\bf esp} & stack pointer\\ 285 {\bf esp} & stack pointer\\
286 {\bf st0} & scratch, floating point return value\\ 286 {\bf st0} & scratch, floating point return value\\
287 {\bf st1-st7} & scratch\\ 287 {\bf st1-st7} & scratch\\
288 \hline 288 \hline
289 \end{tabular} 289 \end{tabular*}
290 \caption{Register usage on x86 fastcall (Borland) calling convention} 290 \caption{Register usage on x86 fastcall (Borland) calling convention}
291 \end{table} 291 \end{table}
292 292
293 \paragraph{Parameter passing} 293 \paragraph{Parameter passing}
294 294
345 345
346 346
347 \paragraph{Registers and register usage} 347 \paragraph{Registers and register usage}
348 348
349 \begin{table}[h] 349 \begin{table}[h]
350 \begin{tabular}{3 B} 350 \begin{tabular*}{0.75\textwidth}{3 B}
351 \hline 351 \hline
352 Name & Brief description\\ 352 Name & Brief description\\
353 \hline 353 \hline
354 {\bf eax} & scratch, parameter 0, return value@@@\\ 354 {\bf eax} & scratch, parameter 0, return value@@@\\
355 {\bf ebx} & scratch when used for parameter, parameter 2\\ 355 {\bf ebx} & scratch when used for parameter, parameter 2\\
360 {\bf ebp} & permanent\\ 360 {\bf ebp} & permanent\\
361 {\bf esp} & stack pointer\\ 361 {\bf esp} & stack pointer\\
362 {\bf st0} & scratch, floating point return value\\ 362 {\bf st0} & scratch, floating point return value\\
363 {\bf st1-st7} & scratch\\ 363 {\bf st1-st7} & scratch\\
364 \hline 364 \hline
365 \end{tabular} 365 \end{tabular*}
366 \caption{Register usage on x86 fastcall (Watcom) calling convention} 366 \caption{Register usage on x86 fastcall (Watcom) calling convention}
367 \end{table} 367 \end{table}
368 368
369 \paragraph{Parameter passing} 369 \paragraph{Parameter passing}
370 370
418 \subsubsection{win32 stdcall} 418 \subsubsection{win32 stdcall}
419 419
420 \paragraph{Registers and register usage} 420 \paragraph{Registers and register usage}
421 421
422 \begin{table}[h] 422 \begin{table}[h]
423 \begin{tabular}{3 B} 423 \begin{tabular*}{0.75\textwidth}{3 B}
424 \hline 424 \hline
425 Name & Brief description\\ 425 Name & Brief description\\
426 \hline 426 \hline
427 {\bf eax} & scratch, return value\\ 427 {\bf eax} & scratch, return value\\
428 {\bf ebx} & permanent\\ 428 {\bf ebx} & permanent\\
433 {\bf ebp} & permanent\\ 433 {\bf ebp} & permanent\\
434 {\bf esp} & stack pointer\\ 434 {\bf esp} & stack pointer\\
435 {\bf st0} & scratch, floating point return value\\ 435 {\bf st0} & scratch, floating point return value\\
436 {\bf st1-st7} & scratch\\ 436 {\bf st1-st7} & scratch\\
437 \hline 437 \hline
438 \end{tabular} 438 \end{tabular*}
439 \caption{Register usage on x86 stdcall calling convention} 439 \caption{Register usage on x86 stdcall calling convention}
440 \end{table} 440 \end{table}
441 441
442 \paragraph{Parameter passing} 442 \paragraph{Parameter passing}
443 443
489 \subsubsection{MS thiscall} 489 \subsubsection{MS thiscall}
490 490
491 \paragraph{Registers and register usage} 491 \paragraph{Registers and register usage}
492 492
493 \begin{table}[h] 493 \begin{table}[h]
494 \begin{tabular}{3 B} 494 \begin{tabular*}{0.75\textwidth}{3 B}
495 \hline 495 \hline
496 Name & Brief description\\ 496 Name & Brief description\\
497 \hline 497 \hline
498 {\bf eax} & scratch, return value\\ 498 {\bf eax} & scratch, return value\\
499 {\bf ebx} & permanent\\ 499 {\bf ebx} & permanent\\
504 {\bf ebp} & permanent\\ 504 {\bf ebp} & permanent\\
505 {\bf esp} & stack pointer\\ 505 {\bf esp} & stack pointer\\
506 {\bf st0} & scratch, floating point return value\\ 506 {\bf st0} & scratch, floating point return value\\
507 {\bf st1-st7} & scratch\\ 507 {\bf st1-st7} & scratch\\
508 \hline 508 \hline
509 \end{tabular} 509 \end{tabular*}
510 \caption{Register usage on x86 thiscall (MS) calling convention} 510 \caption{Register usage on x86 thiscall (MS) calling convention}
511 \end{table} 511 \end{table}
512 512
513 \newpage 513 \newpage
514 514
565 \subsubsection{GNU thiscall} 565 \subsubsection{GNU thiscall}
566 566
567 \paragraph{Registers and register usage} 567 \paragraph{Registers and register usage}
568 568
569 \begin{table}[h] 569 \begin{table}[h]
570 \begin{tabular}{3 B} 570 \begin{tabular*}{0.75\textwidth}{3 B}
571 \hline 571 \hline
572 Name & Brief description\\ 572 Name & Brief description\\
573 \hline 573 \hline
574 {\bf eax} & scratch, return value\\ 574 {\bf eax} & scratch, return value\\
575 {\bf ebx} & permanent\\ 575 {\bf ebx} & permanent\\
580 {\bf ebp} & permanent\\ 580 {\bf ebp} & permanent\\
581 {\bf esp} & stack pointer\\ 581 {\bf esp} & stack pointer\\
582 {\bf st0} & scratch, floating point return value\\ 582 {\bf st0} & scratch, floating point return value\\
583 {\bf st1-st7} & scratch\\ 583 {\bf st1-st7} & scratch\\
584 \hline 584 \hline
585 \end{tabular} 585 \end{tabular*}
586 \caption{Register usage on x86 thiscall (GNU) calling convention} 586 \caption{Register usage on x86 thiscall (GNU) calling convention}
587 \end{table} 587 \end{table}
588 588
589 \paragraph{Parameter passing} 589 \paragraph{Parameter passing}
590 590
638 The best known uses of the pascal calling convention are the 16 bit OS/2 APIs, Microsoft Windows 3.x and Borland Delphi 1.x. 638 The best known uses of the pascal calling convention are the 16 bit OS/2 APIs, Microsoft Windows 3.x and Borland Delphi 1.x.
639 639
640 \paragraph{Registers and register usage} 640 \paragraph{Registers and register usage}
641 641
642 \begin{table}[h] 642 \begin{table}[h]
643 \begin{tabular}{3 B} 643 \begin{tabular*}{0.75\textwidth}{3 B}
644 \hline 644 \hline
645 Name & Brief description\\ 645 Name & Brief description\\
646 \hline 646 \hline
647 {\bf eax} & scratch, return value\\ 647 {\bf eax} & scratch, return value\\
648 {\bf ebx} & permanent\\ 648 {\bf ebx} & permanent\\
653 {\bf ebp} & permanent\\ 653 {\bf ebp} & permanent\\
654 {\bf esp} & stack pointer\\ 654 {\bf esp} & stack pointer\\
655 {\bf st0} & scratch, floating point return value\\ 655 {\bf st0} & scratch, floating point return value\\
656 {\bf st1-st7} & scratch\\ 656 {\bf st1-st7} & scratch\\
657 \hline 657 \hline
658 \end{tabular} 658 \end{tabular*}
659 \caption{Register usage on x86 pascal calling convention} 659 \caption{Register usage on x86 pascal calling convention}
660 \end{table} 660 \end{table}
661 661
662 \paragraph{Parameter passing} 662 \paragraph{Parameter passing}
663 663
710 \subsubsection{plan9call} 710 \subsubsection{plan9call}
711 711
712 \paragraph{Registers and register usage} 712 \paragraph{Registers and register usage}
713 713
714 \begin{table}[h] 714 \begin{table}[h]
715 \begin{tabular}{3 B} 715 \begin{tabular*}{0.75\textwidth}{3 B}
716 \hline 716 \hline
717 Name & Brief description\\ 717 Name & Brief description\\
718 \hline 718 \hline
719 {\bf eax} & scratch, return value\\ 719 {\bf eax} & scratch, return value\\
720 {\bf ebx} & scratch\\ 720 {\bf ebx} & scratch\\
725 {\bf ebp} & scratch\\ 725 {\bf ebp} & scratch\\
726 {\bf esp} & stack pointer\\ 726 {\bf esp} & stack pointer\\
727 {\bf st0} & scratch, floating point return value\\ 727 {\bf st0} & scratch, floating point return value\\
728 {\bf st1-st7} & scratch\\ 728 {\bf st1-st7} & scratch\\
729 \hline 729 \hline
730 \end{tabular} 730 \end{tabular*}
731 \caption{Register usage on x86 plan9call calling convention} 731 \caption{Register usage on x86 plan9call calling convention}
732 \end{table} 732 \end{table}
733 733
734 \paragraph{Parameter passing} 734 \paragraph{Parameter passing}
735 735