1,14 → 1,14 |
;; Calculator for MenuetOS (c) Ville Turjanmaa |
;; |
;; Compile with FASM |
;; Compile with FASM for Menuet |
;; |
;; Pavel Rymovski (Heavyiron) - version for KolibriOS |
;; |
;; Pavel Rymovski (Heavyiron) - kolibri version |
;; What's new: |
;; Calc 1.1 |
;; 1) changed design |
;; 2) new procedure of draw window (10 decimal digits, 23 binary, "+" not displayed now) |
;; 3) window with skin |
;; 4) used macroses |
;; Calc 1.2 |
;; 1)added some useful functions, such as arcsin, arccos, arctg, 1/x, x^2 |
;; Calc 1.31 |
31,7 → 31,7 |
dd 0x1000 ; esp |
dd 0x0,0x0 ; I_Param , I_Icon |
|
include '..\..\..\macros.inc' |
include 'macros.inc' |
|
START: |
|
39,7 → 39,7 |
mov ebx,3 |
mov ecx,sc |
mov edx,sizeof.system_colors |
mcall |
int 0x40 |
|
red: |
call draw_window |
47,8 → 47,7 |
still: |
push 10 |
pop eax |
mcall |
|
int 40h |
dec eax |
jz red |
dec eax |
56,13 → 55,13 |
|
button: |
mov al,17 ; ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨ |
mcall |
int 0x40 |
shr eax,8 |
jmp testbut |
|
key: |
mov al,2 ; ¯®«ãç¨âì ASCII-ª®¤ ¦ ⮩ ª« ¢¨è¨ |
mcall |
int 0x40 |
shr eax,8 |
mov edi,asci ; ¯¥à¥¢®¤ ASCII ¢ ¨¤¥â¨ä¨ª â®à ª®¯ª¨ |
mov ecx,18 |
79,7 → 78,7 |
cmp eax,1 ; ª®¯ª 1 - § ªàë⨥ ¯à®£à ¬¬ë |
jne noclose |
or eax,-1 |
mcall |
int 0x40 |
|
noclose: |
cmp eax,2 |
650,7 → 649,7 |
|
mov eax,12 |
mov ebx,1 |
mcall |
int 0x40 |
|
xor eax,eax |
mov ebx,200 shl 16+255 |
657,8 → 656,8 |
mov ecx,200 shl 16+180 |
mov edx,[sc.work] |
or edx,0x33000000 |
mov edi,title |
mcall |
mov edi,header |
int 0x40 |
|
mov eax,8 |
mov ebx,19 shl 16+28 |
673,7 → 672,7 |
mov ebx,19 shl 16+28 |
add ecx,20 shl 16 |
no_new_row: |
mcall |
int 0x40 |
add ebx,30 shl 16 |
inc edx |
cmp edx,39 |
688,7 → 687,7 |
mov edx,text |
mov esi,33 |
newline: |
mcall |
int 0x40 |
add ebx,20 |
add edx,33 |
cmp [edx],byte 'x' |
698,7 → 697,7 |
|
mov eax,12 |
mov ebx,2 |
mcall |
int 0x40 |
|
ret |
|
713,7 → 712,7 |
mov edx,calc |
mov esi,1 |
mov edi,[sc.work] |
mcall |
int 0x40 |
|
mov ebx,198 shl 16+8 |
mov edx,[display_type] |
721,7 → 720,7 |
add edx,display_type_text |
mov esi,3 |
mov edi,[sc.work] |
mcall |
int 0x40 |
|
cmp [dsign],byte '+' |
je positive |
729,7 → 728,7 |
mov ecx,0x0 |
mov edx,dsign |
mov esi,1 |
mcall |
int 0x40 |
|
positive: |
cmp [display_type],0 |
741,7 → 740,7 |
mov ecx,0x0 |
mov edx,dot |
mov esi,1 |
mcall |
int 0x40 |
|
mov eax,47 |
mov ebx,10 shl 16 |
748,13 → 747,13 |
mov ecx,[integer] |
mov edx,120 shl 16+22 |
mov esi,0x0 |
mcall |
int 0x40 |
|
mov ebx,6 shl 16 |
mov ecx,[decimal] |
mov edx,187 shl 16+22 |
mov esi,0x0 |
mcall |
int 0x40 |
|
popa |
ret |
764,7 → 763,7 |
mov ecx,0x0 |
mov edx,dot |
mov esi,1 |
mcall |
int 0x40 |
|
cmp [integer],0 |
je null |
774,7 → 773,7 |
mov ecx,[integer] |
mov edx,160 shl 16+22 |
mov esi,0x0 |
mcall |
int 0x40 |
|
popa |
ret |
790,7 → 789,7 |
mov ecx,[integer] |
mov edx,173 shl 16+22 |
mov esi,0x0 |
mcall |
int 0x40 |
|
popa |
ret |
804,7 → 803,7 |
mov ecx,[integer] |
mov edx,32 shl 16+22 |
mov esi,0x0 |
mcall |
int 0x40 |
|
popa |
ret |
815,7 → 814,7 |
mov ecx,0 |
mov edx,214 shl 16+22 |
mov esi,0x0 |
mcall |
int 0x40 |
|
popa |
ret |
844,7 → 843,7 |
|
;data |
|
title db appname,version,0 |
header db appname,version,0 |
|
display_type dd 0 ; 0 = decimal, 1 = hexadecimal, 2= binary |
entry_multiplier dd 10 |