home *** CD-ROM | disk | FTP | other *** search
- // Listing 3. INPUT.CPP.
- // A first cut at an inline assembly input() method
-
- void statistician::input(int i)
- {
- asm {
- mov si, word ptr [bp+4] // Point to object data with si
- mov ax, word ptr [bp+6] // Load AX with i
- add word ptr [si], ax // sum += i
- inc word ptr [si+2] // n++
- }
- }
-