Subversion Repositories Kolibri OS

Rev

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

Rev 8993 Rev 8996
Line 154... Line 154...
154
	call    create_tone
154
	call    create_tone
155
;---------------------------------------------------------------------
155
;---------------------------------------------------------------------
156
align 4
156
align 4
157
red:
157
red:
158
	call	draw_window
158
	call	draw_window
159
	;mov     ah,0
-
 
160
	;jmp     button.history_click
-
 
161
;---------------------------------------------------------------------
159
;---------------------------------------------------------------------
162
align 4
160
align 4
163
still:
161
still:
164
	mcall	SF_WAIT_EVENT
162
	mcall	SF_WAIT_EVENT
Line 196... Line 194...
196
	cmp	ah, 39
194
	cmp	ah, 39
197
	ja	@f
195
	ja	@f
Line 198... Line 196...
198
 
196
 
Line 199... Line 197...
199
	sub	ah,30
197
	sub	ah,30
200
	
198
	
201
.history_click: 
199
	;click on a colors History 
202
	movzx	eax,ah
200
	movzx	eax,ah
203
	shl	eax,2
201
	shl	eax,2
204
	add	eax,[communication_area]
202
	add	eax,[communication_area]
Line 654... Line 652...
654
popad
652
popad
655
	ret
653
	ret
656
endp
654
endp
657
;---------------------------------------------------------------------
655
;---------------------------------------------------------------------
658
;input:
656
;input:
659
; buf - pointer hexadecimal string
657
; buf - pointer to a hexadecimal string
660
;output:
658
;output:
661
; eax - number
659
; eax - number
662
align 4
660
align 4
663
proc conv_str_to_int uses ebx ecx esi, buf:dword
661
proc conv_str_to_int uses ebx ecx esi, buf:dword
664
	xor eax,eax
662
	xor eax,eax
665
	xor ebx,ebx
663
	xor ebx,ebx
666
	mov esi,[buf]
664
	mov esi,[buf]
Line 667... Line 665...
667
 
665
 
668
	.cycle_16:     ;считывание 16-ричных цифр
666
	.cycle_16:
669
		mov bl,byte[esi]
667
		mov bl,byte[esi]
670
		cmp bl,'0'
668
		cmp bl,'0'
671
		jl @f
669
		jl @f
672
		cmp bl,'f'
670
		cmp bl,'f'
673
		jg @f
671
		jg @f
674
		cmp bl,'9'
672
		cmp bl,'9'
675
		jle .us1
673
		jle .us1
676
			cmp bl,'A'
674
			cmp bl,'A'
677
			jl @f ;отсеиваем символы >'9' и <'A'
675
			jl @f ;skip the chars not in between '9' and 'A'
678
		.us1: ;составное условие
676
		.us1: ;составное условие
679
		cmp bl,'F'
677
		cmp bl,'F'
680
		jle .us2
678
		jle .us2
681
			cmp bl,'a'
679
			cmp bl,'a'
682
			jl @f ;отсеиваем символы >'F' и <'a'
680
			jl @f ;skip the chars not in between 'F' and 'a'
683
			sub bl,32 ;переводим символы в верхний регистр, для упрощения их последущей обработки
681
			sub bl,32 ;convert symbols to uppercase for convenience
684
		.us2: ;составное условие
682
		.us2: ;составное условие
685
			sub bl,'0'
683
			sub bl,'0'
686
			cmp bl,9
684
			cmp bl,9
687
			jle .cor1
685
			jle .cor1
Line 690... Line 688...
690
			shl eax,4
688
			shl eax,4
691
			add eax,ebx
689
			add eax,ebx
692
			inc esi
690
			inc esi
693
			jmp .cycle_16
691
			jmp .cycle_16
694
	@@:
692
	@@:
695
	cmp ecx,0 ;если число отрицательное
693
	cmp ecx,0 ;if the number is negative
696
	jne @f
694
	jne @f
697
		sub ecx,eax
695
		sub ecx,eax
698
		mov eax,ecx
696
		mov eax,ecx
699
	@@:
697
	@@:
700
	ret
698
	ret