; Template for console application
         .586
         .MODEL  flat, stdcall
         OPTION CASEMAP:NONE

Include kernel32.inc
Include masm32.inc

IncludeLib kernel32.lib
IncludeLib masm32.lib

         .CONST
MsgExit  DB    "Press Enter to Exit",0AH,0DH,0

         .DATA
A        SWORD 25
B        SWORD -6
D        SWORD 11        

         .DATA?
X        SWORD ?
inbuf    DB    100 DUP (?)

         .CODE
Start:
         mov    CX,D
         add    CX,8
         mov    BX,B
         dec    BX
         mov    AX,A
         add    AX,D
         imul   BX
         idiv   CX
         mov    X,AX 
         
         XOR    EAX,EAX
         Invoke StdOut,ADDR MsgExit
         Invoke StdIn,ADDR inbuf,LengthOf inbuf		
	
         Invoke ExitProcess,0
         End    Start

