Author Topic: help please: masm32 input dialog box  (Read 349 times)

Mads379

  • Regular Member
  • *
  • Posts: 1
help please: masm32 input dialog box
« on: September 16, 2018, 10:08:47 PM »
how can i change the display into dialog input box instead of cmd.

Code: [Select]

TITLE my program ()

INCLUDE irvine32.inc
INCLUDE Macros.inc

.data
str1 BYTE "Enter two integers: ", 0
str4 BYTE "The highest integer: ", 0dh, 0ah, 0
str6 BYTE "The smallest integer: ",0dh, 0ah, 0

arrInt DWORD 2 dup(?)
arrLen = LENGTHOF arrInt

.code
main PROC
call getIntUser
call Crlf
call printInt
call Crlf
exit
main ENDP

getIntUser PROC
mov ecx, arrLen
mov edx, OFFSET str1
mov esi, OFFSET arrInt
L1:
   call WriteString
   call ReadInt
   mov [esi], eax
   add esi, TYPE arrInt
   loop L1
   ret
getIntUser ENDP

printInt PROC
mov ecx, arrLen
mov esi, OFFSET arrInt

mov eax, [esi]
add esi, TYPE arrInt
mov ebx, [esi]
.IF eax > ebx
mov edx, OFFSET str4
call WriteString
call WriteDec
call Crlf
mov edx, OFFSET str6
call WriteString
mov eax, ebx
call WriteDec

.ELSE
xchg eax, ebx
mov edx, OFFSET str4
call WriteString
call WriteDec
call Crlf
mov edx, OFFSET str6
call WriteString
mov eax, ebx
call WriteDec
.ENDIF

ret
printInt ENDP

END main

[code]

AW

  • Member
  • *****
  • Posts: 1514
  • Let's Make ASM Great Again!
Re: help please: masm32 input dialog box
« Reply #1 on: September 18, 2018, 05:20:24 PM »
It will not be easy what you want from a console application. Try a windows application.