Subversion Repositories Kolibri OS

Rev

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

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