The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => Easy Code => Topic started by: starlight on January 07, 2010, 07:08:53 AM

Title: Need HLEP plz
Post by: starlight on January 07, 2010, 07:08:53 AM
Hi all, I'm an electric engineer and I have this one course about the 8086 & 8088 software and hardware. For the software part I've been asked by my prof. to do a simple calculator similar to the one in windows that only add and sub two numbers using Easy Code. So, I wrote the code for addtion first and checked. I chose fisrt number works fine, after I push + button , I should be able to choose the second number, but that's not the case. I'm really new to Easy Code and I would appreciate any help and here is my code.

.Const

.Data?
edit1 HANDLE ?
sum DWord ?
ans DWord ?
num1 DWord ?
num2 DWord ?

.Data

.Code

Window1Procedure Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
.If uMsg == WM_CREATE
      Invoke GetWindowItem, hWnd, IDC_WINDOW1_EDIT1
      Mov edit1, Eax

     .ElseIf uMsg == WM_COMMAND
        LoWord wParam
        .If Ax == IDC_WINDOW1_BUTTON1
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 1D
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf


          .ElseIf Ax == IDC_WINDOW1_BUTTON2
           HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 2D
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

          .ElseIf Ax == IDC_WINDOW1_BUTTON3
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 3D
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

           .ElseIf Ax == IDC_WINDOW1_BUTTON4
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 4D
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

         .ElseIf Ax == IDC_WINDOW1_BUTTON5
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 5D
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

          .ElseIf Ax == IDC_WINDOW1_BUTTON6
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 6D
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

          .ElseIf Ax == IDC_WINDOW1_BUTTON7
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 7D
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

          .ElseIf Ax == IDC_WINDOW1_BUTTON8
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 8D
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

          .ElseIf Ax == IDC_WINDOW1_BUTTON9
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 9D
                 Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

          .ElseIf Ax == IDC_WINDOW1_BUTTON10
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Eax, 0
                Mov num1, Eax
          Invoke String, num1, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON11
          HiWord wParam
            .If Ax == BN_CLICKED

          .If Ax == IDC_WINDOW1_BUTTON1
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 1D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON2
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 2D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans           
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON3
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 3D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON4
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 4D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON5
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 5D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON6
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 6D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON7
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 7D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON8
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 8D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON9
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 9D
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
            .EndIf

     .ElseIf Ax == IDC_WINDOW1_BUTTON10
          HiWord wParam
            .If Ax == BN_CLICKED
            Mov Ebx, 0
                Mov num2, Ebx
          Invoke String, num2, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans
             .EndIf
       .EndIf
.EndIf



     .ElseIf Ax == IDC_WINDOW1_BUTTON13
          HiWord wParam
            .If Ax == BN_CLICKED
                Mov Eax, num1
                Add Eax, num2
                Mov sum, Eax

          Invoke String, sum, Addr ans, ecDecimal
          Invoke SetText, edit1, Addr ans

            .EndIf
  .EndIf

.ElseIf uMsg == WM_CLOSE
Invoke IsModal, hWnd
.If Eax
Invoke EndModal, hWnd, IDCANCEL
Return TRUE
.EndIf
.EndIf
Return FALSE
Window1Procedure EndP

Title: Re: Need HLEP plz
Post by: Ramon Sala on January 07, 2010, 09:31:23 AM
Hi starlight,

Could you send the whole project to me (rsala@easycode.cat)? I'll try to find the problem. Thanks.

Regards,

Ramon
Title: Re: Need HLEP plz
Post by: starlight on January 07, 2010, 01:57:03 PM
Message sent.
Title: Re: Need HLEP plz
Post by: Ramon Sala on January 08, 2010, 09:19:13 AM
Hi starlight,

I sent the project, now working fine, to your email address.

Regards.
Title: Re: Need HLEP plz
Post by: starlight on January 08, 2010, 03:07:52 PM
Thank you sir very much, but i'm sorry to inform that i didn't receive any messages, I double checked the inbox and spam. if you kindly resend it to sami.j20@gmail.com .
thank you again.
Title: Re: Need HLEP plz
Post by: Ramon Sala on January 08, 2010, 08:33:49 PM
Just right away!