Subversion Repositories Kolibri OS

Rev

Rev 4895 | Rev 4901 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4895 Rev 4900
Line 695... Line 695...
695
draw_fpu_register:
695
draw_fpu_register:
696
        push    ebx
696
        push    ebx
697
        push    edx
697
        push    edx
698
        push    ecx
698
        push    ecx
699
        push    esi
699
        push    esi
-
 
700
 
-
 
701
        sub     esp, 8
-
 
702
 
-
 
703
        fld     tword [esi]
-
 
704
        fistp   qword [esp]
-
 
705
 
700
        mov     eax, esi
706
        mov     eax, esi
701
        mov     esi, ecx
707
        mov     esi, ecx
Line 702... Line 708...
702
 
708
 
703
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
709
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
Line 725... Line 731...
725
        ; draw a text string in the window
731
        ; draw a text string in the window
726
        mcall   4
732
        mcall   4
727
        imul    esi, 60000h
733
        imul    esi, 60000h
728
        lea     edx, [ebx+esi]
734
        lea     edx, [ebx+esi]
729
        mov     esi, ecx
735
        mov     esi, ecx
-
 
736
 
730
        pop     ecx
737
        mov     ecx, esp
-
 
738
 
731
        ; draw a number in the window
739
        ; draw a number in the window
732
        ; color is the same as for previous text draw function
740
        ; color is the same as for previous text draw function
733
        ; ebx : [20] show 16 chars set [30] bit - qword
741
        ; ebx : [20] show 16 chars set [30] bit - qword
734
        mcall   47, 40100101h
742
        mcall   47, 40100101h
-
 
743
        add     esp, 8
-
 
744
        pop     ecx
735
        lea     ebx, [edx+60000h*18]
745
        lea     ebx, [edx+60000h*18]
736
        mov     esi, ecx
746
        mov     esi, ecx
737
        pop     ecx
747
        pop     ecx
738
        pop     edx
748
        pop     edx
739
        pop     ebx
749
        pop     ebx
740
        add     edx, ecx
750
        add     edx, ecx
741
        ret
751
        ret
Line 742... Line 752...
742
 
752
 
-
 
753
;-----------------------------------------------------------------------------
-
 
754
;                  Display FPU register (ST0 - ST7) content
-
 
755
;
-
 
756
; in: esi->value, ebx = coord
-
 
757
draw_fpu_register_2:
-
 
758
 
-
 
759
.str_buf  equ esp
-
 
760
.bcd_man  equ esp+32
-
 
761
.bcd_exp  equ esp+32+12
-
 
762
 
-
 
763
        sub     esp, 32+12+12
-
 
764
 
-
 
765
        mov     edx, ebp
-
 
766
        shl     edx, 4
-
 
767
 
-
 
768
        fld     tword [_st0+edx]
-
 
769
        fldlg2
-
 
770
        fld     tword [_st0+edx]
-
 
771
        bt      dword [_st0+edx+8], 15
-
 
772
        jnc @f
-
 
773
        fabs
-
 
774
@@:
-
 
775
        fyl2x
-
 
776
        frndint
-
 
777
        fld     st0
-
 
778
        fbstp   tword [.bcd_exp]
-
 
779
        fldl2t
-
 
780
        fmulp
-
 
781
        fld     st0
-
 
782
        frndint
-
 
783
        fxch
-
 
784
        fsub    st,st1
-
 
785
 
-
 
786
        f2xm1
-
 
787
        fld1
-
 
788
        faddp
-
 
789
        fscale
-
 
790
        fstp    st1
-
 
791
        fdivp
-
 
792
        fimul   dword [_10000000]
-
 
793
        fbstp   tword [.bcd_man]
-
 
794
 
-
 
795
        mov     eax, 0x20202020
-
 
796
        mov     edi, .str_buf
-
 
797
        stosd
-
 
798
        stosd
-
 
799
        stosd
-
 
800
        stosd
-
 
801
 
-
 
802
        lea     esi, [.bcd_man-1]
