⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 w.asm

📁 汇编语言的课程设计
💻 ASM
📖 第 1 页 / 共 5 页
字号:
                        invoke SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                            invoke	SetFocus,hWnd                        
                    .ENDIF
                    .endif
 
                .elseif emptyflags==2 || emptyflags==3
                    invoke GetWindowText,hwndEdit,ADDR tempString2,30
                    mov ebx,offset tempString2
                    call _Atod
                    fst secondnum
                    .if secondnum==0
                         shr eax,16
                        .IF ax==BN_CLICKED
                            invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0
                            mov errflags,1
                            invoke	SetFocus,hWnd                            
                        .ENDIF
                    .else                                
                    fld1
                    fdiv st(0),st(1)
                    mov ebx,offset  tempString2
                    call    _Dtoa
                    mov esi,offset tempString2
                    mov edi,offset display
                    call _Move
                    mov esi,offset display
                    call TO
                    mov emptyflags,3
                    mov dotflags,0
                    mov resultflags,1
                    finit
                    shr eax,16
                    .if ax==BN_CLICKED
                        invoke  SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                            invoke	SetFocus,hWnd                        
                    .endif
                    .endif
                .endif
                .elseif mrflags==1 || stickflags==1
                  .if emptyflags<=1
                    invoke GetWindowText,hwndEdit,ADDR tempString1,30
                    mov ebx,offset tempString1
                    call _Atod
                    fst secondnum
                    .if secondnum==0
                         shr eax,16
                        .IF ax==BN_CLICKED
                            invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0
                            mov errflags,1
                            invoke	SetFocus,hWnd                            
                        .ENDIF
                    .else                          
                    fld1
                    fdiv    st(0),st(1)
                    mov ebx,offset  tempString1
                    call    _Dtoa
                    mov esi,offset tempString1
                    mov edi,offset display
                    call _Move
                    mov esi,offset display
                    call TO
                    mov emptyflags,2
                    mov dotflags,0
                    mov resultflags,1
                    mov mrflags,0
                    finit
                    shr eax,16
                    .if ax==BN_CLICKED
                        invoke  SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                            invoke	SetFocus,hWnd                        
                    .endif
                    .endif
                   .elseif emptyflags<=3
                                            
                    invoke GetWindowText,hwndEdit,ADDR tempString2,30
                    mov ebx,offset tempString2
                    call _Atod
                    fst secondnum
                    .if secondnum==0
                         shr eax,16
                        .IF ax==BN_CLICKED
                            invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0
                            mov errflags,1
                            invoke	SetFocus,hWnd                            
                        .ENDIF
                    .else                          
                    fld1
                    fdiv    st(0),st(1)
                    mov ebx,offset  tempString2
                    call    _Dtoa
                    mov esi,offset tempString2
                    mov edi,offset display
                    call _Move
                    mov esi,offset display
                    call TO
                    mov emptyflags,3
                    mov dotflags,0
                    mov resultflags,1
                    mov mrflags,0
                    finit
                    shr eax,16
                    .if ax==BN_CLICKED
                        invoke  SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                            invoke	SetFocus,hWnd                        
                    .endif
                    .endif
                   .endif
                  .elseif maflags==1 
                    .if emptyflags<=1
                    mov ebx,offset tempString1
                    call _Atod
                     fst secondnum
                    .if secondnum==0
                         shr eax,16
                        .IF ax==BN_CLICKED
                            invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0
                            mov errflags,1
                            invoke	SetFocus,hWnd                            
                        .ENDIF
                    .else                         
                    fld1
                    fdiv st(0),st(1)
                    mov ebx,offset tempString1   
                    call    _Dtoa
                    mov esi,offset tempString1
                    mov edi,offset display
                    call _Move
                    mov esi,offset display
                    call TO
                    mov emptyflags,2
                    mov dotflags,0
                    mov resultflags,1
                    mov maflags,0
 
                    finit
                    shr eax,16
                    .IF ax==BN_CLICKED
                        invoke SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                            invoke	SetFocus,hWnd                        
                    .ENDIF 
                    .endif
                   .elseif emptyflags==2 || emptyflags==3
                    invoke GetWindowText,hwndEdit,ADDR tempString2,30
                    mov ebx,offset tempString2
                    call _Atod
                    fst secondnum
                    .if secondnum==0
                         shr eax,16
                        .IF ax==BN_CLICKED
                            invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0
                            mov errflags,1
                            invoke	SetFocus,hWnd                            
                        .ENDIF
                    .else                          
                    fld1
                    fdiv st(0),st(1)
                    mov ebx,offset  tempString2
                    call    _Dtoa
                    mov esi,offset tempString2
                    mov edi,offset display
                    call _Move
                    mov esi,offset display
                    call TO
                    mov emptyflags,3
                    mov dotflags,0
                    mov resultflags,1
                    mov maflags,0

 
                    finit
                    shr eax,16
                    .if ax==BN_CLICKED
                        invoke  SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                            invoke	SetFocus,hWnd                        
                    .endif
                    .endif 
                   .endif
                  .elseif msdownflags==1
                    invoke GetWindowText,hwndEdit,ADDR tempString1,30
                    mov ebx,offset tempString1
                    call _Atod
                    fst secondnum
                    .if secondnum==0
                         shr eax,16
                        .IF ax==BN_CLICKED
                            invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0
                            mov errflags,1
                            invoke	SetFocus,hWnd                            
                        .ENDIF
                    .else                          
                    fld1
                    fdiv    st(0),st(1)
                    mov ebx,offset  tempString1
                    call    _Dtoa
                    mov esi,offset tempString1
                    mov edi,offset display
                    call _Move
                    mov esi,offset display
                    call TO
                    mov emptyflags,2
                    mov dotflags,0
                    mov resultflags,1
                    mov msdownflags,0
                    finit
                    shr eax,16
                    .if ax==BN_CLICKED
                        invoke  SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                             invoke	SetFocus,hWnd                       
                    .endif
                    .endif
                  .elseif   msdownflags==2
                    invoke GetWindowText,hwndEdit,ADDR tempString2,30
                    mov ebx,offset tempString2
                    call _Atod
                     fst secondnum
                    .if secondnum==0
                         shr eax,16
                        .IF ax==BN_CLICKED
                            invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0
                            mov errflags,1
                            invoke	SetFocus,hWnd                            
                        .ENDIF
                    .else                         
                    fld1
                    fdiv    st(0),st(1)
                    mov ebx,offset  tempString2
                    call    _Dtoa
                    mov esi,offset tempString2
                    mov edi,offset display
                    call _Move
                    mov esi,offset display
                    call TO
                    mov emptyflags,3
                    mov dotflags,0
                    mov resultflags,1
                    mov msdownflags,0
                    finit
                    shr eax,16
                    .if ax==BN_CLICKED
                        invoke  SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                             invoke	SetFocus,hWnd                       
                    .endif 
                    .endif                                    
                .endif
                .endif
                mov changflags,1 

                                   
                .endif  
 endm    
 
 
 EQUEL		macro
                    local   @2201
                              .if errflags==0 
                .if emptyflags<=1
                    mov emptyflags,0
                    mov dotflags,0
                    mov resultflags,1
                .else
                   
                    mov dl,changflags
                    cmp dl,1
                    jne @2201
                    invoke GetWindowText,hwndEdit,ADDR tempbuffer,30
            @2201:        
                    mov ebx,offset tempbuffer
                    call _Atod
                    fstp secondnum
                    mov ebx,offset tempString1
                    call _Atod
                    .if opflags!=4
                        .if opflags==1
                            fadd    secondnum
                        .elseif opflags==2
                            fsub    secondnum
                        .elseif opflags==3
                            fmul    secondnum

                        .endif
                        mov ebx,offset  result
                        call _Dtoa
                        mov esi,offset result
                        mov edi,offset display
                        call _Move
                        mov esi,offset display
                        call TO
                        
                        finit
                        shr eax,16
                        .IF ax==BN_CLICKED
                            invoke SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                            invoke	SetFocus,hWnd                            
                        .ENDIF
                        mov edi,offset tempString1
                        mov esi,offset result
                        call _Move
                        mov emptyflags,2
                        mov dotflags,0
                        mov resultflags,1
                        mov mrflags,0
                        mov msdownflags,0
                        mov changflags,0
                        mov maflags,0
                       .elseif opflags==4
                            .if secondnum==0
                                shr eax,16
                                .if ax==BN_CLICKED
                                    invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0

                                    mov resultflags,1
                                    mov errflags,1
                            invoke	SetFocus,hWnd                                    
                                 .endif
                            .else
                                fdiv    secondnum
                                mov ebx,offset result
                                call _Dtoa
                                mov esi,offset result
                                mov edi,offset display
                                call _Move
                                mov esi,offset display
                                call TO
                                finit
                                shr eax,16
                                .IF ax==BN_CLICKED
                                    invoke SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
                            invoke	SetFocus,hWnd                                    
                                .ENDIF
                                 mov edi,offset tempString1
                                mov esi,offset result
                                call _Move
                                mov emptyflags,2
                                mov dotflags,0
                                mov resultflags,1
                                mov mrflags,0
                                mov maflags,0
                                mov msdownflags,0
                                mov changflags,0 
                              .endif                               
                         .endif 
                         .endif
                         .endif 
 endm                      
 
 
 BSPACE		macro
 				local @123
 				local	@124
                              .if errflags==0 
                .if emptyflags==1 && resultflags==0
                    mov esi,offset tempString1
                    call    _Strlen
                    
                    dec ecx
                    .if cl==0
                        mov emptyflags,0
                        mov dotflags,0
                    .endif
                    add esi,ecx
                    cmp byte ptr [esi],'.'
                    jne @123
                    mov dotflags,0
       @123:             mov byte ptr [esi],0
                .elseif emptyflags==3 && resultflags==0
                    mov esi,offset tempString2
                    call    _Strlen
                    dec ecx
                    .if cl==0
                        mov emptyflags,2
                        mov dotflags,0
                    .endif
                    add esi,ecx
                    cmp byte ptr [esi],'.'
                    jne @124
                    mov dotflags,0
    @124:                mov byte ptr [esi],0
               .endif     
                shr eax,16
                .IF ax==BN_CLICKED
                           .if emptyflags==1
                                invoke SendMessage,hWnd,WM_COMMAND,IDM_INPUT1,0
                            .elseif emptyflags==3
                                invoke SendMessage,hWnd,WM_COMMAND,IDM_INPUT2,0
                            .elseif resultflags==0
                                invoke SetWindowText,hwndEdit,ADDR InitText    
                            .endif
                            invoke	SetFocus,hWnd                                
                .ENDIF
                .endif  
  endm                  
;*************************************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -