diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 6db1228..cbffe87 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,56 +1,72 @@ { - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version":"2.0.0", - "tasks":[ + "version": "2.0.0", + "tasks": [ { - "label":"assemble", - "type":"shell", - "args":[ + "label": "assemble", + "type": "shell", + "command": "ml64.exe", + "args": [ "/I", "include", "/c", "src/${fileBasenameNoExtension}.asm" - ], - "command":"ml64.exe", - "problemMatcher":{ - "owner":"nasm", - "fileLocation":["relative","${workspaceFolder}"], - "pattern":{ - "regexp":"^(.*)\\((\\d*)\\)\\s+:?\\s+(error|warning)\\s+([A-z]+\\d+):\\s+(.*)$", - "file":1, - "line":2, - "severity":3, - "code":4, - "message":5, - "loop":true + "problemMatcher": { + "owner": "masm", + "fileLocation": [ + "relative", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*)\\((\\d*)\\)\\s+:?\\s+(error|warning)\\s+([A-Z]+\\d+):\\s+(.*)$", + "file": 1, + "line": 2, + "severity": 3, + "code": 4, + "message": 5 } } + }, + { + "label": "compile-resources", + "type": "shell", + "command": "rc.exe", + "args": [ + "res/rsrc.rc" + ], + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + }, + "dependsOn": [ + "assemble"] }, { - "label":"link", - "type":"shell", - "args":[ + "label": "link", + "type": "shell", + "command": "link.exe", + "args": [ "/SUBSYSTEM:WINDOWS", "/MACHINE:X64", "/ENTRY:entry_point", "/nologo", "/LARGEADDRESSAWARE", - "${fileBasenameNoExtension}.obj" - ], - "command":"link.exe", - "dependsOn":"assemble" + "${fileBasenameNoExtension}.obj", + "res/rsrc.res" + ], + "dependsOn": [ + "compile-resources", + "assemble" + ] }, { - "label":"execute", - "type":"shell", - "command":"${workspaceFolder}/${fileBasenameNoExtension}.exe", - "group":{ - "kind":"build", - "isDefault":true - }, - "dependsOn":"link" + "label": "execute", + "type": "shell", + "command": "${workspaceFolder}/${fileBasenameNoExtension}.exe", + "group": "build", + "dependsOn": "link", + "problemMatcher": [] } ] } diff --git a/Mandelbrot.exe b/Mandelbrot.exe deleted file mode 100644 index cb6d7d6..0000000 Binary files a/Mandelbrot.exe and /dev/null differ diff --git a/Puer.exe b/Puer.exe new file mode 100644 index 0000000..483f65d Binary files /dev/null and b/Puer.exe differ diff --git a/include/template.inc b/include/template.inc index 46f9179..81a4b5f 100644 --- a/include/template.inc +++ b/include/template.inc @@ -10,7 +10,7 @@ myDraw proto nSegment:DWORD ;принимаю параметр с колличе .data? hInstance HINSTANCE ? ; Хэндл нашей пpогpаммы CommandLine LPSTR ? - +hIcon dq ? ; icon handle NOTIFYICONDATAW STRUCT cbSize DWORD ? @@ -78,3 +78,4 @@ IDM_RESTORE equ 1000 IDM_EXIT equ 1010 +IDI_ICON equ 1020 \ No newline at end of file diff --git a/res/dlgs.rc b/res/dlgs.rc new file mode 100644 index 0000000..57eae4d --- /dev/null +++ b/res/dlgs.rc @@ -0,0 +1,8 @@ + +#define IDI_ICON 1020 + +IDI_ICON ICON "icon.ico" + + + + diff --git a/res/icon.ico b/res/icon.ico new file mode 100644 index 0000000..5e7f929 Binary files /dev/null and b/res/icon.ico differ diff --git a/res/manifest.xml b/res/manifest.xml new file mode 100644 index 0000000..df66cd7 --- /dev/null +++ b/res/manifest.xml @@ -0,0 +1,20 @@ + + +Your application description here. + + + + + \ No newline at end of file diff --git a/res/rsrc.rc b/res/rsrc.rc new file mode 100644 index 0000000..054f192 --- /dev/null +++ b/res/rsrc.rc @@ -0,0 +1,40 @@ +// ************************************************************************************************* + +#include "\masm64\include64\resource.h" + +// ************************************************************************************************* + +1 24 "manifest.xml" // manifest file + +#include "dlgs.rc" + +// ************************************************************************************************* + +VS_VERSION_INFO VERSIONINFO +FILEVERSION 1, 0, 0, 0 +PRODUCTVERSION 1, 0, 0, 0 +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +BEGIN + BLOCK "StringFileInfo" +BEGIN + BLOCK "041904B0" + BEGIN + VALUE "CompanyName", "Friends of Svetopaper\000" + VALUE "FileDescription", "Pu'er tea executable file\000" + VALUE "FileVersion", "1.0\000" + VALUE "InternalName", "Pu'er tea\000" + VALUE "OriginalFilename", "Puer.exe\000" + VALUE "LegalCopyright", "\251 2025 Friends of Svetopaper\000" + VALUE "ProductName", "Pu'er tea\000" + VALUE "ProductVersion", "1.0\000" + END +END + +BLOCK "VarFileInfo" +BEGIN + VALUE "Translation", 0x419, 0x4B0 +END +END + +// ************************************************************************************************* diff --git a/res/rsrc.res b/res/rsrc.res new file mode 100644 index 0000000..bad3ced Binary files /dev/null and b/res/rsrc.res differ diff --git a/src/Mandelbrot.asm b/src/Puer.asm similarity index 98% rename from src/Mandelbrot.asm rename to src/Puer.asm index 5417aa5..f4802fd 100644 --- a/src/Mandelbrot.asm +++ b/src/Puer.asm @@ -3,6 +3,7 @@ include template.inc entry_point proc invoke GetModuleHandle, NULL ; Взять хэндл пpогpаммы mov hInstance,rax ; Под Win32, hmodule==hinstance mov hInstance,eax + invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT ; вызвать основную функцию invoke ExitProcess, rax ; Выйти из пpогpаммы. ; Возвpащаемое значение, помещаемое в eax, беpется из WinMain'а. @@ -15,7 +16,7 @@ WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:QWORD ;регистрация оконного класса push hInstance pop wc.hInstance - invoke LoadIcon,NULL,IDI_APPLICATION + invoke LoadIcon,wc.hInstance,IDI_ICON mov wc.hIcon,rax mov wc.hIconSm,rax invoke LoadCursor,NULL,IDC_ARROW