; 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  24
B        SWORD  18

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

         .CODE
Start:
         mov    AX,A
         mov    BX,B
cycle:   cmp    AX,BX
         je     kon
         jl     lit
         sub    AX,BX
         jmp    short com
lit:     sub    BX,AX
com:     jmp    cycle
kon:     mov    D,AX

         XOR    EAX,EAX
         Invoke StdOut,ADDR MsgExit
         Invoke StdIn,ADDR inbuf,LengthOf inbuf		
	
         Invoke ExitProcess,0
         End    Start

