home *** CD-ROM | disk | FTP | other *** search
- ;
- ; dototal.asm
- ; Use with showtot.c to demo linking ASM with C
- ;
- DOSSEG
- .MODEL SMALL
- .DATA
- EXTRN _Repetitions:WORD
- PUBLIC _StartingValue
- _StartingValue DW 0
- .DATA?
- RunningTotal DW ?
- .CODE
- PUBLIC _DoTotal
- _DoTotal PROC
- mov cx,[_Repetitions]
- mov ax,[_StartingValue]
- mov [RunningTotal],ax
- TotalLoop:
- inc [RunningTotal]
- loop TotalLoop
- mov ax,[RunningTotal]
- ret
- _DoTotal ENDP
- END