home *** CD-ROM | disk | FTP | other *** search
- // Listing 4: INPUT2.CPP.
- // inline assembly input() referencing C++ names
-
- void statistician::input(int i)
- {
- asm {
- mov si, word ptr this // Point to object data with si
- mov ax, word ptr i // Load AX with i
- add word ptr [si].sum, ax // sum += i
- inc word ptr [si].n // n++
- }
- }