-
 
803
        mov     edi, .str_buf
-
 
804
 
-
 
805
        mov     ecx, 9
-
 
806
        mov     eax, 0x10000
-
 
807
 
-
 
808
        mov     al, [esi+ecx+1]
-
 
809
        cmp     al, 0x80            ; check for sign
-
 
810
        jne     .mantis_2_str
-
 
811
        mov     al, '-'
-
 
812
        stosb
-
 
813
 
-
 
814
.mantis_2_str:
-
 
815
 
-
 
816
        mov     al, [esi+ecx]
-
 
817
        test    al, al
-
 
818
        jnz     @f
-
 
819
 
-
 
820
        bt      eax, 16
-
 
821
        jc      .skip_lb
-
 
822
@@:
-
 
823
        mov     ah, al
-
 
824
        shr     al, 4
-
 
825
        jnz     .write_h
-
 
826
 
-
 
827
        bt      eax, 16
-
 
828
        jc      .skip_hb
-
 
829
 
-
 
830
.write_h:
-
 
831
        add     al, 0x30
-
 
832
        stosb
-
 
833
        btr     eax, 16
-
 
834
        jnc     .skip_hb
-
 
835
        mov     al, '.'
-
 
836
        stosb
-
 
837
.skip_hb:
-
 
838
        mov     al, ah
-
 
839
        and     al, 0x0F
-
 
840
        jnz     .write_lb
-
 
841
 
-
 
842
        bt      eax, 16
-
 
843
        jc      .skip_lb
-
 
844
.write_lb:
-
 
845
        add     al,0x30
-
 
846
        stosb
-
 
847
        btr     eax, 16
-
 
848
        jnc     .skip_lb
-
 
849
        mov     al, '.'
-
 
850
        stosb
-
 
851
.skip_lb:
-
 
852
        dec     ecx
-
 
853
        jnz     .mantis_2_str
-
 
854
 
-
 
855
        mov     ax, ' e'
-
 
856
        stosw
-
 
857
 
-
 
858
        lea     esi, [.bcd_exp-1]
-
 
859
        mov     ecx, 9
-
 
860
        mov     eax,0x10000
-
 
861
        mov     al, [esi+ecx+1]
-
 
862
        cmp     al, 0x80
-
 
863
        jne     .exp_2_str
-
 
864
        mov     al, '-'
-
 
865
        stosb
-
 
866
.exp_2_str:
-
 
867
        mov     al, [esi+ecx]
-
 
868
        test    al, al
-
 
869
        jnz     @f
-
 
870
 
-
 
871
        bt      eax, 16
-
 
872
        jc      .skip_lb2
-
 
873
@@:
-
 
874
        mov     ah, al
-
 
875
        shr     al, 4
-
 
876
        jnz     .write_h2
-
 
877
 
-
 
878
        bt      eax, 16
-
 
879
        jc      .skip_hb2
-
 
880
.write_h2:
-
 
881
        add     al, 0x30
-
 
882
        stosb
-
 
883
        btr     eax, 16
-
 
884
        stosb
-
 
885
.skip_hb2:
-
 
886
        mov     al, ah
-
 
887
        and     al, 0x0F
-
 
888
        jnz     .write_lb2
-
 
889
 
-
 
890
        bt      eax, 16
-
 
891
        jc      .skip_lb2
-
 
892
.write_lb2:
-
 
893
        add     al, 0x30
-
 
894
        stosb
-
 
895
        btr     eax, 16
-
 
896
.skip_lb2:
-
 
897
        dec ecx
-
 
898
        jnz .exp_2_str
-
 
899
 
-
 
900
        mov     ecx, (COLOR_TXT_INACTIVE or 0x40000000)
-
 
901
        cmp     [debuggee_pid], 0
-
 
902
        jz      .do_label
-
 
903
        cmp     [bSuspended], 0
-
 
904
        jz      .do_label
-
 
905
 
-
 
906
        mov     ecx, (COLOR_TXT_NORMAL or 0x40000000)
