; 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        DWORD  56
B        DWORD  34

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

         .CODE
Start:
         call   MaxDword
         

         XOR    EAX,EAX
         Invoke StdOut,ADDR MsgExit
         Invoke StdIn,ADDR inbuf,LengthOf inbuf		
	
         Invoke ExitProcess,0
 
 MaxDword PROC 
          push   EAX
          push   EBX
          lea    EBX,D
          mov    EAX,A
          cmp    EAX,B
          jg     con
          mov    EAX,B
 con:     mov    [EBX],EAX
          pop    EBX
          pop    EAX
          ret    
 MaxDword ENDP
          End    Start

