Just for fun - project attached. TinyCalcV2.zip is an advanced version with hex and binary display. It will accept most common number formats as input.
GuiParas equ "Tiny calculator", w200, h130, m4, b LiteBlueGreen ; width+height, margins, background colour
include \masm32\MasmBasic\Res\MbGui.asm
GuiControl Calc, "Edit", bcol LiteYellow, w700, fcol Black, font -14, h0+32 ; colours & fonts have no effect with rtf files
GuiControl Go, "button", "-!!> clipboard", x700, w300, h0+32, bcol LiteYellow
GuiControl Status, "statusbar", "Type a formula"
SetGlobals Result:REAL10, res$
Event Command
.if MenuID==Go && nCode==BN_CLICKED
SetClip$=res$
invoke SendMessage, hWnd_, WM_CLOSE, 0, 0
.elseif MenuID==Calc && nCode==EN_CHANGE
xor ecx, ecx
SetWin$ hStatus=0
mov esi, Win$(hCalc)
.if Instr_(esi, "+")
inc ecx
.else
.if Instr_(esi, "-")
inc ecx
inc ecx
.else
.if Instr_(esi, "*")
dec ecx
.else
.if Instr_(esi, "/")
dec ecx
dec ecx
.endif
.endif
.endif
.endif
.if ecx
mov byte ptr [eax], 0 ; separate left and right halves
inc eax
MovVal ST(0), eax ; right half of expression
.if edx && edx<20
MovVal ST(0), esi
Switch_ ecx
Case_ 1: fadd
Case_ 2: fsubr
Case_ -1: fmul
Case_ -2: fdivr
Endsw_
fstp Result
Let res$=Str$(Result)
xchg eax, ecx
push ecx
add ecx, Len(ecx)
.Repeat
dec ecx
.Until byte ptr [ecx]!="0"
mov byte ptr [ecx+2], 0
pop eax
SetWin$ hStatus=Cat$("Result="+res$)
.endif
.endif
.endif
GuiEnd