| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | For loops in C... |
Hi, Paul.
RM> BL> I can't see much point in using the inline directive in Pascal,
RM> BL> unless it is doing the code wrong or you have a specific instruction
RM> BL> you want inserted right there. Mostly, the Pascal compiler writes what
RM> BL> I would have written inline anyway.
RM> er.. does inline mean the same in Pascal as it does in C? In C, it
RM> means that when you write a function call, like
RM> z = add_numbers(x,y);
RM> then instead of placing a call to the function add_numbers() at
RM> that point, the compiler writes a complete copy of the code for
RM> add_numbers, eliminating the function call.
In Borland Turbo Pascal "inline" is a real kludge which only lets you
write machine language opcodes, in an arcane format, but give it a
function name which, when invoked, copies that code directly into that
point of the program. For example, I have in my "Useful" library...
function MulDiv (x, y, z: integer): integer;
inline ($59/$5A/$58/$F7/$EA/$F7/$F9);
{ MulDiv := x * y / z; pop cx; pop dx; pop ax; imul dx; idiv cx}
which is really useful for example for fast line slope calculations.
Regards, fIM.
* * When guns are outlawed only the criminals will have guns!
@EOT:
---
* Origin: Pedants Inc. (3:711/934.24)SEEN-BY: 711/934 712/610 624 @PATH: 711/934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.