-
 
907
 
-
 
908
        mov     eax, dword [_st0+edx]
-
 
909
        cmp     eax, dword [_st0+(oldcontext-context)+edx]
-
 
910
        jne     .scol
-
 
911
 
-
 
912
        mov     eax, dword [_st0+edx+4]
-
 
913
        cmp     eax, dword [_st0+(oldcontext-context)+4]
-
 
914
        jne     .scol
-
 
915
 
-
 
916
        mov     ax, word [_st0+edx+8]
-
 
917
        cmp     ax, word [_st0+(oldcontext-context)+8]
-
 
918
        je      .do_label
-
 
919
 
-
 
920
.scol:
-
 
921
        mov     ecx, (COLOR_TXT_CHANGED or 0x40000000)
-
 
922
 
-
 
923
.do_label:
-
 
924
        ; draw a text string in the window
-
 
925
 
-
 
926
        mov     eax, 4
-
 
927
        mov     esi, eax
-
 
928
        lea     edx, [fpu_strs+ebp*4]
-
 
929
        mov     edi, COLOR_BG_NORMAL
-
 
930
        int     0x40
-
 
931
 
-
 
932
        mov     esi, 16
-
 
933
        mov     edx, .str_buf
-
 
934
        add     ebx, 0x180000
-
 
935
        int     0x40
-
 
936
 
-
 
937
        sub     ebx, 0x180000
-
 
938
        add     esp, 32+12+12
-
 
939
 
-
 
940
        ret
-
 
941
 
-
 
942
 
743
;-----------------------------------------------------------------------------
943
;-----------------------------------------------------------------------------
744
;                      Show FPU MMX register content
944
;                      Show FPU MMX register content
745
;
945
;
746
; in: esi->value, edx->string, ecx = string length, ebx = coord
946
; in: esi->value, edx->string, ecx = string length, ebx = coord
747
draw_mmx_register:
947
draw_mmx_register:
Line 909... Line 1109...
909
        call    draw_register
1109
        call    draw_register
910
        mov     cl, 4
1110
        mov     cl, 4
Line 911... Line 1111...
911
 
1111
 
Line -... Line 1112...
-
 
1112
    ; MMX registers
-
 
1113
 
912
    ; MMX registers
1114
        push    ebp
913
 
1115
 
914
        push    8
1116
        push    8
915
        mov     edx, mmx_strs
1117
        mov     edx, mmx_strs
Line 925... Line 1127...
925
        dec     dword [esp]
1127
        dec     dword [esp]
926
        jnz     .draw_mmx_regs
1128
        jnz     .draw_mmx_regs
Line 927... Line 1129...
927
 
1129
 
Line -... Line 1130...
-
 
1130
;FPU registers
-
 
1131
 
-
 
1132
        ;int3
928
;FPU registers
1133
        nop
929
 
1134
 
930
        mov     [esp], byte 8
1135
        mov     [esp], byte 8
931
        mov     edx, fpu_strs
-
 
Line 932... Line 1136...
932
        mov     ebx, (registers_x_pos+2)*10000h+registers_y_pos+232
1136
        xor     ebp, ebp
933
        mov     esi, _st0
1137
        mov     ebx, (registers_x_pos+2)*10000h+registers_y_pos+232
Line 934... Line 1138...
934
 
1138
 
935
align 4
1139
align 4
936
.draw_fpu_regs:
1140
.draw_fpu_regs:
937
 
1141
 
938
        call    draw_fpu_register
1142
        call    draw_fpu_register_2
939
        add     ebx, 10
1143
        add     ebx, 10
-
 
1144
        inc     ebp
Line 940... Line 1145...
940
        add     esi, 16
1145
        dec     dword [esp]
941
        dec     dword [esp]
1146
        jnz     .draw_fpu_regs
942
        jnz     .draw_fpu_regs
1147
        pop     eax                         ;restore stack
943
        pop     eax                         ;restore stack
1148
        pop     ebp