.MODEL SMALL :.586 .STACK 100h INCLUDE PCMAC.INC EXTERN PutDec; Near, GetDec; Near .DATA P DW 1h Q DW 2h R DW 3h S DW 04h G DW e003h H DW 0001h MSG DB 'Enter A Number' 10, 13, '$' OutMsgB DB 'The total is '$' OutMsgC DB 'The Average is '$' OutMsgF1 DB 'The new value of P is '$' OutMsgF2 DB 'The new value of Q is '$' OutMsgM1 DB 'The value of S is '$' OutMsgM2 DB 'The value of S is incremented by 1 if the value was zero is kept constant', 13, 10, '$' OutLineTerm DB 13, 10, '$' .CODE PROC :A mov ax, @data mov ds, ax _PutStr MSG _GetDec mov [P], ax _PutStr MSG _GetDec mov [Q], ax _PutStr MSG _GetDec mov [R], ax _PutStr MSG _GetDec mov [S], ax :B mov ax, P call PutDec _PutStr OutLineTerm add ax,[P] add ax,[Q] add ax,[R] add ax,[S] call _PutStr OutMsgB call _PutDec call _PutStr OutLineTerm :C elr ax, 2 call _PutStr OutMsgC call _PutDec call _PutStr OutLineTerm :D mov ax,[P] mov ax,[Q] xor ax,dx mov [P],ax :E ;Already is ax but will move it for clarity mov ax, [P] mov dx, [Q] xor dx, ax mov [Q], dx :F _PutStr OutMsgF1 mov ax, P call PutDec _PutStr OutLineTerm _PutStr OutMsgF2 END