📄 w.asm
字号:
mov esi,offset copytext
.endif
mov edi,offset tempString1
call _Move
mov emptyflags,2
mov esi,offset tempString1
mov edi,offset tempbuffer
call _Move
mov dotflags,0
mov resultflags,1
mov mrflags,0
mov stickflags,0
.elseif emptyflags==2
.if mrflags==1
mov ebx,offset saveString
.elseif stickflags==1
mov ebx,offset copytext
.endif
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 edi,offset display
mov esi,offset result
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 esi,offset tempString1
mov edi,offset tempbuffer
call _Move
mov dotflags,0
mov resultflags,1
mov stickflags,0
mov mrflags,0
.elseif opflags==4
.if secondnum==0
shr eax,16
.if ax==BN_CLICKED
invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE,0
mov emptyflags,0
mov dotflags,0
mov resultflags,1
mov errflags,1
invoke SetFocus,hWnd
.endif
.else
fdiv secondnum
mov ebx,offset result
call _Dtoa
mov edi,offset display
mov esi,offset result
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 esi,offset tempString1
mov edi,offset tempbuffer
call _Move
mov dotflags,0
mov resultflags,1
mov mrflags,0
mov stickflags,0
.endif
.endif
.endif
.endif
mov changflags,1
mov opflags,b
.endif
endm
SIG macro
.if errflags==0
.if emptyflags==1
mov esi,offset tempString1
.if miniusflags==0
mov miniusflags,1
call _Addminius
.else
mov miniusflags,0
call _Deleteminius
.endif
.elseif emptyflags==3
mov esi,offset tempString2
.if miniusflags==0
mov miniusflags,1
call _Addminius
.else
mov miniusflags,0
call _Deleteminius
.endif
.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
.endif
invoke SetFocus,hWnd
.ENDIF
.endif
endm
SQRT macro
.if errflags==0
invoke GetWindowText,hwndEdit,ADDR buffer,30
mov al,buffer+0
.if al=='-'
invoke SendMessage,hWnd,WM_COMMAND,IDM_MESSAGE1,0
mov errflags,1
.elseif al!='-'
.if mrflags==0 && msdownflags==0 && maflags==0 && stickflags==0
.if emptyflags==1
mov ebx,offset tempString1
call _Atod
fsqrt
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
finit
shr eax,16
.IF ax==BN_CLICKED
invoke SendMessage,hWnd,WM_COMMAND,IDM_RESULT,0
invoke SetFocus,hWnd
.ENDIF
.elseif emptyflags==2 || emptyflags==3
invoke GetWindowText,hwndEdit,ADDR tempString2,30
mov ebx,offset tempString2
call _Atod
fsqrt
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
.elseif mrflags==1 || stickflags==1
.if emptyflags<=1
invoke GetWindowText,hwndEdit,ADDR tempString1,30
mov ebx,offset tempString1
call _Atod
fsqrt
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
.elseif emptyflags<=3
invoke GetWindowText,hwndEdit,ADDR tempString2,30
mov ebx,offset tempString2
call _Atod
fsqrt
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
.elseif maflags==1
.if emptyflags<=1
mov ebx,offset tempString1
call _Atod
fsqrt
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
.elseif emptyflags==2 || emptyflags==3
invoke GetWindowText,hwndEdit,ADDR tempString2,30
mov ebx,offset tempString2
call _Atod
fsqrt
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
.elseif msdownflags==1
invoke GetWindowText,hwndEdit,ADDR tempString1,30
mov ebx,offset tempString1
call _Atod
fsqrt
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
.elseif msdownflags==2
invoke GetWindowText,hwndEdit,ADDR tempString2,30
mov ebx,offset tempString2
call _Atod
fsqrt
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
mov changflags,1
.endif
.endif
endm
INVERT macro
.if errflags==0
invoke GetWindowText,hwndEdit,ADDR buffer,30
mov ebx,offset buffer
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
.if mrflags==0 && msdownflags==0 && maflags==0 && stickflags==0
.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
finit
shr eax,16
.IF ax==BN_CLICKED
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -