Навигация
Главная
Поиск
Форум
FAQ's
Ссылки
Карта сайта
Чат программистов

Статьи
-Delphi
-C/C++
-Turbo Pascal
-Assembler
-Java/JS
-PHP
-Perl
-DHTML
-Prolog
-GPSS
-Сайтостроительство
-CMS: PHP Fusion
-Инвестирование

Файлы
-Для программистов
-Компонеты для Delphi
-Исходники на Delphi
-Исходники на C/C++
-Книги по Delphi
-Книги по С/С++
-Книги по JAVA/JS
-Книги по Basic/VB/.NET
-Книги по PHP/MySQL
-Книги по Assembler
-PHP Fusion MOD'ы
-by Kest
Professional Download System
Реклама
Услуги

Автоматическое добавление статей на сайты на Wordpress, Joomla, DLE
Заказать продвижение сайта
Программа для рисования блок-схем
Инженерный калькулятор онлайн
Таблица сложения онлайн
Популярные статьи
OpenGL и Delphi... 65535
Форум на вашем ... 65535
HACK F.A.Q 65535
Гостевая книга ... 65535
Содержание сайт... 65535
Вызов хранимых ... 65535
Эмулятор микроп... 65535
Бип из системно... 63986
Организация зап... 60443
Invision Power ... 60023
Приложение «Про... 59924
Оператор выбора... 58847
Модуль Forms 58166
Подключение Mic... 57870
Создание отчето... 57605
ТЕХНОЛОГИИ ДОСТ... 53912
Программируемая... 52064
Пример работы с... 50056
Имитационное мо... 49337
21 ошибка прогр... 44229
Реклама
Сейчас на сайте
Гостей: 11
На сайте нет зарегистрированных пользователей

Пользователей: 13,048
новичок: Madison
Новости
Реклама
Выполняем курсовые и лабораторные по разным языкам программирования
Подробнее - курсовые и лабораторные на заказ
Delphi, Turbo Pascal, Assembler, C, C++, C#, Visual Basic, Java, GPSS, Prolog, 3D MAX, Компас 3D
Заказать программу для Windows Mobile, Symbian

Моделирование регулировочного участка цеха на GPSS + Пояснительная записка
моделирование процесса поступления заявок в ЭВМ на GPSS + Пояснительная ...
Обратное размещение элементов ЭВС на Delphi + Пояснительная записка

Реклама



Подписывайся на YouTube канал о программировании, что бы не пропустить новые видео!

ПОДПИСЫВАЙСЯ на канал о программировании

АМ-MSK модулятор
.486
.model flat, stdcall
option casemap:none

include win32.inc
include main.inc

include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\comctl32.inc
include \masm32\include\gdi32.inc
include \masm32\include\winmm.inc
include \masm32\include\fpu.inc
include \masm32\include\comdlg32.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\comctl32.lib
includelib \masm32\lib\winmm.lib
includelib \masm32\lib\fpu.lib
includelib \masm32\lib\comdlg32.lib

WndProc proto :DWORD, :DWORD, :DWORD, :DWORD
load_string_to_list proto :DWORD
load_mem_to_mem proto :DWORD,:DWORD,:DWORD,:DWORD
SetBmpColor proto :DWORD
SetNogreyScreen proto :DWORD, :DWORD
MainSetVolume proto :DWORD
ThreadTX_ASIN proto :DWORD

POINT struct
mouse_x dd ?
mouse_y dd ?
POINT ends

WM_USER1 EQU WM_USER + 100

IDM_EXIT EQU 102
IDM_ABOUT EQU 103

Button_ID1 EQU 2001
Button_ID2 EQU 2002
Button_ID3 EQU 2003
Button_ID4 EQU 2004
Button_ID5 EQU 2005
Group_ID1 EQU 2006
Group_ID2 EQU 2007
Group_ID3 EQU 2008
Group_ID4 EQU 2009
RadioButton_ID1 EQU 2010
RadioButton_ID2 EQU 2011
RadioButton_ID3 EQU 2012
COMBO_ID1 EQU 2013
COMBO_ID2 EQU 2014
COMBO_ID3 EQU 2015
COMBO_ID4 EQU 2016
COMBO_ID5 EQU 2017
Track_ID1 EQU 2018
Static_ID1 EQU 2019
Static_ID2 EQU 2020
StaticTest_ID1 EQU 2021
Button_ID6 EQU 2022
Button_ID7 EQU 2023
ButtonList_ID1_UP EQU 2024
ButtonList_ID1_DOWN EQU 2025
ButtonList_ID2_UP EQU 2026
ButtonList_ID2_DOWN EQU 2027
ButtonList_ID3_UP EQU 2028
ButtonList_ID3_DOWN EQU 2029
ButtonList_ID4_UP EQU 2030
ButtonList_ID4_DOWN EQU 2031
Static_ID3 EQU 2032
Button_ID8 EQU 2033
Button_ID9 EQU 2034
Button_ID10 EQU 2035
IDC_STATUS EQU 2036

ID_FILE1 EQU 3030
ID_FILE2 EQU 3031
IDB_STRELKA_UP EQU 3033
IDB_STRELKA_DOWN EQU 3034

SND_NOWAIT EQU 00002000h
SND_ALIAS EQU 00010000h
SND_ALIAS_ID EQU 00110000h
SND_FILENAME EQU 00020000h
SND_RESOURCE EQU 00040004h
COPY_BYTE EQU 00000001h
COPY_WORD EQU 00000002h
COPY_ONE EQU 00000004h
COPY_DOUBLE EQU 00000008h

.data?
String_Open_File db 300 dup (?)
hwndGroup1 dd ?
hwndGroup2 dd ?
hwndGroup3 dd ?
hwndGroup4 dd ?

hwndButton1 dd ?
hwndButton2 dd ?
hwndButton3 dd ?
hwndButton4 dd ?
hwndButton5 dd ?
hwndButtonList1_U dd ?
hwndButtonList1_D dd ?
hwndButtonList2_U dd ?
hwndButtonList2_D dd ?
hwndButtonList3_U dd ?
hwndButtonList3_D dd ?
hwndButtonList4_U dd ?
hwndButtonList4_D dd ?

hwndRadioButton1 dd ?
hwndRadioButton2 dd ?
hwndRadioButton3 dd ?

hwndCombo1 dd ?
hwndCombo2 dd ?
hwndCombo3 dd ?
hwndCombo4 dd ?

hwndButton6 dd ?
hwndButton7 dd ?
hwndButton8 dd ?
hwndButton9 dd ?
hwndButton10 dd ?
hwndTrack1 dd ?
hwndStatic1 dd ?
hwndStatic2 dd ?
hwndStatic3 dd ?
hwndStatus dd ?

hBitmapStrelkaDown dd ?
hBitmapStrelkaUp dd ?

.data

id_tread dd 00000010h
glob_fl dd 0
glob_fl2 dd 0
select_butt dd 0

I dd 0
J dd 0
R dd 0
Z dd 0
K dd 0

newhwnd dd 0
hInstance dd 0

Rect RECT
msg MSGSTRUCT
wc WNDCLASS
ofn OPENFILENAME

szTitleName db 'ЗВУХА v1.21',0
szClassName db 'mainasm32',0
MainMenuName db 'MyMenu',0

IconName db 'ID_ICON1',0
ButtonClassName db "button",0
ComboClassName db "COMBOBOX", 0
ListClassName db "LISTBOX", 0
StaticClassName db "STATIC",0
TrackClassName db "msctls_trackbar32",0

LOW_1200 db "1200/2400", 0
LOW_2400 db "2400/4800", 0
stop_text db "СТОП", 0

name_file1 db "#3030",0
name_file2 db "#3031",0

char_popravka db "0.0005",0

text_error1 db "не получилося",0
lpFontName db "times new roman", 0

ip_to_file1 dd ?
ip_to_file2 dd ?

tip_res db "#3032",0

hFont dd ?
hRes1 dd ?
hRes2 dd ?
test_bufer db "XXX ",0
name_vol db "Громкость", 0
new_text db "тест", 0

float_I dt 0
float_J dt 0
float_K dt 0
float_R dt 0
float_C dt 0
float_G dt 0
float_Z dt 0
float_A dt 0
float_popravka dt 0

temp_char_bufer1 db 50 dup (0)
temp_char_bufer2 db 50 dup (0)
temp_char_bufer3 db 100 dup (0)

freq_diskr db "44100.0",0
amplituda_max db "25000.0", 0
name_am_msk1 db "AM-MSK (..011011..)",0
name_am_msk2 db "AM-MSK (из файла)",0
name_source_sin db "однотональный",0
name_select_source db "выбрать источник",0

textAbout db "Разработчик :Ulex Электросигнал - 2005г.",0
schapkaAbout db "Об авторе",0
text_static1 db ",",0
text_static2 db "kHz",0
start_text db "Применить",0
start_text2 db "Передать файл",0
select_text db "Выбрать файл",0
string_one db "1.000",0
no_file db "нет файла", 0
FilterString db "All Files",0,"*.*",0, "Text Files",0,"*.txt",0,0

shapka_wav1 db 052h,049h,046h,046h,000h,000h,000h,000h
db 057h,041h,056h,045h,066h,06Dh,074h,020h
db 010h,000h,000h,000h,001h,000h,002h,000h
db 044h,0ACh,000h,000h,010h,0B1h,002h,000h
db 004h,000h,010h,000h,064h,061h,074h,061h

text_error2 db "Недостаточно памяти !!", 0
text_error3 db "Файл не выбран", 0
text_error4 db "Выбранный файл более 100 кБайт", 0

rejim_text1 db " - нет сигнала", 0
rejim_text2 db " - однотональный, частота ", 0
rejim_text2_1 db " герц", 0
rejim_text3 db " - AM-MSK из файла ", 0
rejim_text4 db " - период 1200 / период 2400 [1/1200- 833,33 мкс], [1/2400- 416,66 мкс]", 0
rejim_text5 db " - период 2400 / период 4800 [1/2400- 416,66 мкс], [1/4800- 208,33 мкс]", 0
rejim_text6 db " (формирование данных в ОЗУ)", 0


ip_memory_bufer dd 0
hend_memory_bufer dd 0
hOpenFile dd 0
counter_device dd 0
ip_memory_device dd 0
hend_memory_device dd 0
temp_byte db 0
temp_byte1 db 0

hFileTemp dd 0
Name_file_test db "out_signal.tmp", 0

.code
;-----------------------------------------------------------------------------
start:
; initialize the WndClass structure
mov [wc.clsStyle], CS_GLOBALCLASS
mov [wc.clsLpfnWndProc], offset WndProc
mov [wc.clsCbClsExtra], 0
mov [wc.clsCbWndExtra], 0

invoke GetModuleHandleA, 0
mov [hInstance], eax
mov [wc.clsHInstance], eax
;-------ikonka---------------
invoke LoadIconA ,[hInstance], offset IconName
mov [wc.clsHIcon], eax

invoke LoadCursorA, 0 ,IDC_ARROW
mov [wc.clsHCursor], eax

invoke GetStockObject, COLOR_BACKGROUND
mov [wc.clsHbrBackground], COLOR_BTNSHADOW

mov [wc.clsLpszMenuName], offset MainMenuName
mov [wc.clsLpszClassName], offset szClassName
invoke RegisterClassA, offset wc

invoke CreateWindowExA, 0,offset szClassName,offset szTitleName, \
WS_VISIBLE+WS_DLGFRAME+WS_SYSMENU+WS_GROUP,CW_USEDEFAULT, \
CW_USEDEFAULT,580,430,0,0, \
[hInstance], 0
mov [newhwnd], eax

invoke ShowWindow, [newhwnd], SW_SHOWNORMAL
invoke UpdateWindow, [newhwnd]

msg_loop:
invoke GetMessageA, offset msg, 0, 0, 0
cmp eax, 0
je end_loop
invoke TranslateMessage, offset msg
invoke DispatchMessageA, offset msg
jmp msg_loop
end_loop:
invoke ExitProcess, [msg.msWPARAM]

;-----------------------------------------------------------------------------
WndProc proc uses ebx edi esi, hwnd:DWORD, wmsg:DWORD,\
wparam:DWORD, lparam:DWORD

cmp [wmsg], WM_CREATE
je wmcreate
cmp [wmsg], WM_DESTROY
je wmdestroy
cmp [wmsg], WM_COMMAND
je wmcommand_select
cmp [wmsg], WM_NOTIFY
je wmcommandnotify
invoke DefWindowProcA, [hwnd],[wmsg],[wparam],[lparam]
ret

wmcommandnotify:
mov edi, [lparam]
assume edi:ptr NMHDR
cmp [edi].idFrom, Track_ID1
jne wmnotify_1
mov eax, [edi].hwndFrom
invoke SendMessage, eax, TBM_GETPOS, 0, 0
mov ecx, 0000FFFFh
sub ecx, eax
invoke MainSetVolume, ecx
ret
wmnotify_1:
ret

wmcreate:

invoke InitCommonControls

invoke CreateFontA,16,0,0,0,500,0,0,0,\
1,64,0,2,0 + 0, offset lpFontName
mov [hFont], eax

invoke LoadBitmapA, [hInstance], IDB_STRELKA_UP
invoke SetBmpColor, eax
mov [hBitmapStrelkaUp], eax
invoke LoadBitmapA, [hInstance], IDB_STRELKA_DOWN
invoke SetBmpColor, eax
mov [hBitmapStrelkaDown], eax

invoke CreateWindowExA, 0, offset [ButtonClassName], offset [name_am_msk1],\
WS_CHILD + WS_VISIBLE + BS_GROUPBOX, 320,10,150,150,\
[hwnd], Group_ID1, hInstance, NULL
mov [hwndGroup1], eax
invoke SendMessage, [hwndGroup1], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], offset [name_select_source],\
WS_CHILD + WS_VISIBLE + BS_GROUPBOX, 10,10,180,150,\
[hwnd], Group_ID2, hInstance, NULL
mov [hwndGroup2], eax
invoke SendMessage, [hwndGroup2], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], offset [name_am_msk2],\
WS_CHILD + WS_VISIBLE + BS_GROUPBOX, 10,180,220,150,\
[hwnd], Group_ID3, hInstance, NULL
mov [hwndGroup3], eax
invoke SendMessage, [hwndGroup3], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, WS_EX_CLIENTEDGE, offset [StaticClassName], 0,\
WS_CHILD + WS_VISIBLE, 20,210,190,20,\
[hwnd], Static_ID3, hInstance, NULL
mov [hwndStatic3], eax
invoke SendMessage, [hwndStatic3], WM_SETFONT, [hFont], 0
invoke SendMessage, [hwndStatic3], WM_SETTEXT, 0, offset [no_file]
invoke CreateWindowExA, 0, offset [ButtonClassName], offset [select_text],\
WS_CHILD + WS_VISIBLE, 60,240,120,20,\
[hwnd], Button_ID8, hInstance, NULL
mov [hwndButton8], eax
invoke SendMessage, [hwndButton8], WM_SETFONT, [hFont], 0
invoke CreateWindowExA, 0, offset [ButtonClassName], offset [start_text2],\
WS_CHILD + WS_VISIBLE, 60,270,120,20,\
[hwnd], Button_ID9, hInstance, NULL
mov [hwndButton9], eax
invoke SendMessage, [hwndButton9], WM_SETFONT, [hFont], 0
invoke CreateWindowExA, 0, offset [ButtonClassName], offset [stop_text],\
WS_CHILD + WS_VISIBLE, 60,300,120,20,\
[hwnd], Button_ID10, hInstance, NULL
mov [hwndButton10], eax
invoke SendMessage, [hwndButton10], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], offset [name_source_sin],\
WS_CHILD + WS_VISIBLE + BS_GROUPBOX, 250,180,220,150,\
[hwnd], Group_ID4, hInstance, NULL
mov [hwndGroup4], eax
invoke SendMessage, [hwndGroup4], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ListClassName], 0,\
WS_CHILD + WS_VISIBLE + LBS_NOSEL + WS_BORDER,\
260,210,15,30, [hwnd], COMBO_ID1, hInstance, NULL
mov [hwndCombo1], eax
invoke SendMessage, [hwndCombo1], WM_SETFONT, [hFont], 0
invoke load_string_to_list, hwndCombo1
invoke SendMessage, [hwndCombo1], LB_SETCURSEL, 0, TRUE

invoke CreateWindowExA, 0, offset [ButtonClassName], 0,\
WS_CHILD + WS_VISIBLE + BS_BITMAP, 275,210,15,9,\
[hwnd], ButtonList_ID1_UP, hInstance, NULL
mov [hwndButtonList1_U], eax
invoke SendMessage, [hwndButtonList1_U], BM_SETIMAGE, 0, [hBitmapStrelkaUp]
invoke CreateWindowExA, 0, offset [ButtonClassName], 0,\
WS_CHILD + WS_VISIBLE + BS_BITMAP, 275,219,15,9,\
[hwnd], ButtonList_ID1_DOWN, hInstance, NULL
mov [hwndButtonList1_D], eax
invoke SendMessage, [hwndButtonList1_D], BM_SETIMAGE, 0, [hBitmapStrelkaDown]

invoke CreateWindowExA, 0, offset [StaticClassName], offset [text_static1],\
WS_CHILD + WS_VISIBLE, 295,210,20,30,\
[hwnd], Static_ID1, hInstance, NULL
mov [hwndStatic1], eax
invoke SendMessage, [hwndStatic1], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ListClassName], 0,\
WS_CHILD + WS_VISIBLE + LBS_NOSEL + WS_BORDER,\
320,210,15,30, [hwnd], COMBO_ID3, hInstance, NULL
mov [hwndCombo2], eax
invoke SendMessage, [hwndCombo2], WM_SETFONT, [hFont], 0
invoke load_string_to_list, hwndCombo2
invoke SendMessage, [hwndCombo2], LB_SETCURSEL, 0, TRUE

invoke CreateWindowExA, 0, offset [ButtonClassName], 0,\
WS_CHILD + WS_VISIBLE + BS_BITMAP, 335,210,15,9,\
[hwnd], ButtonList_ID2_UP, hInstance, NULL
mov [hwndButtonList2_U], eax
invoke SendMessage, [hwndButtonList2_U], BM_SETIMAGE, 0, [hBitmapStrelkaUp]
invoke CreateWindowExA, 0, offset [ButtonClassName], 0,\
WS_CHILD + WS_VISIBLE + BS_BITMAP, 335,219,15,9,\
[hwnd], ButtonList_ID2_DOWN, hInstance, NULL
mov [hwndButtonList2_D], eax
invoke SendMessage, [hwndButtonList2_D], BM_SETIMAGE, 0, [hBitmapStrelkaDown]

invoke CreateWindowExA, 0, offset [ListClassName], 0,\
WS_CHILD + WS_VISIBLE + LBS_NOSEL + WS_BORDER,\
355,210,15,30, [hwnd], COMBO_ID4, hInstance, NULL
mov [hwndCombo3], eax
invoke SendMessage, [hwndCombo3], WM_SETFONT, [hFont], 0
invoke load_string_to_list, hwndCombo3
invoke SendMessage, [hwndCombo3], LB_SETCURSEL, 0, TRUE
invoke CreateWindowExA, 0, offset [ButtonClassName], 0,\
WS_CHILD + WS_VISIBLE + BS_BITMAP, 370,210,15,9,\
[hwnd], ButtonList_ID3_UP, hInstance, NULL
mov [hwndButtonList3_U], eax
invoke SendMessage, [hwndButtonList3_U], BM_SETIMAGE, 0, [hBitmapStrelkaUp]
invoke CreateWindowExA, 0, offset [ButtonClassName], 0,\
WS_CHILD + WS_VISIBLE + BS_BITMAP, 370,219,15,9,\
[hwnd], ButtonList_ID3_DOWN, hInstance, NULL
mov [hwndButtonList3_D], eax
invoke SendMessage, [hwndButtonList3_D], BM_SETIMAGE, 0, [hBitmapStrelkaDown]

invoke CreateWindowExA, 0, offset [ListClassName], 0,\
WS_CHILD + WS_VISIBLE + LBS_NOSEL + WS_BORDER,\
390,210,15,30, [hwnd], COMBO_ID4, hInstance, NULL
mov [hwndCombo4], eax
invoke SendMessage, [hwndCombo4], WM_SETFONT, [hFont], 0
invoke load_string_to_list, hwndCombo4
invoke SendMessage, [hwndCombo4], LB_SETCURSEL, 0, TRUE
invoke CreateWindowExA, 0, offset [ButtonClassName], 0,\
WS_CHILD + WS_VISIBLE + BS_BITMAP, 405,210,15,9,\
[hwnd], ButtonList_ID4_UP, hInstance, NULL
mov [hwndButtonList4_U], eax
invoke SendMessage, [hwndButtonList4_U], BM_SETIMAGE, 0, [hBitmapStrelkaUp]
invoke CreateWindowExA, 0, offset [ButtonClassName], 0,\
WS_CHILD + WS_VISIBLE + BS_BITMAP, 405,219,15,9,\
[hwnd], ButtonList_ID4_DOWN, hInstance, NULL
mov [hwndButtonList4_D], eax
invoke SendMessage, [hwndButtonList4_D], BM_SETIMAGE, 0, [hBitmapStrelkaDown]

invoke CreateWindowExA, 0, offset [ButtonClassName], offset [start_text],\
WS_CHILD + WS_VISIBLE, 320,240,80,20,\
[hwnd], Button_ID6, hInstance, NULL
mov [hwndButton6], eax
invoke SendMessage, [hwndButton6], WM_SETFONT, [hFont], 0
invoke CreateWindowExA, 0, offset [ButtonClassName], offset [stop_text],\
WS_CHILD + WS_VISIBLE, 320,270,80,20,\
[hwnd], Button_ID7, hInstance, NULL
mov [hwndButton7], eax
invoke SendMessage, [hwndButton7], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [StaticClassName], offset [text_static2],\
WS_CHILD + WS_VISIBLE, 430,210,30,30,\
[hwnd], Static_ID2, hInstance, NULL
mov [hwndStatic2], eax
invoke SendMessage, [hwndStatic2], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], \
offset [LOW_1200], WS_CHILD + WS_VISIBLE, 360,40,80,20,\
[hwnd], Button_ID1, hInstance, NULL
mov [hwndButton1], eax
invoke SendMessage, [hwndButton1], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], \
offset [LOW_2400], WS_CHILD + WS_VISIBLE, 360,70,80,20,\
[hwnd], Button_ID2, hInstance, NULL
mov [hwndButton2], eax
invoke SendMessage, [hwndButton2], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], \
offset [stop_text], WS_CHILD + WS_VISIBLE, 360,100,80,20,\
[hwnd], Button_ID3, hInstance, NULL
mov [hwndButton3], eax
invoke SendMessage, [hwndButton3], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], offset [name_am_msk1],\
WS_CHILD + WS_VISIBLE + BS_AUTORADIOBUTTON, 20,40,150,20,\
[hwnd], RadioButton_ID1, hInstance, NULL
mov [hwndRadioButton1], eax
invoke SendMessage, [hwndRadioButton1], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], offset [name_am_msk2],\
WS_CHILD + WS_VISIBLE + BS_AUTORADIOBUTTON, 20,70,150,20,\
[hwnd], RadioButton_ID2, hInstance, NULL
mov [hwndRadioButton2], eax
invoke SendMessage, [hwndRadioButton2], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [ButtonClassName], offset [name_source_sin],\
WS_CHILD + WS_VISIBLE + BS_AUTORADIOBUTTON, 20,100,150,20,\
[hwnd], RadioButton_ID3, hInstance, NULL
mov [hwndRadioButton3], eax
invoke SendMessage, [hwndRadioButton3], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, WS_EX_CLIENTEDGE, offset [StaticClassName], 0,\
WS_CHILD + WS_VISIBLE, 480,10,80,320,\
[hwnd], Button_ID4, hInstance, NULL
mov [hwndButton4], eax

invoke CreateWindowExA, 0, offset [StaticClassName], offset [name_vol],\
WS_CHILD + WS_VISIBLE, 490,20,65,20,\
[hwnd], Button_ID5, hInstance, NULL
mov [hwndButton5], eax
invoke SendMessage, [hwndButton5], WM_SETFONT, [hFont], 0

invoke CreateWindowExA, 0, offset [TrackClassName], 0,\
WS_CHILD + WS_VISIBLE + TBS_AUTOTICKS + TBS_VERT + TBS_LEFT + TBS_BOTH,\
510,40,30,280,\
[hwnd], Track_ID1, hInstance, NULL
mov [hwndTrack1], eax
invoke SendMessage, [hwndTrack1], TBM_SETRANGEMAX, TRUE, 0000FFFFh
invoke SendMessage, [hwndTrack1], TBM_SETRANGEMIN, TRUE, 00000000h
invoke SendMessage, [hwndTrack1], TBM_SETPOS, TRUE, 0000CFFFh
invoke SendMessage, [hwndTrack1], TBM_SETTICFREQ, 6553, 0

invoke FindResource, 0, offset [name_file1], offset [tip_res]
mov [hRes1], eax
invoke LoadResource, 0, [hRes1]
mov [hRes1], eax
invoke LockResource, [hRes1]
mov [ip_to_file1], eax

invoke FindResource, 0, offset [name_file2], offset [tip_res]
mov [hRes2], eax
invoke LoadResource, 0, [hRes2]
mov [hRes2], eax
invoke LockResource, [hRes2]
mov [ip_to_file2], eax

invoke SendMessage, [hwndRadioButton1], BM_SETCHECK, 1, 0
mov select_butt, 1
invoke SetNogreyScreen, 1, 1
invoke SetNogreyScreen, 2, 0
invoke SetNogreyScreen, 3, 0

invoke CreateStatusWindow,WS_CHILD or WS_VISIBLE or \
SBS_SIZEGRIP, NULL, hwnd, IDC_STATUS
mov hwndStatus, eax

mov eax, offset [temp_char_bufer1]
mov dword ptr [eax], -1
invoke SendMessage,hwndStatus,SB_SETPARTS,1, offset [temp_char_bufer1]
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]

invoke waveOutGetNumDevs
mov counter_device, eax
shl eax, 2

invoke GlobalAlloc, GMEM_MOVEABLE or GMEM_ZEROINIT, eax
mov [hend_memory_device], eax
invoke GlobalLock, [hend_memory_device]
mov [ip_memory_device], eax
mov I, 0
wmcreate2:
mov eax, counter_device
cmp I, eax
je wmcreate1
invoke waveOutGetVolume, I, addr J
mov eax, J
mov ecx, [ip_memory_device]
mov dword ptr [ecx], eax
add [ip_memory_device], 4
inc I
jmp wmcreate2
wmcreate1:
invoke MainSetVolume, 07FFFh
ret

wmcommand_select:
cmp lparam, 0
je wmcommand
jmp wmcommand_key

wmcommand:
mov eax, [wparam]
cmp eax, IDM_ABOUT
je wmcommand1
cmp eax, IDM_EXIT
je wmdestroy
ret

wmcommand1:
invoke MessageBox, [hwnd], offset textAbout, offset schapkaAbout,\
MB_ICONASTERISK
ret

wmcommand_key:
mov eax, [wparam]
mov ecx, eax
shr eax, 16
cmp cx, Button_ID1
je wmcommand_ID1
cmp cx, Button_ID2
je wmcommand_ID2
cmp cx, Button_ID3
je wmcommand_ID3

cmp cx, Button_ID6
je wmcommand_ID6
cmp cx, Button_ID7
je wmcommand_ID7

cmp cx, Button_ID8
je wmcommand_ID8
cmp cx, Button_ID9
je wmcommand_ID9
cmp cx, Button_ID10
je wmcommand_ID10

cmp cx, RadioButton_ID1
je wmcommand_RadioButton_ID1
cmp cx, RadioButton_ID2
je wmcommand_RadioButton_ID2
cmp cx, RadioButton_ID3
je wmcommand_RadioButton_ID3

cmp cx, ButtonList_ID1_UP
je wmcommand_ListID1_UP
cmp cx, ButtonList_ID1_DOWN
je wmcommand_ListID1_DOWN
cmp cx, ButtonList_ID2_UP
je wmcommand_ListID2_UP
cmp cx, ButtonList_ID2_DOWN
je wmcommand_ListID2_DOWN
cmp cx, ButtonList_ID3_UP
je wmcommand_ListID3_UP
cmp cx, ButtonList_ID3_DOWN
je wmcommand_ListID3_DOWN
cmp cx, ButtonList_ID4_UP
je wmcommand_ListID4_UP
cmp cx, ButtonList_ID4_DOWN
je wmcommand_ListID4_DOWN
ret

wmcommand_RadioButton_ID1:
cmp ax, BN_CLICKED
je wmcommand_RadioButton_ID1_job
ret
wmcommand_RadioButton_ID1_job:
cmp select_butt, 1
je wmcommand_RadioButton_ID1_job2
cmp [ip_memory_bufer], 00000000h
je wmcommand_RadioButton_ID1_job1
mov glob_fl2, 1
invoke sndPlaySound, 0, 0
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
wmcommand_RadioButton_ID1_job1:
invoke SetNogreyScreen, 1, 1
invoke SetNogreyScreen, 2, 0
invoke SetNogreyScreen, 3, 0
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
mov select_butt, 1
invoke InvalidateRect, [hwnd], 0, 0
ret
wmcommand_RadioButton_ID1_job2:
ret

wmcommand_RadioButton_ID2:
cmp ax, BN_CLICKED
je wmcommand_RadioButton_ID2_job
ret
wmcommand_RadioButton_ID2_job:
cmp select_butt, 2
je wmcommand_RadioButton_ID2_job2
cmp [ip_memory_bufer], 00000000h
je wmcommand_RadioButton_ID2_job1
mov glob_fl2, 1
invoke sndPlaySound, 0, 0
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
wmcommand_RadioButton_ID2_job1:
invoke SetNogreyScreen, 1, 0
invoke SetNogreyScreen, 2, 1
invoke SetNogreyScreen, 3, 0
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
mov select_butt, 2
invoke InvalidateRect, [hwnd], 0, 0
ret
wmcommand_RadioButton_ID2_job2:
ret

wmcommand_RadioButton_ID3:
cmp ax, BN_CLICKED
je wmcommand_RadioButton_ID3_job
ret
wmcommand_RadioButton_ID3_job:
cmp select_butt, 3
je wmcommand_RadioButton_ID3_job2
cmp [ip_memory_bufer], 00000000h
je wmcommand_RadioButton_ID3_job1
mov glob_fl2, 1
invoke sndPlaySound, 0, 0
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
wmcommand_RadioButton_ID3_job1:
invoke SetNogreyScreen, 1, 0
invoke SetNogreyScreen, 2, 0
invoke SetNogreyScreen, 3, 1
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
mov select_butt, 3
invoke InvalidateRect, [hwnd], 0, 0
ret
wmcommand_RadioButton_ID3_job2:
ret

wmcommand_ID9:
cmp ax, BN_CLICKED
je wmcommand_ID9_job
ret
wmcommand_ID9_job:
mov glob_fl2, 0
cmp [ip_memory_bufer], 00000000h
je wmcommand_ID9job1
invoke sndPlaySound, 0, 0
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
wmcommand_ID9job1:
invoke CreateFile, offset [String_Open_File], GENERIC_READ, 0,\
0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0
cmp eax, INVALID_HANDLE_VALUE
je wmcommand_ID9_error1
mov [hOpenFile], eax
invoke SetFilePointer, [hOpenFile], 0, 0, FILE_BEGIN
invoke GetFileSize, [hOpenFile], 0
cmp eax, 100000
jnl wmcommand_ID9_error2

mov R, eax

invoke FpuMul, 147, R, addr float_J,\
SRC1_DIMM + SRC2_DIMM + DEST_MEM
invoke FpuTrunc, addr float_J, addr R, SRC1_REAL + DEST_IMEM
mov eax, R
shl eax, 2
mov R, eax
add R, 44
invoke GlobalAlloc, GMEM_MOVEABLE or GMEM_ZEROINIT, R
cmp eax, 0
je wmcommand_ID9_error3
mov [hend_memory_bufer], eax

invoke lstrcpy, offset [temp_char_bufer3], offset [rejim_text1]
invoke lstrcat, offset [temp_char_bufer3], offset [rejim_text6]
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [temp_char_bufer3]

invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax
invoke load_mem_to_mem, [ip_memory_bufer], offset [shapka_wav1],\
40, COPY_BYTE + COPY_ONE
mov eax, [ip_memory_bufer]
add eax, 40
mov ecx, R
sub ecx, 44
mov dword ptr [eax], ecx
mov eax, [ip_memory_bufer]
add eax, 4
add ecx, 36
mov dword ptr [eax], ecx

invoke GlobalLock, [hend_memory_bufer]
add eax, 44
mov [ip_memory_bufer], eax

invoke FpuDiv, 1, 2400, addr float_J,\
SRC1_DIMM + SRC2_DIMM + DEST_MEM
; float_J - время передачи одного бита
invoke FpuDiv, 1, 44100, addr float_I,\
SRC1_DIMM + SRC2_DIMM + DEST_MEM
; float_I - период частоты дискретизации
invoke FpuMul, 0, 0, addr float_R,\
SRC1_DIMM + SRC2_DIMM + DEST_MEM
;float_R - стартовое время

invoke ReadFile, [hOpenFile], offset [temp_byte], 1, \
offset [J], 0
mov cl, temp_byte
mov temp_byte1, cl
mov Z, 8
and ecx, 00000001h
cmp cl, 0
jne wmcommand_ID9job3
invoke FpuMul, 0, 0, addr float_A,\
SRC1_DIMM + SRC2_DIMM + DEST_MEM
jmp wmcommand_ID9job4
wmcommand_ID9job3:
invoke FpuMul, 1, FPU_PI, addr float_A,\
SRC1_DIMM + SRC2_CONST + DEST_MEM
wmcommand_ID9job4:
;float_A - стартовый фазовый сдвиг
mov cl, temp_byte
shr ecx, 1
mov temp_byte, cl
invoke FpuMul, 2, FPU_PI, addr float_C,\
SRC1_DIMM + SRC2_CONST + DEST_MEM
invoke FpuMul, 1200, addr float_C, addr float_G,\
SRC1_DIMM + SRC2_REAL + DEST_MEM
;float_G - стартовая функция
wmcommand_ID9job2:
invoke FpuMul, addr float_R, addr float_G, addr float_Z,\
SRC1_REAL + SRC2_REAL + DEST_MEM
invoke FpuAdd, addr float_Z, addr float_A, addr float_C,\
SRC1_REAL + SRC2_REAL + DEST_MEM
invoke FpuSin, addr float_C, addr float_Z, ANG_RAD + SRC1_REAL + DEST_MEM
invoke FpuMul, addr float_Z, 25000, addr float_C,\
SRC1_REAL + SRC2_DIMM + DEST_MEM
invoke FpuTrunc, addr float_C, addr K, SRC1_REAL + DEST_IMEM
mov eax, [ip_memory_bufer]
mov ecx, K
mov word ptr [eax], cx
add eax, 2
mov word ptr [eax], cx
add [ip_memory_bufer], 4

invoke FpuAdd, addr float_R, addr float_I, addr float_C,\
SRC1_REAL + SRC2_REAL + DEST_MEM
invoke FpuAdd, addr float_C, 0, addr float_R,\
SRC1_REAL + SRC2_DIMM + DEST_MEM

invoke FpuComp, addr float_R, addr float_J, SRC1_REAL + SRC2_REAL
cmp eax, CMP_LOWER
je wmcommand_ID9job2
dec Z
invoke FpuSub, addr float_C, addr float_J, addr float_R,\
SRC1_REAL + SRC2_REAL + DEST_MEM
cmp Z, 0
je wmcommand_ID9job20
jmp wmcommand_ID9job21
wmcommand_ID9job20:
invoke ReadFile, [hOpenFile], offset [temp_byte], 1, \
offset [J], 0
cmp J, 0
je wmcommand_ID9job30
mov Z, 8
wmcommand_ID9job21:
mov cl, temp_byte
mov al, temp_byte1
and eax, 00000001h
and ecx, 00000001h
cmp al, cl
je wmcommand_ID9job22
invoke FpuMul, 2, FPU_PI, addr float_C,\
SRC1_DIMM + SRC2_CONST + DEST_MEM
invoke FpuMul, 1200, addr float_C, addr float_G,\
SRC1_DIMM + SRC2_REAL + DEST_MEM
jmp wmcommand_ID9job23
wmcommand_ID9job22:
invoke FpuMul, 2, FPU_PI, addr float_C,\
SRC1_DIMM + SRC2_CONST + DEST_MEM
invoke FpuMul, 2400, addr float_C, addr float_G,\
SRC1_DIMM + SRC2_REAL + DEST_MEM
mov cl, temp_byte1
and ecx, 00000001h
cmp cl, 0
je wmcommand_ID9job40
invoke FpuMul, 0, 0, addr float_A,\
SRC1_DIMM + SRC2_DIMM + DEST_MEM
mov cl, temp_byte
mov temp_byte1, cl
shr cl, 1
mov temp_byte, cl
jmp wmcommand_ID9job2
wmcommand_ID9job40:
invoke FpuMul, 1, FPU_PI, addr float_A,\
SRC1_DIMM + SRC2_CONST + DEST_MEM
mov cl, temp_byte
mov temp_byte1, cl
shr cl, 1
mov temp_byte, cl
jmp wmcommand_ID9job2

wmcommand_ID9job23:
mov cl, temp_byte1
and ecx, 00000001h
cmp cl, 0
je wmcommand_ID9job24
invoke FpuMul, 0, 0, addr float_A,\
SRC1_DIMM + SRC2_DIMM + DEST_MEM
mov cl, temp_byte
mov temp_byte1, cl
shr cl, 1
mov temp_byte, cl
jmp wmcommand_ID9job2

wmcommand_ID9job24:
invoke FpuMul, 1, FPU_PI, addr float_A,\
SRC1_DIMM + SRC2_CONST + DEST_MEM
mov cl, temp_byte
mov temp_byte1, cl
shr cl, 1
mov temp_byte, cl
jmp wmcommand_ID9job2
wmcommand_ID9job30:

invoke CloseHandle, [hOpenFile]
invoke lstrcpy, offset [temp_char_bufer3], offset [rejim_text3]
invoke lstrcat, offset [temp_char_bufer3], offset [String_Open_File]
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [temp_char_bufer3]

;# test start
invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax
; invoke CreateFile, offset [Name_file_test], GENERIC_READ + GENERIC_WRITE, 0,\
; 0, CREATE_ALWAYS , FILE_ATTRIBUTE_NORMAL, 0
; mov [hFileTemp], eax
; invoke SetFilePointer, [hFileTemp], 0, 0, FILE_BEGIN
; invoke WriteFile, [hFileTemp], [ip_memory_bufer], R, \
; offset [J], 0
; invoke SetEndOfFile, [hFileTemp]
; invoke CloseHandle, [hFileTemp]
;# test stop

invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax
mov glob_fl, TRUE
mov eax, offset ThreadTX_ASIN
invoke CreateThread, NULL, NULL, eax, [ip_memory_bufer],\
0, offset id_tread
invoke CloseHandle, eax
invoke Sleep, 100
cmp glob_fl, FALSE
je error_1
invoke GetWindowLong, [hwndButton9], GWL_STYLE
or eax, WS_DISABLED
invoke SetWindowLong, [hwndButton9], GWL_STYLE, eax
invoke InvalidateRect, [hwndButton9], 0, 0
ret

wmcommand_ID9_error1:
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
invoke MessageBox, [hwnd], offset text_error3, 0,\
MB_OK + MB_ICONEXCLAMATION
ret
wmcommand_ID9_error2:
invoke CloseHandle, [hOpenFile]
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
invoke MessageBox, [hwnd], offset text_error4, 0,\
MB_OK + MB_ICONEXCLAMATION
ret
wmcommand_ID9_error3:
invoke CloseHandle, [hOpenFile]
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
invoke MessageBox, [hwnd], offset text_error2, 0,\
MB_OK + MB_ICONEXCLAMATION
ret

wmcommand_ID8:
cmp ax, BN_CLICKED
je wmcommand_ID8_job
ret
wmcommand_ID8_job:
mov [ofn.lStructSize], SIZEOF ofn
mov eax, [hwnd]
mov [ofn.hwndOwner], eax
mov eax, [hInstance]
mov [ofn.hInstance], eax
mov [ofn.lpstrFilter], offset [FilterString]
mov [ofn.lpstrFile], offset [String_Open_File]
mov [ofn.nMaxFile], 300
mov [ofn.Flags], OFN_FILEMUSTEXIST or OFN_PATHMUSTEXIST \
or OFN_LONGNAMES or OFN_HIDEREADONLY
invoke GetOpenFileName, offset [ofn]
cmp eax, TRUE
jne wmcommand_ID8_job1
xor eax, eax
mov ax, [ofn.nFileOffset]
mov ecx, offset [String_Open_File]
add ecx, eax
invoke SendMessage, [hwndStatic3], WM_SETTEXT, \
0, ecx
ret
wmcommand_ID8_job1:
mov eax, offset [String_Open_File]
mov byte ptr [eax], 0
invoke SendMessage, [hwndStatic3], WM_SETTEXT, \
0, offset [no_file]
ret

wmcommand_ListID1_UP:
cmp ax, BN_CLICKED
je wmcommand_ListID1_UP_job
ret
wmcommand_ListID1_UP_job:
invoke SetFocus, [hwndCombo1]
invoke SendMessage, [hwndCombo1], LB_GETCURSEL, 0, 0
cmp eax, 0
je wmcommand_ListID1_UP_job1
dec eax
invoke SendMessage, [hwndCombo1], LB_SETCURSEL, eax, TRUE
wmcommand_ListID1_UP_job1:
ret
wmcommand_ListID1_DOWN:
cmp ax, BN_CLICKED
je wmcommand_ListID1_DOWN_job
ret
wmcommand_ListID1_DOWN_job:
invoke SetFocus, [hwndCombo1]
invoke SendMessage, [hwndCombo1], LB_GETCURSEL, 0, 0
cmp eax, 9
je wmcommand_ListID1_UP_job1
inc eax
invoke SendMessage, [hwndCombo1], LB_SETCURSEL, eax, TRUE
ret

wmcommand_ListID2_UP:
cmp ax, BN_CLICKED
je wmcommand_ListID2_UP_job
ret
wmcommand_ListID2_UP_job:
invoke SetFocus, [hwndCombo2]
invoke SendMessage, [hwndCombo2], LB_GETCURSEL, 0, 0
cmp eax, 0
je wmcommand_ListID2_UP_job1
dec eax
invoke SendMessage, [hwndCombo2], LB_SETCURSEL, eax, TRUE
wmcommand_ListID2_UP_job1:
ret
wmcommand_ListID2_DOWN:
cmp ax, BN_CLICKED
je wmcommand_ListID2_DOWN_job
ret
wmcommand_ListID2_DOWN_job:
invoke SetFocus, [hwndCombo2]
invoke SendMessage, [hwndCombo2], LB_GETCURSEL, 0, 0
cmp eax, 9
je wmcommand_ListID2_UP_job1
inc eax
invoke SendMessage, [hwndCombo2], LB_SETCURSEL, eax, TRUE
ret

wmcommand_ListID3_UP:
cmp ax, BN_CLICKED
je wmcommand_ListID3_UP_job
ret
wmcommand_ListID3_UP_job:
invoke SetFocus, [hwndCombo3]
invoke SendMessage, [hwndCombo3], LB_GETCURSEL, 0, 0
cmp eax, 0
je wmcommand_ListID3_UP_job1
dec eax
invoke SendMessage, [hwndCombo3], LB_SETCURSEL, eax, TRUE
wmcommand_ListID3_UP_job1:
ret
wmcommand_ListID3_DOWN:
cmp ax, BN_CLICKED
je wmcommand_ListID3_DOWN_job
ret
wmcommand_ListID3_DOWN_job:
invoke SetFocus, [hwndCombo3]
invoke SendMessage, [hwndCombo3], LB_GETCURSEL, 0, 0
cmp eax, 9
je wmcommand_ListID3_UP_job1
inc eax
invoke SendMessage, [hwndCombo3], LB_SETCURSEL, eax, TRUE
ret

wmcommand_ListID4_UP:
cmp ax, BN_CLICKED
je wmcommand_ListID4_UP_job
ret
wmcommand_ListID4_UP_job:
invoke SetFocus, [hwndCombo4]
invoke SendMessage, [hwndCombo4], LB_GETCURSEL, 0, 0
cmp eax, 0
je wmcommand_ListID4_UP_job1
dec eax
invoke SendMessage, [hwndCombo4], LB_SETCURSEL, eax, TRUE
wmcommand_ListID4_UP_job1:
ret
wmcommand_ListID4_DOWN:
cmp ax, BN_CLICKED
je wmcommand_ListID4_DOWN_job
ret
wmcommand_ListID4_DOWN_job:
invoke SetFocus, [hwndCombo4]
invoke SendMessage, [hwndCombo4], LB_GETCURSEL, 0, 0
cmp eax, 9
je wmcommand_ListID4_UP_job1
inc eax
invoke SendMessage, [hwndCombo4], LB_SETCURSEL, eax, TRUE
ret

wmcommand_ID1:
cmp ax, BN_CLICKED
je wmcommand_ID1job
ret
wmcommand_ID1job:
cmp [ip_memory_bufer], 00000000h
je wmcommand_ID1job1
invoke sndPlaySound, 0, 0
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
wmcommand_ID1job1:
invoke GlobalAlloc, GMEM_MOVEABLE or GMEM_ZEROINIT, 1808
mov [hend_memory_bufer], eax
invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax
invoke load_mem_to_mem, [ip_memory_bufer], offset [shapka_wav1],\
40, COPY_BYTE + COPY_ONE
add [ip_memory_bufer], 40
mov eax, [ip_memory_bufer]
mov dword ptr [eax], 1764
add [ip_memory_bufer], 4
invoke load_mem_to_mem, [ip_memory_bufer], [ip_to_file1],\
441, COPY_WORD + COPY_DOUBLE
invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax
add eax, 4
mov dword ptr [eax], 1800
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text4]
invoke sndPlaySound, [ip_memory_bufer],\
SND_ASYNC + SND_LOOP + SND_MEMORY
cmp eax, FALSE
je error_1
ret

wmcommand_ID2:
cmp ax, BN_CLICKED
je wmcommand_ID2job
ret
wmcommand_ID2job:
cmp [ip_memory_bufer], 00000000h
je wmcommand_ID2job1
invoke sndPlaySound, 0, 0
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
wmcommand_ID2job1:
invoke GlobalAlloc, GMEM_MOVEABLE or GMEM_ZEROINIT, 1808
mov [hend_memory_bufer], eax
invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax
invoke load_mem_to_mem, [ip_memory_bufer], offset [shapka_wav1],\
40, COPY_BYTE + COPY_ONE
add [ip_memory_bufer], 40
mov eax, [ip_memory_bufer]
mov dword ptr [eax], 1764
add [ip_memory_bufer], 4
invoke load_mem_to_mem, [ip_memory_bufer], [ip_to_file2],\
441, COPY_WORD + COPY_DOUBLE
invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax
add eax, 4
mov dword ptr [eax], 1800
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text5]
invoke sndPlaySound, [ip_memory_bufer],\
SND_ASYNC + SND_LOOP + SND_MEMORY
cmp eax, FALSE
je error_1
ret

error_1:
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
invoke MessageBox, [hwnd], offset [text_error1], \
0, MB_OK + MB_ICONEXCLAMATION
ret

wmcommand_ID6:
cmp ax, BN_CLICKED
je wmcommand_ID6job
ret
wmcommand_ID6job:
cmp [ip_memory_bufer], 00000000h
je wmcommand_ID6job1
invoke sndPlaySound, 0, 0
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
wmcommand_ID6job1:
mov [temp_char_bufer2 + 0], 0
invoke SendMessage, [hwndCombo1], LB_GETCURSEL, 0, 0
invoke SendMessage, [hwndCombo1], LB_GETTEXT, eax, offset [temp_char_bufer2]
mov [temp_char_bufer1 + 0], 0
invoke SendMessage, [hwndCombo2], LB_GETCURSEL, 0, 0
invoke SendMessage, [hwndCombo2], LB_GETTEXT, eax, offset [temp_char_bufer1]
invoke lstrcat, offset [temp_char_bufer2], offset [temp_char_bufer1]
mov [temp_char_bufer1 + 0], 0
invoke SendMessage, [hwndCombo3], LB_GETCURSEL, 0, 0
invoke SendMessage, [hwndCombo3], LB_GETTEXT, eax, offset [temp_char_bufer1]
invoke lstrcat, offset [temp_char_bufer2], offset [temp_char_bufer1]
mov [temp_char_bufer1 + 0], 0
invoke SendMessage, [hwndCombo4], LB_GETCURSEL, 0, 0
invoke SendMessage, [hwndCombo4], LB_GETTEXT, eax, offset [temp_char_bufer1]
invoke lstrcat, offset [temp_char_bufer2], offset [temp_char_bufer1]

invoke FpuAtoFL, ADDR char_popravka, ADDR float_popravka, DEST_MEM

invoke FpuAtoFL, ADDR temp_char_bufer2, ADDR float_I, DEST_MEM
invoke FpuComp, addr float_I, 0, SRC1_REAL + SRC2_DIMM
cmp eax, CMP_EQU
je wmcommand_ID6_error1

invoke lstrcpy, offset [temp_char_bufer3], offset [rejim_text1]
invoke lstrcat, offset [temp_char_bufer3], offset [rejim_text6]
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [temp_char_bufer3]

invoke FpuAtoFL, ADDR string_one, ADDR float_K, DEST_MEM
invoke FpuDiv, addr float_K, addr float_I, addr float_J,\
SRC1_REAL + SRC2_REAL + DEST_MEM
invoke FpuAtoFL, ADDR freq_diskr, ADDR float_G, DEST_MEM
;float_J - период набранной частоты
;float_I - набранная частота
;float_G - частота дискретизации
mov J, 1
wmcommand_ID6job3:
invoke FpuMul, addr float_J, addr J, addr float_Z,\
SRC1_REAL + SRC2_DMEM + DEST_MEM
invoke FpuMul, addr float_G, addr float_Z, addr float_C,\
SRC1_REAL + SRC2_REAL + DEST_MEM
invoke FpuTrunc, addr float_C, addr float_R, SRC1_REAL + DEST_MEM
invoke FpuSub, addr float_C, addr float_R, addr float_K,\
SRC1_REAL + SRC2_REAL + DEST_MEM
invoke FpuComp, addr float_K, addr float_popravka, SRC1_REAL + SRC2_REAL
cmp eax, CMP_LOWER
je wmcommand_ID6job2
inc J
jmp wmcommand_ID6job3
wmcommand_ID6job2:
;float_R - количество отсчетов
invoke FpuTrunc, addr float_R, addr R, SRC1_REAL + DEST_IMEM
mov eax, R
shl eax, 2
add eax, 44
mov R, eax
invoke GlobalAlloc, GMEM_MOVEABLE or GMEM_ZEROINIT, R
cmp eax, 0
je wmcommand_ID6_error2
mov [hend_memory_bufer], eax
invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax
invoke load_mem_to_mem, [ip_memory_bufer], offset [shapka_wav1],\
40, COPY_BYTE + COPY_ONE

mov eax, [ip_memory_bufer]
mov ecx, R
sub ecx, 44
add ecx, 36
add eax, 4
mov dword ptr [eax], ecx
sub ecx, 36
add eax, 36
mov dword ptr [eax], ecx
add [ip_memory_bufer], 44
mov eax, R
sub eax, 44
shr eax, 2
mov R, eax
mov I, 0
invoke FpuAtoFL, ADDR string_one, ADDR float_K, DEST_MEM
invoke FpuDiv, addr float_K, addr float_G, addr float_Z,\
SRC1_REAL + SRC2_REAL + DEST_MEM
;float_Z - период частоты дискретизации
invoke FpuMul, addr float_I, 2, addr float_R,\
SRC1_REAL + SRC2_DIMM + DEST_MEM

invoke FpuMul, addr float_R, FPU_PI, addr float_G,\
SRC1_REAL + SRC2_CONST + DEST_MEM
;float_G=2*pi*f
invoke FpuAtoFL, addr amplituda_max, addr float_I, DEST_MEM
;float_I - амплитуда синуса

wmcommand_ID6job5:
mov eax, I
cmp R, eax
je wmcommand_ID6job4
invoke FpuMul, addr float_Z, I, addr float_R,\
SRC1_REAL + SRC2_DIMM + DEST_MEM

invoke FpuMul, addr float_R, addr float_G, addr float_J,\
SRC1_REAL + SRC2_REAL + DEST_MEM

invoke FpuSin, addr float_J, addr float_R, SRC1_REAL + ANG_RAD + DEST_MEM

invoke FpuMul, addr float_R, addr float_I, addr float_J,\
SRC1_REAL + SRC2_REAL + DEST_MEM
invoke FpuTrunc, addr float_J, addr J, SRC1_REAL + DEST_IMEM
mov eax, J
mov ecx, [ip_memory_bufer]
mov word ptr [ecx], ax
add ecx, 2
mov word ptr [ecx], ax
add [ip_memory_bufer], 4
inc I
jmp wmcommand_ID6job5
wmcommand_ID6job4:
invoke GlobalLock, [hend_memory_bufer]
mov [ip_memory_bufer], eax

invoke lstrcpy, offset [temp_char_bufer3], offset [rejim_text2]
invoke lstrcat, offset [temp_char_bufer3], offset [temp_char_bufer2]
invoke lstrcat, offset [temp_char_bufer3], offset [rejim_text2_1]
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [temp_char_bufer3]

invoke sndPlaySound, [ip_memory_bufer],\
SND_ASYNC + SND_LOOP + SND_MEMORY
cmp eax, FALSE
je error_1
ret
wmcommand_ID6_error1:
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
ret
wmcommand_ID6_error2:
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
invoke MessageBoxA, [hwnd], offset text_error2, 0,\
MB_ICONASTERISK
ret

wmcommand_ID7:
jmp wmcommand_ID3
ret
wmcommand_ID10:
jmp wmcommand_ID3
ret

wmcommand_ID3:
cmp ax, BN_CLICKED
je wmcommand_ID3job
ret
wmcommand_ID3job:
invoke sndPlaySound, 0, 0
invoke GlobalUnlock, [ip_memory_bufer]
invoke GlobalFree, [hend_memory_bufer]
mov [ip_memory_bufer], 0
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
ret

wmdestroy:

invoke GlobalLock, [hend_memory_device]
mov [ip_memory_device], eax
mov I, 0
wmdestroy1:
mov eax, counter_device
cmp I, eax
je wmdestroy2
mov ecx, [ip_memory_device]
mov eax, dword ptr [ecx]
invoke waveOutSetVolume, I, eax
add [ip_memory_device], 4
inc I
jmp wmdestroy1
wmdestroy2:

invoke GlobalUnlock, [ip_memory_device]
invoke GlobalFree, [hend_memory_device]

invoke sndPlaySound, 0, 0
; invoke UnlockResource, hRes1
invoke FreeResource, hRes1
; invoke UnlockResource, hRes2
invoke FreeResource, hRes2
invoke DestroyWindow, [hwndButton1]
invoke DestroyWindow, [hwndButton2]
invoke DestroyWindow, [hwndButton3]
invoke DestroyWindow, [hwndButton6]
invoke DestroyWindow, [hwndButton7]
invoke DestroyWindow, [hwndButton8]
invoke DestroyWindow, [hwndButton9]
invoke DestroyWindow, [hwndButton10]
invoke DestroyWindow, [hwndGroup1]
invoke DestroyWindow, [hwndGroup2]
invoke DestroyWindow, [hwndGroup3]
invoke DestroyWindow, [hwndGroup4]
invoke DestroyWindow, [hwndCombo1]
invoke DestroyWindow, [hwndCombo2]
invoke DestroyWindow, [hwndCombo3]
invoke DestroyWindow, [hwndCombo4]

invoke DestroyWindow, [hwndStatic1]
invoke DestroyWindow, [hwndStatic2]
invoke DestroyWindow, [hwndStatic3]

invoke CloseHandle, [hFont]
invoke CloseHandle, [hRes1]
invoke CloseHandle, [hRes2]

invoke DeleteObject, [hBitmapStrelkaUp]
invoke DeleteObject, [hBitmapStrelkaDown]
invoke PostQuitMessage, 0
mov eax, 0
ret

WndProc endp

load_string_to_list proc uses ebx edi esi,\
inputHend:DWORD
LOCAL short_string:DWORD

mov [short_string], 00000000h
add [short_string], 00000030h
load_string_to_list_1:
invoke SendMessage, [inputHend], LB_ADDSTRING, 0, addr [short_string]
inc [short_string]
cmp [short_string], 0000003Ah
jne load_string_to_list_1
ret
load_string_to_list endp

load_mem_to_mem proc uses ebx edi esi,\
IP_memory_input:DWORD, IP_memory_output:DWORD,\
number_zikl_copy:DWORD, flag_copy:DWORD

mov eax, IP_memory_input
mov ecx, IP_memory_output
xor edx, edx
load_mem_to_mem1:
cmp [number_zikl_copy], 0
je load_mem_to_mem_ret
mov edx, flag_copy
and edx, 00000003h
cmp dl, 1
jne load_mem_to_mem_word

xor edx, edx
mov dl, byte ptr [ecx]
mov byte ptr [eax], dl
mov edx, flag_copy
and edx, 12
cmp dl, 4
je load_mem_to_mem_byte_one
xor edx, edx
inc eax
mov dl, byte ptr [ecx]
mov byte ptr [eax], dl
load_mem_to_mem_byte_one:
inc eax
inc ecx
dec [number_zikl_copy]
jmp load_mem_to_mem1

load_mem_to_mem_word:
xor edx, edx
mov dx, word ptr [ecx]
mov word ptr [eax], dx
mov edx, flag_copy
and edx, 12
cmp dl, 4
je load_mem_to_mem_word_one
add eax, 2
mov dx, word ptr [ecx]
mov word ptr [eax], dx
load_mem_to_mem_word_one:
add eax, 2
add ecx, 2
dec [number_zikl_copy]
jmp load_mem_to_mem1

load_mem_to_mem_ret:
xor eax, eax
ret
load_mem_to_mem endp

SetBmpColor proc uses ebx edi esi,\
hBitmap_13:DWORD

LOCAL mDC_13 :DWORD
LOCAL hBrush_13 :DWORD
LOCAL hOldBmp_13 :DWORD
LOCAL hReturn_13 :DWORD
LOCAL hOldBrush_13 :DWORD

invoke CreateCompatibleDC,NULL
mov mDC_13,eax

invoke SelectObject,mDC_13,hBitmap_13
mov hOldBmp_13,eax

invoke GetSysColor,COLOR_BTNFACE
invoke CreateSolidBrush,eax
mov hBrush_13,eax

invoke SelectObject,mDC_13,hBrush_13
mov hOldBrush_13,eax

invoke GetPixel,mDC_13,1,1
invoke ExtFloodFill, mDC_13, 1, 1, eax, 1

invoke SelectObject, mDC_13, hOldBrush_13
invoke DeleteObject, hBrush_13

invoke SelectObject, mDC_13, hBitmap_13
mov hReturn_13,eax
invoke DeleteDC, mDC_13

mov eax, hReturn_13
ret
SetBmpColor endp

SetNogreyScreen proc uses ebx edi esi,\
Number_screen_14:DWORD, Flag_activ_14:DWORD

LOCAL Caption_copy:DWORD
mov Caption_copy, WS_DISABLED
not Caption_copy

cmp Flag_activ_14, 1
je SetNogreyScreen5
mov Flag_activ_14, WS_DISABLED
jmp SetNogreyScreen6
SetNogreyScreen5:
mov Flag_activ_14, 0
SetNogreyScreen6:
cmp Number_screen_14, 1
je SetNogreyScreen1
cmp Number_screen_14, 2
je SetNogreyScreen2
cmp Number_screen_14, 3
je SetNogreyScreen3
ret

SetNogreyScreen1:
invoke GetWindowLong, [hwndGroup1], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndGroup1], GWL_STYLE, eax
invoke GetWindowLong, [hwndButton1], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButton1], GWL_STYLE, eax
invoke GetWindowLong, [hwndButton2], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButton2], GWL_STYLE, eax
invoke GetWindowLong, [hwndButton3], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButton3], GWL_STYLE, eax
ret

SetNogreyScreen2:
invoke GetWindowLong, [hwndGroup3], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndGroup3], GWL_STYLE, eax
invoke GetWindowLong, [hwndButton8], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButton8], GWL_STYLE, eax
invoke GetWindowLong, [hwndButton9], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButton9], GWL_STYLE, eax
invoke GetWindowLong, [hwndButton10], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButton10], GWL_STYLE, eax
invoke GetWindowLong, [hwndStatic3], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndStatic3], GWL_STYLE, eax
ret

SetNogreyScreen3:
invoke GetWindowLong, [hwndGroup4], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndGroup4], GWL_STYLE, eax
invoke GetWindowLong, [hwndButton6], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButton6], GWL_STYLE, eax
invoke GetWindowLong, [hwndButton7], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButton7], GWL_STYLE, eax
invoke GetWindowLong, [hwndCombo1], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndCombo1], GWL_STYLE, eax
invoke GetWindowLong, [hwndCombo2], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndCombo2], GWL_STYLE, eax
invoke GetWindowLong, [hwndCombo3], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndCombo3], GWL_STYLE, eax
invoke GetWindowLong, [hwndCombo4], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndCombo4], GWL_STYLE, eax
invoke GetWindowLong, [hwndStatic1], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndStatic1], GWL_STYLE, eax
invoke GetWindowLong, [hwndStatic2], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndStatic2], GWL_STYLE, eax

invoke GetWindowLong, [hwndButtonList1_U], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButtonList1_U], GWL_STYLE, eax
invoke GetWindowLong, [hwndButtonList1_D], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButtonList1_D], GWL_STYLE, eax
invoke GetWindowLong, [hwndButtonList2_U], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButtonList2_U], GWL_STYLE, eax
invoke GetWindowLong, [hwndButtonList2_D], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButtonList2_D], GWL_STYLE, eax
invoke GetWindowLong, [hwndButtonList3_U], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButtonList3_U], GWL_STYLE, eax
invoke GetWindowLong, [hwndButtonList3_D], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButtonList3_D], GWL_STYLE, eax
invoke GetWindowLong, [hwndButtonList4_U], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButtonList4_U], GWL_STYLE, eax
invoke GetWindowLong, [hwndButtonList4_D], GWL_STYLE
and eax, Caption_copy
or eax, Flag_activ_14
invoke SetWindowLong, [hwndButtonList4_D], GWL_STYLE, eax
ret
SetNogreyScreen endp

MainSetVolume proc uses ebx edi esi,\
New_volume_15:DWORD

LOCAL I_temp_15:DWORD
LOCAL New_Volume_Stereo_15:DWORD

mov eax, New_volume_15
shl eax, 16
mov New_Volume_Stereo_15, eax
mov eax, New_volume_15
or New_Volume_Stereo_15, eax

mov I_temp_15, 0
MainSetVolume2:
mov eax, counter_device
cmp I_temp_15, eax
je MainSetVolume1
invoke waveOutSetVolume, I_temp_15, New_Volume_Stereo_15
inc I_temp_15
jmp MainSetVolume2
MainSetVolume1:
ret
MainSetVolume endp

ThreadTX_ASIN proc uses ebx edi esi, \
param_thr:DWORD
invoke sndPlaySound, param_thr,\
SND_SYNC + SND_MEMORY
cmp eax, FALSE
je ThreadTX_ASIN1
cmp glob_fl2, 1
je ThreadTX_ASIN1
invoke GetWindowLong, [hwndButton9], GWL_STYLE
mov ecx, WS_DISABLED
not ecx
and eax, ecx
invoke SetWindowLong, [hwndButton9], GWL_STYLE, eax
invoke SendMessage, [hwndStatus], SB_SETTEXT, 0, offset [rejim_text1]
invoke InvalidateRect, [hwndButton9], 0, 0
ret
ThreadTX_ASIN1:
mov glob_fl, FALSE
mov glob_fl2, 0
ret
ThreadTX_ASIN endp
end start




MAIN.INC

invert_bit proto :DWORD, :DWORD

set_bit proto :DWORD, :DWORD
;F(1,2) устанавливает в 1 бит в ячейке ОЗУ
; 1-порядковый номер бита, 2- смещение на ячейку DWORD
; eax= неопределен

clear_bit proto :DWORD, :DWORD
;F(1,2) устанавливает в 0 бит в ячейке ОЗУ
; 1-порядковый номер бита, 2- смещение на ячейку DWORD
; eax= неопределен

chek_bit proto :DWORD, :DWORD
;F(1,2) проверяет состояние бита в слове DWORD
; 1-порядковый номер бита, 2- данные DWORD
; eax= состояние бита (0 или 1)

set_for_mass proto :DWORD, :DWORD, :DWORD
;F(1,2,3) - устанавливает значение в массиве переменных типа DWORD
;1- смещение на начало массива переменнных,
;2 - порядковый номер ячейки массива
;3- новое значение ячейки массива
; eax= 0

get_for_mass proto :DWORD,:DWORD

setcheck_main proto :DWORD, :DWORD, :DWORD

PaintMainScreen proto :DWORD, :DWORD

IndikatorEYE proto :DWORD, :DWORD, :DWORD, :DWORD, :DWORD

set_main_menu proto :DWORD, :DWORD

PaintMainLampa proto :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD

CreateMainButtonBmp proto :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD

CreateMainButtonText proto :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, \
:DWORD, :DWORD, :DWORD

Set_tek_number_RS proto :DWORD, :DWORD

Main_SetWindowPos proto :DWORD, :DWORD, :DWORD

SetBmpColor proto :DWORD

simb_to_string proto :DWORD, :DWORD, :BYTE
;F(1,2,3) - записывает значение байта в массив байт
;1- смещение на начало массива, 2- смещение внутри массива
;3- новое значение элемента массива
;eax= 0

simb_for_string proto :DWORD, :DWORD
;F(1,2) - возвращает значение байта из массива байт
;1- смещение на начало массива, 2- смещение внутри массива
;al= значение байта в массиве байт


string_to_string proto :DWORD, :DWORD

zifra_to_string proto :DWORD, :DWORD, :DWORD
;F(1,2,3) - преобразует значение слова DWORD в строку,
; содержащую текстовое значение
; 1- смещение на строку, в которую будет выведен результат
; 2- слово DWORD, которое необходимо преобразовать
; 3- количество знаков (???)
; eax= 0


Do_Status proto :DWORD

shift_mass_r proto :DWORD, :DWORD

shift_mass_l proto :DWORD, :DWORD

form_slip_packed proto :DWORD, :DWORD
;F(1,2)- формирует SLIP пакет (байтстаффинг)
;1- указатель на DWORD, содержащее значение длины исходного пакета
;2- указатель на исходный пакет данных
; eax- неопределен

unform_slip_packed proto :DWORD, :DWORD

form_command0 proto :DWORD

form_command1 proto

form_command2 proto

form_command3 proto

form_command4 proto :DWORD, :DWORD, :DWORD

form_command5 proto

form_command6 proto

ReloadScreen proto :DWORD

ShowFreq proto :DWORD, :DWORD, :DWORD

setcheck_tumbler proto :DWORD, :DWORD, :DWORD

load_time_to_string proto

Create_mainWin proto :DWORD, :DWORD

calculate_crc proto :DWORD, :DWORD




RSRC.RC

#define ID_FILE1 3030
#define ID_FILE2 3031
#define MAIN_USER 3032

#define IDB_STRELKA_UP 3033
#define IDB_STRELKA_DOWN 3034


IDB_STRELKA_UP BITMAP "strelka_up.bmp"
IDB_STRELKA_DOWN BITMAP "strelka_down.bmp"

ID_ICON1 ICON "zvuk.ico"

ID_FILE1 MAIN_USER "12_24.dat"
ID_FILE2 MAIN_USER "24_48.dat"

MyMenu MENU
{
POPUP "&Файл"
{
MENUITEM "&Выход", 102
}
POPUP "&Сведения", HELP
{
MENUITEM "&Автор", 103
}
}





;*************************************************************************
;
; WIN32.INC - Win32 assembly language structures & constants
;
;
;*************************************************************************
;
; NOTE: this file only implements the structures and constants that
; wap32.asm uses. You may extend it for your own applications.
;
;*************************************************************************
;
;
; C/C++ Run Time Library - Version 6.0
;
; Copyright (c) 1985, 1993 by Borland International
; All Rights Reserved.
;

UCHAR EQU
USHORT EQU ; used only if we really need 16 bits
UINT EQU
; 32 bits for WIN32
ULONG EQU


;*******************************************************************
;
; Rectangle
;
;*******************************************************************

RECT struc
rcLeft UINT ?
rcTop UINT ?
rcRight UINT ?
rcBottom UINT ?
RECT ends

;*******************************************************************
;
; Main_for_com
;
;*******************************************************************
GENERIC_READ equ 80000000h
GENERIC_WRITE equ 40000000h
GENERIC_EXECUTE equ 20000000h
GENERIC_ALL equ 10000000h

INVALID_HANDLE_VALUE equ -1

CREATE_NEW equ 1
CREATE_ALWAYS equ 2
OPEN_EXISTING equ 3
OPEN_ALWAYS equ 4
TRUNCATE_EXISTING equ 5
PIPE_ACCESS_INBOUND equ 1h
PIPE_ACCESS_OUTBOUND equ 2h
PIPE_ACCESS_DUPLEX equ 3h
PIPE_CLIENT_END equ 0h
PIPE_SERVER_END equ 1h
PIPE_WAIT equ 0h
PIPE_NOWAIT equ 1h
PIPE_READMODE_BYTE equ 0h
PIPE_READMODE_MESSAGE equ 2h
PIPE_TYPE_BYTE equ 0h
PIPE_TYPE_MESSAGE equ 4h
PIPE_UNLIMITED_INSTANCES equ 255

EV_RXCHAR equ 1h
EV_RXFLAG equ 2h
EV_TXEMPTY equ 4h
EV_CTS equ 8h
EV_DSR equ 10h
EV_RLSD equ 20h
EV_BREAK equ 40h
EV_ERR equ 80h
EV_RING equ 100h
EV_PERR equ 200h
EV_RX80FULL equ 400h
EV_EVENT1 equ 800h
EV_EVENT2 equ 1000h

GMEM_FIXED equ 0h
GMEM_MOVEABLE equ 2h
GMEM_NOCOMPACT equ 10h
GMEM_NODISCARD equ 20h
GMEM_ZEROINIT equ 40h
GMEM_MODIFY equ 80h
GMEM_DISCARDABLE equ 100h
GMEM_NOT_BANKED equ 1000h
GMEM_SHARE equ 2000h
GMEM_DDESHARE equ 2000h
GMEM_NOTIFY equ 4000h
GMEM_LOWER equ GMEM_NOT_BANKED
GMEM_VALID_FLAGS equ 7F72h
GMEM_INVALID_HANDLE equ 8000h
GMEM_DISCARDED equ 4000h
GMEM_LOCKCOUNT equ 0FFh

FILE_BEGIN equ 0
FILE_CURRENT equ 1
FILE_END equ 2
FILE_FLAG_WRITE_THROUGH equ 80000000h
FILE_FLAG_OVERLAPPED equ 40000000h
FILE_FLAG_NO_BUFFERING equ 20000000h
FILE_FLAG_RANDOM_ACCESS equ 10000000h
FILE_FLAG_SEQUENTIAL_SCAN equ 8000000h
FILE_FLAG_DELETE_ON_CLOSE equ 4000000h
FILE_FLAG_BACKUP_SEMANTICS equ 2000000h
FILE_FLAG_POSIX_SEMANTICS equ 1000000h

LB_CTLCODE equ 0
LB_OKAY equ 0
LB_ERR equ -1
LB_ERRSPACE equ -2
LBN_ERRSPACE equ -2
LBN_SELCHANGE equ 1
LBN_DBLCLK equ 2
LBN_SELCANCEL equ 3
LBN_SETFOCUS equ 4
LBN_KILLFOCUS equ 5
LB_ADDSTRING equ 180h
LB_INSERTSTRING equ 181h
LB_DELETESTRING equ 182h
LB_SELITEMRANGEEX equ 183h
LB_RESETCONTENT equ 184h
LB_SETSEL equ 185h
LB_SETCURSEL equ 186h
LB_GETSEL equ 187h
LB_GETCURSEL equ 188h
LB_GETTEXT equ 189h
LB_GETTEXTLEN equ 18Ah
LB_GETCOUNT equ 18Bh
LB_SELECTSTRING equ 18Ch
LB_DIR equ 18Dh
LB_GETTOPINDEX equ 18Eh
LB_FINDSTRING equ 18Fh
LB_GETSELCOUNT equ 190h
LB_GETSELITEMS equ 191h
LB_SETTABSTOPS equ 192h
LB_GETHORIZONTALEXTENT equ 193h
LB_SETHORIZONTALEXTENT equ 194h
LB_SETCOLUMNWIDTH equ 195h
LB_ADDFILE equ 196h
LB_SETTOPINDEX equ 197h
LB_GETITEMRECT equ 198h
LB_GETITEMDATA equ 199h
LB_SETITEMDATA equ 19Ah
LB_SELITEMRANGE equ 19Bh
LB_SETANCHORINDEX equ 19Ch
LB_GETANCHORINDEX equ 19Dh
LB_SETCARETINDEX equ 19Eh
LB_GETCARETINDEX equ 19Fh
LB_SETITEMHEIGHT equ 1A0h
LB_GETITEMHEIGHT equ 1A1h
LB_FINDSTRINGEXACT equ 1A2h
LB_SETLOCALE equ 1A5h
LB_GETLOCALE equ 1A6h
LB_SETCOUNT equ 1A7h
LB_MSGMAX equ 1A8h


COMMTIMEOUTS STRUCT
ReadIntervalTimeout DWORD ?
ReadTotalTimeoutMultiplier DWORD ?
ReadTotalTimeoutConstant DWORD ?
WriteTotalTimeoutMultiplier DWORD ?
WriteTotalTimeoutConstant DWORD ?
COMMTIMEOUTS ENDS

BITRECORD RECORD fBinary:1,fParity:1,fOutxCtsFlow:1,fOutxDsrFlow:1,fDtrControl:2,\
fDsrSensitivity:1,fTXContinueOnXoff:1,fOutX:1,fInX:1,fErrorChar:1,\
fNull:1,fRtsControl:2,fAbortOnError:1,fDummy2:17

DCB STRUCT
DCBlength DWORD ?
BaudRate DWORD ?
fbits BITRECORD <>
wReserved WORD ?
XonLim WORD ?
XoffLim WORD ?
ByteSize BYTE ?
Parity BYTE ?
StopBits BYTE ?
XonChar BYTE ?
XoffChar BYTE ?
ErrorChar BYTE ?
EofChar BYTE ?
EvtChar BYTE ?
wReserved1 WORD ?
DCB ENDS

COMMCONFIG STRUCT
dwSize DWORD ?
wVersion WORD ?
wReserved WORD ?
dcbx DCB <>
dwProviderSubType DWORD ?
dwProviderOffset DWORD ?
dwProviderSize DWORD ?
wcProviderData WORD ?
COMMCONFIG ENDS

OPENFILENAMEA STRUCT
lStructSize DWORD ?
hwndOwner DWORD ?
hInstance DWORD ?
lpstrFilter DWORD ?
lpstrCustomFilter DWORD ?
nMaxCustFilter DWORD ?
nFilterIndex DWORD ?
lpstrFile DWORD ?
nMaxFile DWORD ?
lpstrFileTitle DWORD ?
nMaxFileTitle DWORD ?
lpstrInitialDir DWORD ?
lpstrTitle DWORD ?
Flags DWORD ?
nFileOffset WORD ?
nFileExtension WORD ?
lpstrDefExt DWORD ?
lCustData DWORD ?
lpfnHook DWORD ?
lpTemplateName DWORD ?
OPENFILENAMEA ENDS

OPENFILENAME equ
;++++++++++++++++++++++++++++++++++++++++++++++++
; main
;++++++++++++++++++++++++++++++++++++++++++++++++

BITMAP struct
bmType dd ?
bmWidth dd ?
bmHeight dd ?
bmWidthBytes dd ?
bmPlanes dw ?
bmBitsPixel dw ?
bmBits dd ?
BITMAP ends

POINT struct
mouse_x dd ?
mouse_y dd ?
POINT ends

SYSTEMTIME struct
wYear dw ?
wMonth dw ?
wDayOfWeek dw ?
wDay dw ?
wHour dw ?
wMinute dw ?
wSecond dw ?
wMilliseconds dw ?
SYSTEMTIME ends

TRUE equ 1
FALSE equ 0
NULL equ 0

OUT_DEFAULT_PRECIS equ 0
OUT_STRING_PRECIS equ 1
OUT_CHARACTER_PRECIS equ 2
OUT_STROKE_PRECIS equ 3
OUT_TT_PRECIS equ 4
OUT_DEVICE_PRECIS equ 5
OUT_RASTER_PRECIS equ 6
OUT_TT_ONLY_PRECIS equ 7
OUT_OUTLINE_PRECIS equ 8


CBR_110 equ 110
CBR_300 equ 300
CBR_600 equ 600
CBR_1200 equ 1200
CBR_2400 equ 2400
CBR_4800 equ 4800
CBR_9600 equ 9600
CBR_14400 equ 14400
CBR_19200 equ 19200
CBR_38400 equ 38400
CBR_56000 equ 56000
CBR_57600 equ 57600
CBR_115200 equ 115200
CBR_128000 equ 128000
CBR_256000 equ 256000

DATABITS_5 equ 1h
DATABITS_6 equ 2h
DATABITS_7 equ 4h
DATABITS_8 equ 8h
DATABITS_16 equ 10h
DATABITS_16X equ 20h
STOPBITS_10 equ 1h
STOPBITS_15 equ 2h
STOPBITS_20 equ 4h
PARITY_NONE equ 100h
PARITY_ODD equ 200h
PARITY_EVEN equ 400h
PARITY_MARK equ 800h
PARITY_SPACE equ 1000
Опубликовал Kest February 07 2009 22:31:41 · 0 Комментариев · 7292 Прочтений · Для печати

• Не нашли ответ на свой вопрос? Тогда задайте вопрос в комментариях или на форуме! •


Комментарии
Нет комментариев.
Добавить комментарий
Имя:



smiley smiley smiley smiley smiley smiley smiley smiley smiley
Запретить смайлики в комментариях

Введите проверочный код:* =
Рейтинги
Рейтинг доступен только для пользователей.

Пожалуйста, залогиньтесь или зарегистрируйтесь для голосования.

Нет данных для оценки.
Гость
Имя

Пароль



Вы не зарегистрированны?
Нажмите здесь для регистрации.

Забыли пароль?
Запросите новый здесь.
Поделиться ссылкой
Фолловь меня в Твиттере! • Смотрите канал о путешествияхКак приготовить мидии в тайланде?
Загрузки
Новые загрузки
iChat v.7.0 Final...
iComm v.6.1 - выв...
Visual Studio 200...
CodeGear RAD Stud...
Шаблон для новост...

Случайные загрузки
Игра Car [Исходни...
UmEdit
Измерение тактово...
PHP 5 в подлинник...
Архив Апгрейтов с...
Библия хакера 2. ...
Delphi 7: Для про...
Технология .Net в VB
Zoom [Исходник на...
Трассировка прово...
База Allsubmitter...
ShadelLabel
Delphi Быстрый Ст...
Последнее загруж...
Пятнашки и крести...
Правила программи...
AVIwriter
Базы данных в Инт...
Пример работы с р...
Упорядоченный дин...

Топ загрузок
Приложение Клие... 100341
Delphi 7 Enterp... 80539
Converter AMR<-... 20029
Borland C++Buil... 10871
GPSS World Stud... 9964
Borland Delphi ... 7898
Turbo Pascal fo... 6925
Visual Studio 2... 4931
Калькулятор [Ис... 4178
FreeSMS v1.3.1 3492
Случайные статьи
Программа генераци...
Что максимизирует ...
Подготовка файла A...
Ключи
Форма кучи
Наиболее элементар...
Введение в FPDF
Формирование разли...
Что происходит при...
Вход в Windows Mes...
Волоконно-оптическ...
О кликабельной инф...
Использование прот...
4.3. Дополнительна...
Web Proxy
( windowsupdate
10.5. Принципы
Планирование разве...
Занятие 3
Пример кода програ...
Глава 15. Страт...
Пишем скрипт госте...
Ожидавшиеся распре...
Алгоритм Leaky Bucket
Отчет по доходам н...
Статистика



Друзья сайта
Программы, игры


Полезно
В какую объединенную сеть входит классовая сеть? Суммирование маршрутов Занимают ли таблицы память маршрутизатора?