Subversion Repositories Kolibri OS

Rev

Rev 107 | Rev 153 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;   Calculator for MenuetOS
  2. ;;  (c)Ville Turjanmaa
  3. ;;   Compile with FASM for Menuet
  4. ;;  
  5. ;;   Š «ìªã«ïâ®à 1.1 alpha
  6. ;;  (c)Pavel Rymovski aka Heavyiron
  7. ;;What's new:1)changed design
  8. ;;           2)new procedure of draw window (10 decimal digits, 23 binary, "+" not displayed now)
  9. ;;           3)window with skin
  10. ;;           4)I had used macroses
  11. ;;   Calc 1.2 alpha
  12. ;;           1)added some useful functions, such as arcsin, arccos, arctg, 1/x, x^2
  13. ;;   Calc 1.3
  14. ;;           1)optimised program
  15.  
  16. use32
  17.                                                          org    0x0
  18.  
  19.                db    'MENUET01'               ; 8 byte id
  20.                dd     0x01                    ; header version
  21.                dd     START                   ; start of code
  22.                dd     I_END                   ; size of image
  23.                dd     0x1000                  ; memory for app
  24.                dd     0x1000                  ; esp
  25.                dd     0x0 , 0x0               ; I_Param , I_Icon
  26.  
  27. include 'macros.inc'
  28.  
  29. START:
  30.  
  31. red:
  32.     call draw_window
  33.  
  34. still:         
  35.     push 10
  36.     pop eax
  37.     int 40h
  38.     dec eax
  39.     jz red
  40.     dec eax
  41.     jz key
  42.  
  43. button:
  44.     mcall 17      ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
  45.     shr  eax,8
  46.     jmp  testbut
  47.  
  48.  key:                                                                  
  49.     mcall 2         ; ¯®«ãç¨âì ASCII-ª®¤ ­ ¦ â®© ª« ¢¨è¨
  50.     shr  eax,8
  51.     mov  edi,asci         ; ¯¥à¥¢®¤ ASCII ¢ ¨¤¥­â¨ä¨ª â®à ª­®¯ª¨
  52.     mov  ecx,18
  53.     cld
  54.     repne scasb
  55.     jne  still
  56.     sub  edi,asci
  57.     dec  edi
  58.     mov  esi,butid
  59.     add  esi,edi
  60.     lodsb
  61.      
  62.   testbut:
  63.         cmp  eax,1        ; ª­®¯ª  1 - § ªàë⨥ ¯à®£à ¬¬ë
  64.     jne  noclose
  65.     mcall -1           
  66.  
  67.   noclose:
  68.     cmp  eax,2
  69.     jne  no_reset
  70.     call clear_all
  71.     jmp  still
  72.  
  73.   no_reset:
  74.     finit
  75.     mov    ebx,muuta1    ; ¥à¥¢®¤ ¢ ä®à¬ â FPU
  76.     mov    esi,18
  77.     call   atof
  78.     fstp   [trans1]
  79.     mov    ebx,muuta2
  80.     mov    esi,18
  81.     call   atof
  82.     fst    [trans2]
  83.     cmp  eax,33
  84.     jne  no_sign
  85.     cmp  [dsign],byte '-'
  86.     jne  no_m
  87.     mov  [dsign],byte '+'
  88.     call print_display
  89.     jmp  still
  90.  
  91.   no_m:
  92.     mov  [dsign],byte '-'
  93.     call print_display
  94.     jmp  still
  95.  
  96.   no_sign:
  97.     cmp  eax,3
  98.     jne  no_display_change
  99.     inc  [display_type]
  100.     cmp  [display_type],2
  101.     jbe  display_continue
  102.     mov  [display_type],0
  103.  
  104.   display_continue:
  105.     mov  eax,[display_type]
  106.     mov  eax,[multipl+eax*4]
  107.     mov  [entry_multiplier],eax
  108.     call print_display
  109.     jmp  still
  110.   multipl:  dd  10,16,2
  111.  
  112.   no_display_change:
  113.     cmp  eax,6
  114.     jb   no_a_f
  115.     cmp  eax,11
  116.     jg   no_a_f
  117.     add  eax,4
  118.     call number_entry
  119.     jmp  still
  120.    
  121.    no_a_f:
  122.     cmp  eax,12
  123.     jb   no_13
  124.     cmp  eax,14
  125.     jg   no_13
  126.     sub  eax,11
  127.     call number_entry
  128.     jmp  still
  129.    
  130.    no_13:
  131.     cmp  eax,19
  132.     jb   no_46
  133.     cmp  eax,21
  134.     jg   no_46
  135.     sub  eax,15
  136.     call number_entry
  137.     jmp  still
  138.    
  139.    no_46:
  140.     cmp  eax,26
  141.     jb   no_79
  142.     cmp  eax,28
  143.     jg   no_79
  144.     sub  eax,19
  145.     call number_entry
  146.     jmp  still
  147.    
  148.    no_79:
  149.     cmp  eax,34
  150.     jne  no_0
  151.     mov  eax,0
  152.     call number_entry
  153.     jmp  still
  154.    
  155.    no_0:
  156.     cmp  eax,35
  157.     jne  no_id
  158.     inc  [id]
  159.     and  [id],1
  160.     mov  [new_dec],100000
  161.     jmp  still
  162.  
  163.   no_id:
  164.     cmp  eax,17
  165.     jne  no_sin
  166.     fld  [trans1]
  167.     fsin
  168.     jmp  show_result
  169.  
  170.   no_sin:
  171.     cmp  eax,18
  172.     jne  no_asin
  173.     fld  [trans1]
  174.     fld  st0
  175.     fmul st,st1
  176.     fld1
  177.     fsubrp  st1,st0
  178.     fsqrt
  179.     fpatan
  180.     jmp  show_result
  181.  
  182.   no_asin:
  183.     cmp  eax,16
  184.     jne  no_int
  185.     fld  [trans1]
  186.     frndint
  187.     jmp  show_result
  188.  
  189.   no_int:
  190.     cmp  eax,23
  191.     jne  no_1x
  192.     fld  [trans1]
  193.     fld1
  194.     fdiv st,st1
  195.     jmp  show_result
  196.    
  197.   no_1x:  
  198.     cmp  eax,24
  199.     jne  no_cos
  200.     fld  [trans1]
  201.     fcos
  202.     jmp  show_result
  203.  
  204.   no_cos:
  205.     cmp  eax,25
  206.     jne  no_acos
  207.     fld  [trans1]
  208.     fld1
  209.     fsub st,st1
  210.     fsqrt
  211.     fld1
  212.     fadd st,st2
  213.     fsqrt
  214.     fpatan
  215.     fadd st,st0
  216.     jmp  show_result
  217.  
  218.   no_acos:  
  219.     cmp  eax,30
  220.     jne  no_x2
  221.     fld  [trans1]
  222.     fmul st,st0
  223.     jmp  show_result
  224.    
  225.   no_x2:  
  226.     cmp  eax,31
  227.     jne  no_tan
  228.     fld  [trans1]
  229.     fptan
  230.     fstp st2
  231.     jmp  show_result
  232.  
  233.   no_tan:
  234.     cmp  eax,32
  235.     jne  no_atan
  236.     fld  [trans1]
  237.     fld1
  238.     fpatan
  239.     jmp  show_result
  240.    
  241.    no_atan:
  242.     cmp  eax,38
  243.     jne  no_pi
  244.     fldpi
  245.     jmp  show_result
  246.    
  247.    no_pi:
  248.     cmp  eax,37
  249.     jne  no_sqrt
  250.     fld  [trans1]
  251.     fsqrt
  252.     jmp  show_result
  253.  
  254.   no_sqrt:
  255.     cmp  eax,15
  256.     jne  no_add
  257.     call calculate
  258.     call new_entry
  259.     mov  [calc],'+'
  260.     jmp  still
  261.  
  262.   no_add:
  263.     cmp  eax,22
  264.     jne  no_sub
  265.     call calculate
  266.     call new_entry
  267.     mov  [calc],'-'
  268.     jmp  still
  269.  
  270.   no_sub:
  271.     cmp  eax,29
  272.     jne  no_div
  273.     call calculate
  274.     call new_entry
  275.     mov  [calc],'/'
  276.     jmp  still
  277.  
  278.   no_div:
  279.     cmp  eax,36
  280.     jne  no_mul
  281.     call calculate
  282.     mov  [calc],'*'
  283.     call new_entry
  284.     jmp  still
  285.  
  286.   no_mul:
  287.     cmp    eax,39
  288.     jne    no_calc
  289.     call   calculate
  290.     jmp    still
  291.  
  292.   no_calc:
  293.     jmp  still
  294.  
  295.   show_result:
  296.     call   ftoa
  297.     call   print_display
  298.     jmp    still
  299.  
  300. error:
  301.     jmp  still
  302.  
  303. calculate:
  304.     pusha
  305.     cmp  [calc],' '
  306.     je   no_calculation
  307.     cmp  [calc],'/'
  308.     jne  no_cdiv
  309.     fdiv [trans1]
  310.  
  311.   no_cdiv:
  312.     cmp  [calc],'*'
  313.     jne  no_cmul
  314.     fmul [trans1]
  315.  
  316.   no_cmul:
  317.     cmp  [calc],'+'
  318.     jne  no_cadd
  319.     fadd [trans1]
  320.  
  321.   no_cadd:
  322.     cmp  [calc],'-'
  323.     jne  no_cdec
  324.     fsub [trans1]
  325.  
  326.   no_cdec:
  327.     call   ftoa
  328.    
  329.   no_calculation:
  330.     call   print_display
  331.     popa
  332.     ret
  333.  
  334. number_entry:
  335.  
  336.     pusha
  337.  
  338.     cmp  eax,[entry_multiplier]
  339.     jge  no_entry
  340.     cmp  [id],1
  341.     je   decimal_entry
  342.     mov  ebx,[integer]
  343.     test ebx,0xc0000000
  344.     jnz  no_entry
  345.     mov  ebx,eax
  346.     mov  eax,[integer]
  347.     mov  ecx,[entry_multiplier]
  348.     mul  ecx
  349.     add  eax,ebx
  350.     mov  [integer],eax
  351.     call print_display
  352.     call to_muuta
  353.     popa
  354.     ret
  355.  
  356.   decimal_entry:
  357.  
  358.     imul eax,[new_dec]
  359.     add  [decimal],eax
  360.     mov  eax,[new_dec]
  361.     xor  edx,edx
  362.     mov  ebx,[entry_multiplier]
  363.     div  ebx
  364.     mov  [new_dec],eax
  365.     call print_display
  366.     call to_muuta
  367.     popa
  368.     ret
  369.  
  370.   no_entry:
  371.  
  372.     call print_display
  373.     call to_muuta
  374.     popa
  375.     ret
  376.  
  377.  to_muuta:
  378.  
  379.     pusha
  380.     mov  al,[dsign]
  381.     mov  esi,muuta0
  382.     mov  edi,muuta1
  383.     mov  ecx,18
  384.     cld
  385.     rep  movsb
  386.     mov  [muuta1],al
  387.     mov  edi,muuta1+10      ; 楫®¥
  388.     mov  eax,[integer]
  389.  
  390.   new_to_muuta1:
  391.  
  392.     mov  ebx,10
  393.     xor  edx,edx
  394.     div  ebx
  395.     mov  [edi],dl
  396.     add  [edi],byte 48
  397.     dec  edi
  398.     cmp  edi,muuta1+1
  399.     jge  new_to_muuta1
  400.     mov  edi,muuta1+17      ; ¤à®¡­®¥
  401.     mov  eax,[decimal]
  402.  
  403.   new_to_muuta2:
  404.    
  405.     mov  ebx,10
  406.     xor  edx,edx
  407.     div  ebx
  408.     mov  [edi],dl
  409.     add  [edi],byte 48
  410.     dec  edi
  411.     cmp  edi,muuta1+12
  412.     jge  new_to_muuta2
  413.     popa
  414.     ret
  415.  
  416. new_entry:
  417.  
  418.     pusha
  419.     mov  esi,muuta1
  420.     mov  edi,muuta2
  421.     mov  ecx,18
  422.     cld
  423.     rep  movsb
  424.     mov  esi,muuta0
  425.     mov  edi,muuta1
  426.     mov  ecx,18
  427.     cld
  428.     rep  movsb
  429.     mov  [integer],0
  430.     mov  [decimal],0
  431.     mov  [id],0
  432.     mov  [new_dec],100000
  433.     mov  [sign],byte '+'
  434.     popa
  435.     ret
  436.  
  437. ten        dd    10.0,0
  438. tmp        dw       1,0
  439. sign       db       1,0
  440. tmp2       dq     0x0,0
  441. exp        dd     0x0,0
  442. new_dec    dd  100000,0
  443. id         db     0x0,0
  444. res     dd   0
  445. trans1  dq   0
  446. trans2  dq   0
  447. controlWord dw 1
  448.  
  449. ftoa:                         ; fpu st0 -> [integer],[decimal]
  450.     pusha
  451.     fst    [tmp2]
  452.     fstcw  [controlWord]      ; set truncate integer mode
  453.     mov    ax,[controlWord]
  454.     mov    [tmp], ax
  455.     or     [tmp], word 0x0c00
  456.     fldcw  [tmp]
  457.     ftst                      ; test if st0 is negative
  458.     fstsw  ax
  459.     and    ax, 0x4500
  460.     mov    [sign], 0
  461.     cmp    ax, 0x0100
  462.     jne    no_neg
  463.     mov    [sign],1
  464.  
  465.   no_neg:
  466.     fistp  [integer]
  467.     fld    [tmp2]
  468.     fisub  [integer]
  469.     fldcw  [controlWord]
  470.     cmp  byte [sign], 0     ; change fraction to positive
  471.     je   no_neg2
  472.     fchs
  473.  
  474.   no_neg2:
  475.     mov    [res],0          ; convert 6 decimal numbers
  476.     mov    edi,6
  477.  
  478.    newd:
  479.     fimul  [kymppi]
  480.     fist   [decimal]
  481.     mov    ebx,[res]
  482.     imul   ebx,10
  483.     mov    [res],ebx
  484.     mov    eax,[decimal]
  485.     add    [res],eax
  486.     fisub  [decimal]
  487.     ftst
  488.     fstsw  ax
  489.    
  490.     dec    edi
  491.     jz     real_done
  492.     jmp    newd
  493.  
  494.   real_done:
  495.     mov    eax,[res]
  496.     mov    [decimal],eax
  497.     cmp    [integer],0x80000000
  498.     jne    no_error
  499.     call   clear_all
  500.     mov    [calc],'E'
  501.  
  502.   no_error:
  503.     mov    [dsign],byte '+'
  504.     cmp    [sign],byte 0             ; convert negative result
  505.     je     no_negative
  506.     mov    eax,[integer]
  507.     not    eax
  508.     inc    eax
  509.     mov    [integer],eax
  510.     mov    [dsign],byte '-'
  511.  
  512.   no_negative:
  513.     call   to_muuta
  514.     popa
  515.     ret
  516.  
  517.  
  518. atof:
  519.     push ax
  520.     push di
  521.     fldz
  522.     mov di, 0
  523.     cmp si, 0
  524.     je .error                           ; Jump if string has 0 length.
  525.     mov byte [sign], 0
  526.     cmp byte [bx], '+'                  ; Take care of leading '+' or '-'.
  527.     jne .noPlus
  528.     inc di
  529.     jmp .noMinus
  530.  
  531.   .noPlus:
  532.     cmp byte [bx], '-'
  533.     jne .noMinus
  534.     mov byte [sign], 1              ; Number is negative.
  535.     inc di
  536.  
  537.   .noMinus:
  538.     cmp si, di
  539.     je .error
  540.     call atof_convertWholePart
  541.     jc .error
  542.     call atof_convertFractionalPart
  543.     jc .error
  544.     cmp byte [sign], 0
  545.     je  .dontNegate
  546.     fchs           ; Negate value
  547.  
  548.   .dontNegate:
  549.     mov bh, 0      ; Set bh to indicate the string is a valid number.
  550.     jmp .exit
  551.  
  552.   .error:
  553.     mov bh, 1      ; Set error code.
  554.     fstp st0       ; Pop top of fpu stack.
  555.  
  556.   .exit:
  557.     pop di
  558.     pop ax
  559.     ret
  560.  
  561. atof_convertWholePart:
  562.  
  563.     ; Convert the whole number part (the part preceding the decimal
  564.     ; point) by reading a digit at a time, multiplying the current
  565.     ; value by 10, and adding the digit.
  566.  
  567. .mainLoop:
  568.     mov al, [bx + di]
  569.     cmp al, '.'
  570.     je .exit
  571.     cmp al, '0'    ; Make sure character is a digit.
  572.     jb .error
  573.     cmp al, '9'
  574.     ja .error
  575.  
  576.     ; Convert single character to digit and save to memory for
  577.     ; transfer to the FPU.
  578.  
  579.     sub al, '0'
  580.     mov ah, 0
  581.     mov [tmp], ax
  582.  
  583.     ; Multiply current value by 10 and add in digit.
  584.  
  585.     fmul dword [ten]
  586.     fiadd word [tmp]
  587.     inc di
  588.     cmp si, di     ; Jump if end of string has been reached.
  589.     je .exit
  590.     jmp .mainLoop
  591.  
  592.   .error:
  593.     stc            ; Set error (carry) flag.
  594.     ret
  595.  
  596.   .exit:
  597.     clc            ; Clear error (carry) flag.
  598.     ret
  599.  
  600.  
  601. atof_convertFractionalPart:
  602.     fld1           ; Load 1 to TOS.  This will be the value of the decimal place.
  603.  
  604.   .mainLoop:
  605.     cmp si, di     ; Jump if end of string has been reached.
  606.     je .exit
  607.     inc di             ; Move past the decimal point.
  608.     cmp si, di     ; Jump if end of string has been reached.
  609.     je .exit
  610.     mov al, [bx + di]
  611.     cmp al, '0'    ; Make sure character is a digit.
  612.     jb .error
  613.     cmp al, '9'
  614.     ja .error
  615.     fdiv dword [ten]     ; Next decimal place
  616.     sub al, '0'
  617.     mov ah, 0
  618.     mov [tmp], ax
  619.  
  620.     ; Load digit, multiply by value for appropriate decimal place,
  621.     ; and add to current total.
  622.  
  623.     fild  word [tmp]
  624.     fmul  st0, st1
  625.     faddp st2, st0
  626.     jmp .mainLoop
  627.  
  628.   .error:
  629.     stc                ; Set error (carry) flag.
  630.     fstp st0       ; Pop top of fpu stack.
  631.     ret
  632.  
  633.   .exit:
  634.     clc                          ; Clear error (carry) flag.
  635.     fstp st0       ; Pop top of fpu stack.
  636.     ret
  637.  
  638. ;   *********************************************
  639. ;   ******* Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€ ********
  640. ;   *********************************************
  641.  
  642. draw_window:
  643.  
  644.     mcall 12,1
  645.     mcall 0,200*65536+255,200*65536+180,0x03ddeeff   ; äã­ªæ¨ï 0: ®¯à¥¤¥«¨âì ¨ ®âà¨á®¢ âì ®ª­®
  646.     mcall 4,8*65536+8,0x10000000,labelt,label_len    ; ‡€ƒŽ‹Ž‚ŽŠ ŽŠ€
  647.  
  648.     mov  ebx,24*65536+28
  649.     mov  ecx,70*65536+18
  650.     mov  edx,6
  651.     mov  esi,0x0066ee
  652.     mov  edi,7
  653.   newbutton:
  654.     dec  edi
  655.     jnz  no_new_row
  656.     mov  edi,7
  657.     mov  ebx,24*65536+25+3
  658.     add  ecx,20*65536
  659.   no_new_row:
  660.     mcall 8
  661.     add  ebx,30*65536
  662.     inc  edx
  663.     cmp  edx,39
  664.     jbe  newbutton
  665.                
  666.     mcall 8,225*65536+8,28*65536+8,3                    ; 'dec-bin-hex'
  667.     mcall 8,204*65536+28,70*65536+18,2,0xcc0000         ; 'C'
  668.        
  669.     mov  ebx,25*65536+75                                ; à®à¨á®¢ª  ¯®¤¯¨á¥© ª­®¯®ª
  670.     mov  ecx,0xffffff
  671.     mov  edx,text
  672.     mov  esi,34
  673.  
  674.   newline:
  675.     mcall 4
  676.     add  ebx,20
  677.     add  edx,34
  678.     cmp  [edx],byte 'x'
  679.     jne  newline
  680.     call print_display
  681.     mcall 12,2
  682.     ret
  683.  
  684. print_display:
  685.     pusha
  686.     mcall 13,100*65536+120,25*65536+13,0x00ddeeff
  687.     mcall 13,23*65536+210,40*65536+13,0xffffff
  688.     mcall 4,140*65536+28,0,calc,1
  689.     mov  eax,4
  690.     mov  ebx,203*65536+29
  691.     mov  ecx,0
  692.     mov  edx,[display_type]
  693.     shl  edx,2
  694.     add  edx,display_type_text
  695.     mov  esi,3
  696.     int  0x40
  697.                
  698.     cmp  [dsign],byte '+'
  699.     je  positive
  700.     mcall 4,28*65536+43,0x0,dsign,1            
  701.        
  702. positive:              
  703.     cmp  [display_type],0                            ; ¤¥áïâ¨ç­ ï á¨á⥬  áç¨á«¥­¨ï
  704.     jne  no_display_decimal
  705.     cmp  [decimal],0
  706.     je   whole
  707.     mcall 47,10*65536,[integer],125*65536+43,0x0     ; ®â®¡à ¦ âì 10 æ¨äà
  708.     mcall 4,185*65536+43,0x0,dot,1
  709.     mcall 47,6*65536,[decimal],192*65536+43,0x0      ; ®â®¡à ¦ âì 6 æ¨äà ¯®á«¥ § ¯ï⮩
  710.     popa
  711.     ret
  712.    
  713. whole:
  714.     cmp  [integer],0
  715.     je  null
  716.     mcall 47,10*65536,[integer],165*65536+43,0x0
  717.     mcall 4,225*65536+43,0x0,dot,1
  718.     popa
  719.     ret
  720.                      
  721.   no_display_decimal:
  722.     cmp  [integer],0
  723.     je  null
  724.     cmp  [display_type],1
  725.     jne  no_display_hexadecimal
  726.     mcall 47,1*256+8*65536,[integer],178*65536+43,0x0    ; ®â®¡à ¦ âì 8 è¥áâ­ ¤æ â¨à¨ç­ëå æ¨äà
  727.     popa
  728.     ret
  729.  
  730.   no_display_hexadecimal:
  731.     cmp  [integer],0
  732.     je  null
  733.     cmp  [display_type],2
  734.     jne  null
  735.     mcall 47,2*256+32*65536,[integer],37*65536+43,0x0    ; ®â®¡à ¦ âì 32 ¤¢®¨ç­ë¥ æ¨äàë
  736.     popa
  737.     ret
  738.  
  739.   null:
  740.     mcall 47,1*65536,0,219*65536+43,0x0
  741.     cmp  [display_type],0
  742.     jne  end_pr
  743.     mcall 4,225*65536+43,0x0,dot,1
  744.                
  745. end_pr:
  746.     popa
  747.     ret
  748.  
  749. clear_all:
  750.     pusha
  751.     mov  [calc],' '
  752.     mov  [integer],0
  753.     mov  [decimal],0
  754.     mov  [id],0
  755.     mov  [dsign],byte '+'
  756.     mov  esi,muuta0
  757.     mov  edi,muuta1
  758.     mov  ecx,18
  759.     cld
  760.     rep  movsb
  761.     mov  esi,muuta0
  762.     mov  edi,muuta2
  763.     mov  ecx,18
  764.     cld
  765.     rep  movsb
  766.     call print_display
  767.     popa
  768.     ret
  769.  
  770.  
  771. ;Ž¡« áâì ¤ ­­ëå
  772.  
  773. display_type       dd  0    ; 0 = decimal, 1 = hexadecimal, 2= binary
  774. entry_multiplier   dd  10
  775.  
  776. display_start_y    dd  0x0
  777. display_type_text  db  'dec hex bin'
  778.  
  779. dot     db  '.'
  780. calc    db  ' '
  781. integer dd    0
  782. decimal dd    0
  783. kymppi  dd   10
  784.  
  785. dsign:
  786. muuta1  db   '+0000000000.000000'
  787. muuta2  db   '+0000000000.000000'
  788. muuta0  db   '+0000000000.000000'
  789.  
  790. text:
  791.     db '  A    B    C    D    E    F    C '
  792.     db '  1    2    3    +   Int  Sin Asin'
  793.     db '  4    5    6    -   1/x  Cos Acos'
  794.     db '  7    8    9    /   x^2  Tan Atan'
  795.     db ' +/-   0    .    *   Sqr  Pi    = '
  796.     db 'x'
  797.  
  798. asci:  db 49,50,51,52,53,54,55,56,57,48,43,61,45,42,47,44,46,27
  799. butid: db 12,13,14,19,20,21,26,27,28,34,15,39,22,36,29,35,35,1
  800. labelt:
  801.       db   'Calc 1.3'
  802. label_len = $ - labelt
  803. I_END: