{"id":333904,"date":"2022-06-01T09:00:43","date_gmt":"2022-06-01T09:00:43","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=333904"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=333904","title":{"rendered":"<span>16-\u0431\u0438\u0442\u043d\u0430\u044f \u041e\u0421 \u043d\u0430 fasm + C\u0438. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u0438 \u043d\u0435 \u043c\u0430\u043d\u0443\u0430\u043b\u043e\u043c, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0438\u043c\u0438 \u0437\u0430\u043c\u0435\u0442\u043a\u0430\u043c\u0438. \u0418\u0434\u0435\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0437\u043d\u0430\u043d\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043e\u043d\u0430 \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f =)<\/p>\n<h3>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u041e\u0417\u0423 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u0442\u0430\u0440\u0442\u0430 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435(\u0438\u043b\u0438 \u0437\u0430\u043c\u044b\u043a\u0430\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u043d\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u043d\u043a\u0435) BIOS \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0435\u043a\u0442\u043e\u0440 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430(512 \u0431\u0430\u0439\u0442), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439, \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 7C00h (h &#8212; hex) \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u0435\u0436\u0438\u0442 \u0432 \u044d\u0442\u0438\u0445 512 \u0431\u0430\u0439\u0442\u0430\u0445. \u041e\u0442 \u0441\u044e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u0438\u0438 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 512 \u0431\u0430\u0439\u0442.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0438\u043c\u0435\u043d\u0443\u0435\u043c\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u043c) \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430 &#8212; \u044d\u0442\u043e \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430 55h \u0438 AAh, \u043f\u043e \u044d\u0442\u0438\u043c \u0434\u0432\u0443\u043c \u0431\u0430\u0439\u0442\u0430\u043c BIOS \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u043c. \u0412 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u043b\u0438\u0431\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u043b\u0438\u0431\u043e \u0441\u0440\u0430\u0437\u0443 \u044f\u0434\u0440\u0430 \u041e\u0421, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0440\u0430\u0437\u0443 \u044f\u0434\u0440\u0430 \u041e\u0421.<\/p>\n<p>\u042f\u0434\u0440\u043e \u041e\u0421 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0500h, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 7E00h, \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u0441\u0442\u0435\u043a\u0430 7DFFh.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3f8\/195\/19e\/3f819519e759e4ad0fa45db84a878393.png\" width=\"910\" height=\"365\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3f8\/195\/19e\/3f819519e759e4ad0fa45db84a878393.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042f\u0434\u0440\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 3 \u0441\u0435\u043a\u0442\u043e\u0440\u0435 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c 4 \u0441\u0435\u043a\u0442\u043e\u0440\u0430(4 *512) \u0438\u043b\u0438 2 Kb.\u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u044b\u0445 \u0441 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 13h \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f 42h.<br \/>\u0423 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0438\u0434\u0435\u0442 DAPS \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0443\u0434\u0430, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438 \u043e\u0442 \u043a\u0443\u0434\u0430 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0435\u043a\u0442\u043e\u0440\u0430.<\/p>\n<h2>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 DAPS<\/h2>\n<ul>\n<li>\n<p>1 \u0431\u0430\u0439\u0442 &#8212; \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430(\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 16 \u0431\u0430\u0439\u0442)<\/p>\n<\/li>\n<li>\n<p>1 \u0431\u0430\u0439\u0442 &#8212; \u0432\u0441\u0435\u0433\u0434\u0430 0, \u0440\u0435\u0437\u0435\u0440\u0432<\/p>\n<\/li>\n<li>\n<p>1 \u0431\u0430\u0439\u0442 &#8212; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432(\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 4(\u0440\u0430\u0437\u043c\u0435\u0440 \u044f\u0434\u0440\u0430))<\/p>\n<\/li>\n<li>\n<p>1 \u0431\u0430\u0439\u0442 &#8212; \u0432\u0441\u0435\u0433\u0434\u0430 0, \u0440\u0435\u0437\u0435\u0440\u0432<\/p>\n<\/li>\n<li>\n<p>2 \u0431\u0430\u0439\u0442\u0430 &#8212; \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/li>\n<li>\n<p>2 \u0431\u0430\u0439\u0442\u0430 &#8212; \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0443 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/li>\n<li>\n<p>8 \u0431\u0430\u0439\u0442 &#8212; \u043d\u043e\u043c\u0435\u0440 \u0441\u0435\u043a\u0442\u043e\u0440\u0430 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 <\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">#define u_int16 unsigned short int #define u_char8 unsigned char #define u_long_int unsigned long int #define u_long_int64 unsigned long long int struct daps {     u_char8 p_size = 16;     u_char8 p_empty = 0;     u_char8 p_n_setors;     u_char8 p_empty2 = 0;     u_int16 p_adres;     u_int16 p_segment;     u_long_int64 sector;     file data_file; };<\/code><\/pre>\n<p>\u041d\u0430 <strong>file data_file<\/strong> \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u044d\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0424\u0421 (\u0444\u0430\u0439\u043b\u043e\u0432\u0430\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435).<\/p>\n<h2>\u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a<\/h2>\n<p>\u041a\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430<\/p>\n<pre><code class=\"assembly\"> use16 org 7c00h cli             ;\u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f         xor ax,ax       ;\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u0445         mov ds,ax       ;\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0430\u0434\u0440\u0435\u0441         mov es,ax       ;\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442 es \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0430\u0434\u0440\u0435\u0441         mov ss,ax       ;\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0441\u0442\u0435\u043a\u0430 \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0430\u0434\u0440\u0435\u0441         mov sp,07DFFh   ;\u0441\u0435\u0433\u043c\u0435\u043d\u0442 sp \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0441\u0442\u0435\u043a\u0430 sti         ;\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f  push cs pop ds mov si,paket mov ah,42h int 13h jmp 0000:0500h  jmp $ paket:;DAPS         db 16;const paksize         db 0;null         db 4;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432         db 0;null         dw 0500h;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435         dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442         dq 2;\u043d\u0430\u0447\u0430\u043b\u043e times(512-2-($-07C00h)) db 0 db 055h,0AAh ;16 \u0431\u0430\u0439\u0442 1 \u0441\u0435\u0433\u043c\u0435\u043d\u0442<\/code><\/pre>\n<h2>\u042f\u0434\u0440\u043e \u041e\u0421<\/h2>\n<p>\u041d\u0430\u0448\u0435 \u044f\u0434\u0440\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0434\u0438\u0441\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 BIOS \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <strong>DL<\/strong>, \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>BOOT_DISK<\/strong>(\u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0438\u0441\u043a\u0443, \u0444\u0430\u0439\u043b\u0430\u043c \u0438 \u0442\u0434) \u0438 \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u043d\u0430 \u043c\u0435\u0442\u043a\u0443 <strong>START_K<\/strong>. \u0422\u043e \u0447\u0442\u043e \u0438\u0434\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 <strong>START_K<\/strong> \u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 <strong>90h<\/strong>(\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 API \u041e\u0421) \u0438 <strong>91h<\/strong>(\u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u041e\u0421).<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430, \u043d\u0430 \u0432\u0445\u043e\u0434 <strong>\u043d\u043e\u043c\u0435\u0440 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/strong> \u0438 <strong>\u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430<\/strong>.<\/p>\n<pre><code class=\"assembly\">macro SET_INTERRUPT_HANDLER NUM, HANDLER {     pusha     xor ax,ax     push ax     pop es     mov al,NUM     mov bl,4h     mul bl     mov bx,ax     mov si,HANDLER     mov [es:bx],si     add bx,2     push cs     pop ax     mov [es:bx], ax     popa }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432 \u043d\u0430\u0448\u0435\u0439 \u041e\u0421 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u043a\u0442\u043e\u0440\u0435 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 DAPS.<\/p>\n<p>DAPS \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0444\u0430\u0439\u043b\u043e\u0432<\/p>\n<pre><code class=\"assembly\">DAPS_TABEL_FILES:     db 16;const paksize     db 0;null     db 1;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432     db 0;null     dw TABLE_FILES;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435     dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442     dq 1;\u043d\u0430\u0447\u0430\u043b\u043e<\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>\u043c\u0430\u043a\u0440\u043e\u0441\u0430<\/strong> \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>17h<\/strong> \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f <strong>90h<\/strong>(\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e \u044f\u0434\u0440\u043e)<\/p>\n<pre><code class=\"assembly\">macro LOAD_DAPS DAPS {     push cs     pop ds     mov si, DAPS     mov ah, 17h     int 90h }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f 17h \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f 90h(\u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 13h)<\/p>\n<pre><code class=\"assembly\">cmp ah,17h;-|-in - ds:si - daps je HF_LOAD_DAPS  iret  HF_LOAD_DAPS:     call F_LOAD_DAPS iret ;-|-in - ds:si - daps ; |-out - (load file table on ram) F_LOAD_DAPS: mov dl,[BOOT_DISK];\u0432\u043e\u0442 \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0430\u0448\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0434\u0438\u0441\u043a\u0430 mov ah,42h int 13h ret<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u043f\u0435\u0447\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 <strong>PRINT<\/strong>.<\/p>\n<pre><code class=\"assembly\">macro PRINT STR,COLOR {     mov ah,2     push cs     pop ds     mov di,STR     mov bl,COLOR     int 90h }<\/code><\/pre>\n<p>\u041e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <strong>2<\/strong> \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f <strong>90h<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>F_PRINT<\/strong>.<\/p>\n<pre><code class=\"assembly\">;--------------------\u041f\u0435\u0447\u0430\u0442\u044c \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0421\u0442\u0440\u043e\u043a\u0438------------------------- F_PRINTSF:;ds:di-str,bl-color     call F_GET_CURSOR xor cx,cx mov cl,[ds:di] inc di MAIN_START_F_PRINTSF: call F_READ_VIDEO mov ah,013h push ds pop es mov bp,di mov al,1 int 10h ret ;--------------------\u041f\u0435\u0447\u0430\u0442\u044c \u0421\u0442\u0440\u043e\u043a\u0438------------------------- F_PRINT:;ds:di-str,bl-color push di push ds call F_GET_CURSOR call F_GET_LEN_STR pop ds pop di call MAIN_START_F_PRINTSF ret ;-------------------\u0427\u0442\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e \u0440\u0435\u0436\u0438\u043c\u0430------------------------------------------------------ F_READ_VIDEO:;out al=video ah=\u0447\u0438\u0441\u043b\u043e \u043a\u043e\u043b\u043e\u043d\u043e\u043a bh= \u043d\u043e\u043c\u0435\u0440 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0438\u0441\u043f\u043b\u0435\u044f     mov ah,0fh     int 10h ret ;------------\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430; \u0412\u044b\u0445\u043e\u0434: dh,dl - string,char ch,cl=\u043d\u0430\u0447.\u0438 \u043a\u043e\u043d\u0447\u0435\u0447 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 ---------------------------------------------------- F_GET_CURSOR:;out= dh,dl - string,char ch,cl=\u043d\u0430\u0447.\u0438 \u043a\u043e\u043d\u0447\u0435\u0447 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430     call F_READ_VIDEO     mov ah,03h     int 10h ret ;-------------------\u0424\u0443\u0435\u043a\u0446\u0438\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438.------------------------------------------------------------------------------  ;-|-in - ds:di=str, cx=len ; |-out - cx=len F_GET_LEN_STR: xor cx,cx START_F_GET_LEN_STR: mov al,[ds:di] cmp al,0 je EXIT_F_GET_LET_STR inc di inc cx jmp START_F_GET_LEN_STR EXIT_F_GET_LET_STR: ret<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <strong>cmd<\/strong> \u0438 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 <strong>SEACH_FILE<\/strong> \u0438 <strong>LOAD_DAPS<\/strong>.<\/p>\n<pre><code class=\"assembly\">macro SEACH_FILE TABLE_FILES, FILENAME {     push cs     pop ds     mov bx,TABLE_FILES     mov di, FILENAME     mov ah,10h     int 90h }<\/code><\/pre>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <strong>10h<\/strong> \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f <strong>90h<\/strong>.<\/p>\n<pre><code class=\"assembly\">;-------------------\u041f\u043e\u0438\u0441\u043a \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0430\u0439\u043b\u0430------------------------------------------------------------------------------------------  ;-|-in - ds:bx=tableFiles, ds:di=flename ; |-out - ch-dorogka cl=sector, al=numSectors ah = type ; |-except - not found - ax=0, cx=0 F_SEACH_FILE: jmp startpfseachFile pfseachFilecxsave: db 0 pfseachFilebxsave: db 0,0 pfseachFiledisave: db 0,0 startpfseachFile: xor cx,cx mov cl,32 add bx,4 mov [pfseachFiledisave],di startSeach: mov [pfseachFilecxsave],cl mov [pfseachFilebxsave],bx mov di,[pfseachFiledisave] mov si,[pfseachFilebxsave] call F_CMP_STRING cmp al,0 je pgetDataForstartFile mov cl,[pfseachFilecxsave] mov bx,[pfseachFilebxsave] add bx,16 loop startSeach xor bx,bx xor cx,cx xor ax,ax jmp exitpfseachFile pgetDataForstartFile: mov bx,[pfseachFilebxsave] mov di,bx dec di mov cl,[ds:di] dec di mov ch,[ds:di] mov al,ch dec di mov ch,[ds:di] dec di mov ah,[ds:di] exitpfseachFile: ret<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0430\u0439\u043b\u0430 <strong>cmd<\/strong>.<\/p>\n<pre><code class=\"assembly\"> START_PROGRAMM:     mov si, DAPS_RUNTIME_FILE     mov [si + 2], al     mov [si + 8], cl     LOAD_DAPS DAPS_RUNTIME_FILE     ;LOAD_FILE ch, cl, al, 0000, 0500h     NEW_LINE jmp 0000:7E00h<\/code><\/pre>\n<p><strong>DAPS<\/strong> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<pre><code class=\"assembly\">DAPS_RUNTIME_FILE:     db 16;const paksize     db 0;null     db 1;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432     db 0;null     dw 7E00h;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435     dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442     dq 7;\u043d\u0430\u0447\u0430\u043b\u043e<\/code><\/pre>\n<h2>\u041a\u043e\u0434 \u042f\u0434\u0440\u0430<\/h2>\n<pre><code class=\"assembly\">org 0500h GLOBAL: mov [BOOT_DISK],dl jmp START_K ;-----------------------------------------------------------     include 'INCLUDES\\MACROS.INC'     include 'INCLUDES\\BASE_FUNCTIONS.INC'     include 'INCLUDES\\INTERRUPT_HANDLER_RETURN.INC'     include 'INCLUDES\\MAIN_INTERRUPT_HANDLER.INC'     include 'INCLUDES\\KEYBOARD.INC'     include 'INCLUDES\\CONST.INC' ;----------------------------------------------------------- START_K: SET_INTERRUPT_HANDLER 90H,MAIN_INTERRUPT_HANDLER SET_INTERRUPT_HANDLER 91H,INTERRUPT_HANDLER_RETURN LOAD_DAPS DAPS_TABEL_FILES PRINT HELLO_WORLD, BLACK MAIN: ;NEW_LINE ;PRINT INPUT_STR, BLACK ;GET_STRING BUFFER, 13 SEACH_FILE TABLE_FILES, CMD cmp ax,0 je PRINT_ERROR   cmp ah,1 je START_PROGRAMM jmp MAIN  START_PROGRAMM:     mov si, DAPS_RUNTIME_FILE     mov [si + 2], al     mov [si + 8], cl     LOAD_DAPS DAPS_RUNTIME_FILE     ;LOAD_FILE ch, cl, al, 0000, 0500h     NEW_LINE jmp 0000:7E00h  PRINT_ERROR:     NEW_LINE     PRINT ERROR, RED jmp MAIN   RETURN_INT:     jmp MAIN ;\u0441\u044e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 int 91h jmp $ DAPS_RUNTIME_FILE:     db 16;const paksize     db 0;null     db 1;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432     db 0;null     dw 7E00h;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435     dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442     dq 7;\u043d\u0430\u0447\u0430\u043b\u043e DAPS_TABEL_FILES:     db 16;const paksize     db 0;null     db 1;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432     db 0;null     dw TABLE_FILES;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435     dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442     dq 1;\u043d\u0430\u0447\u0430\u043b\u043e HELLO_WORLD: string \"WaaOS Loaded, Hello! =)\" ERROR: string \"Command not found :(\" CMD: string \"cmd\" INPUT_STR: string \"user:>\" BOOT_DISK: db 0 BUFFER: db 13 dup(0) TMP: db 255 dup(0) TABLE_FILES: CALC_SIZE SIZE_KERNEL, GLOBAL<\/code><\/pre>\n<h2>\u041a\u043e\u0434 CMD<\/h2>\n<pre><code class=\"cpp\">#include \"BASE_LIB.H\" void clear_str_file_name(u_char8 *str, u_char8 len){     for(u_int16 i = 0; i &lt; len; i++){         str[i] = 0;     } } void main(void) {     u_char8 user[] = \"user:>\";     u_char8 not_found[] = \"Command not found :(\";     while (true)     {         print(new_line, Black);         print(user, White);         f_string user_guffer = input();         for(u_char8 i =0 ; i &lt; 254; i++){             if(user_guffer.data[i] == ' '){                 user_guffer.data[i] = 0;             }         }         u_char8 file_name[13];         clear_str_file_name(file_name, 13);         for(u_char8 i = 0; i &lt; 13; i++){             if(user_guffer.data[i] == 0) break;             if(user_guffer.data[i] == ' ') break;             file_name[i] = user_guffer.data[i];         }         if(file_name[0] != ' ' &amp;&amp; file_name[0] != 0){             daps daps_file = get_r_daps_file(file_name, (u_int16) 0x07E00);             print(new_line, Black);             if(daps_file.p_empty != 1){                 start_programm(&amp;daps_file, user_guffer.data);             } else {                 print(not_found, Red);             }         }     } }<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u0439\u043e \u041e\u0421, \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0421\u0418 \u0438 \u0434\u043e\u043f. \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f <strong>90h<\/strong>, \u0441\u0434\u0435\u043b\u044e \u0432\u0442\u043e\u0440\u0443\u044e, \u0442\u0440\u0435\u0442\u044c\u044e \u0438 \u0442\u0434 \u0447\u0430\u0441\u0442\u0438. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<p><a href=\"https:\/\/github.com\/aovzerk\/WaaOS\/\" rel=\"noopener noreferrer nofollow\">\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u041e\u0421<\/a><\/p>\n<p>\u0410\u0432\u0442\u043e\u0440\u044b: <a href=\"https:\/\/habr.com\/ru\/users\/lllzebralll\/\" rel=\"noopener noreferrer nofollow\">@lllzebralll\u00a0<\/a><a href=\"https:\/\/habr.com\/ru\/users\/aovzerk\/\" rel=\"noopener noreferrer nofollow\">@aovzerk<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/668926\/\"> https:\/\/habr.com\/ru\/post\/668926\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u0438 \u043d\u0435 \u043c\u0430\u043d\u0443\u0430\u043b\u043e\u043c, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0438\u043c\u0438 \u0437\u0430\u043c\u0435\u0442\u043a\u0430\u043c\u0438. \u0418\u0434\u0435\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0437\u043d\u0430\u043d\u0438\u0439 \u0432 \u043e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043e\u043d\u0430 \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f =)<\/p>\n<h3>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u041e\u0417\u0423 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441\u0442\u0430\u0440\u0442\u0430 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435(\u0438\u043b\u0438 \u0437\u0430\u043c\u044b\u043a\u0430\u0435\u0442\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u043d\u0430 \u043c\u0430\u0442\u0435\u0440\u0438\u043d\u043a\u0435) BIOS \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0435\u043a\u0442\u043e\u0440 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430(512 \u0431\u0430\u0439\u0442), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u043a\u0430\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439, \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 7C00h (h &#8212; hex) \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u0435\u0436\u0438\u0442 \u0432 \u044d\u0442\u0438\u0445 512 \u0431\u0430\u0439\u0442\u0430\u0445. \u041e\u0442 \u0441\u044e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u0438\u0438 \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 512 \u0431\u0430\u0439\u0442.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0446\u0435 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0438\u043c\u0435\u043d\u0443\u0435\u043c\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u043c) \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430 &#8212; \u044d\u0442\u043e \u0434\u0432\u0430 \u0431\u0430\u0439\u0442\u0430 55h \u0438 AAh, \u043f\u043e \u044d\u0442\u0438\u043c \u0434\u0432\u0443\u043c \u0431\u0430\u0439\u0442\u0430\u043c BIOS \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u043e\u043c. \u0412 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u043b\u0438\u0431\u043e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u043b\u0438\u0431\u043e \u0441\u0440\u0430\u0437\u0443 \u044f\u0434\u0440\u0430 \u041e\u0421, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0440\u0430\u0437\u0443 \u044f\u0434\u0440\u0430 \u041e\u0421.<\/p>\n<p>\u042f\u0434\u0440\u043e \u041e\u0421 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0500h, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 7E00h, \u0432\u0435\u0440\u0448\u0438\u043d\u0430 \u0441\u0442\u0435\u043a\u0430 7DFFh.<\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042f\u0434\u0440\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 3 \u0441\u0435\u043a\u0442\u043e\u0440\u0435 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c 4 \u0441\u0435\u043a\u0442\u043e\u0440\u0430(4 *512) \u0438\u043b\u0438 2 Kb.\u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u044b\u0445 \u0441 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435 13h \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f 42h.<br \/>\u0423 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0438\u0434\u0435\u0442 DAPS \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u043a\u0443\u0434\u0430, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438 \u043e\u0442 \u043a\u0443\u0434\u0430 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0435\u043a\u0442\u043e\u0440\u0430.<\/p>\n<h2>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 DAPS<\/h2>\n<ul>\n<li>\n<p>1 \u0431\u0430\u0439\u0442 &#8212; \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430(\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 16 \u0431\u0430\u0439\u0442)<\/p>\n<\/li>\n<li>\n<p>1 \u0431\u0430\u0439\u0442 &#8212; \u0432\u0441\u0435\u0433\u0434\u0430 0, \u0440\u0435\u0437\u0435\u0440\u0432<\/p>\n<\/li>\n<li>\n<p>1 \u0431\u0430\u0439\u0442 &#8212; \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432(\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 4(\u0440\u0430\u0437\u043c\u0435\u0440 \u044f\u0434\u0440\u0430))<\/p>\n<\/li>\n<li>\n<p>1 \u0431\u0430\u0439\u0442 &#8212; \u0432\u0441\u0435\u0433\u0434\u0430 0, \u0440\u0435\u0437\u0435\u0440\u0432<\/p>\n<\/li>\n<li>\n<p>2 \u0431\u0430\u0439\u0442\u0430 &#8212; \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/li>\n<li>\n<p>2 \u0431\u0430\u0439\u0442\u0430 &#8212; \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0443 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435<\/p>\n<\/li>\n<li>\n<p>8 \u0431\u0430\u0439\u0442 &#8212; \u043d\u043e\u043c\u0435\u0440 \u0441\u0435\u043a\u0442\u043e\u0440\u0430 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 <\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"cpp\">#define u_int16 unsigned short int #define u_char8 unsigned char #define u_long_int unsigned long int #define u_long_int64 unsigned long long int struct daps {     u_char8 p_size = 16;     u_char8 p_empty = 0;     u_char8 p_n_setors;     u_char8 p_empty2 = 0;     u_int16 p_adres;     u_int16 p_segment;     u_long_int64 sector;     file data_file; };<\/code><\/pre>\n<p>\u041d\u0430 <strong>file data_file<\/strong> \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u044d\u0442\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0424\u0421 (\u0444\u0430\u0439\u043b\u043e\u0432\u0430\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435).<\/p>\n<h2>\u0417\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a<\/h2>\n<p>\u041a\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430<\/p>\n<pre><code class=\"assembly\"> use16 org 7c00h cli             ;\u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f         xor ax,ax       ;\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u0445         mov ds,ax       ;\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0430\u0434\u0440\u0435\u0441         mov es,ax       ;\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442 es \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0430\u0434\u0440\u0435\u0441         mov ss,ax       ;\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u0441\u0442\u0435\u043a\u0430 \u043d\u0430 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0430\u0434\u0440\u0435\u0441         mov sp,07DFFh   ;\u0441\u0435\u0433\u043c\u0435\u043d\u0442 sp \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0441\u0442\u0435\u043a\u0430 sti         ;\u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f  push cs pop ds mov si,paket mov ah,42h int 13h jmp 0000:0500h  jmp $ paket:;DAPS         db 16;const paksize         db 0;null         db 4;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432         db 0;null         dw 0500h;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435         dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442         dq 2;\u043d\u0430\u0447\u0430\u043b\u043e times(512-2-($-07C00h)) db 0 db 055h,0AAh ;16 \u0431\u0430\u0439\u0442 1 \u0441\u0435\u0433\u043c\u0435\u043d\u0442<\/code><\/pre>\n<h2>\u042f\u0434\u0440\u043e \u041e\u0421<\/h2>\n<p>\u041d\u0430\u0448\u0435 \u044f\u0434\u0440\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0434\u0438\u0441\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 BIOS \u043f\u043e\u043b\u043e\u0436\u0438\u043b \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <strong>DL<\/strong>, \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>BOOT_DISK<\/strong>(\u043e\u043d\u0430 \u043d\u0443\u0436\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0438\u0441\u043a\u0443, \u0444\u0430\u0439\u043b\u0430\u043c \u0438 \u0442\u0434) \u0438 \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u043d\u0430 \u043c\u0435\u0442\u043a\u0443 <strong>START_K<\/strong>. \u0422\u043e \u0447\u0442\u043e \u0438\u0434\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 <strong>START_K<\/strong> \u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 <strong>90h<\/strong>(\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 API \u041e\u0421) \u0438 <strong>91h<\/strong>(\u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u041e\u0421).<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430, \u043d\u0430 \u0432\u0445\u043e\u0434 <strong>\u043d\u043e\u043c\u0435\u0440 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f<\/strong> \u0438 <strong>\u0430\u0434\u0440\u0435\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430<\/strong>.<\/p>\n<pre><code class=\"assembly\">macro SET_INTERRUPT_HANDLER NUM, HANDLER {     pusha     xor ax,ax     push ax     pop es     mov al,NUM     mov bl,4h     mul bl     mov bx,ax     mov si,HANDLER     mov [es:bx],si     add bx,2     push cs     pop ax     mov [es:bx], ax     popa }<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0444\u0430\u0439\u043b\u043e\u0432, \u0432 \u043d\u0430\u0448\u0435\u0439 \u041e\u0421 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u043a\u0442\u043e\u0440\u0435 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430. \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 DAPS.<\/p>\n<p>DAPS \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0444\u0430\u0439\u043b\u043e\u0432<\/p>\n<pre><code class=\"assembly\">DAPS_TABEL_FILES:     db 16;const paksize     db 0;null     db 1;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432     db 0;null     dw TABLE_FILES;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435     dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442     dq 1;\u043d\u0430\u0447\u0430\u043b\u043e<\/code><\/pre>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>\u043c\u0430\u043a\u0440\u043e\u0441\u0430<\/strong> \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>17h<\/strong> \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f <strong>90h<\/strong>(\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e \u044f\u0434\u0440\u043e)<\/p>\n<pre><code class=\"assembly\">macro LOAD_DAPS DAPS {     push cs     pop ds     mov si, DAPS     mov ah, 17h     int 90h }<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f 17h \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f 90h(\u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 13h)<\/p>\n<pre><code class=\"assembly\">cmp ah,17h;-|-in - ds:si - daps je HF_LOAD_DAPS  iret  HF_LOAD_DAPS:     call F_LOAD_DAPS iret ;-|-in - ds:si - daps ; |-out - (load file table on ram) F_LOAD_DAPS: mov dl,[BOOT_DISK];\u0432\u043e\u0442 \u0438 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043d\u0430\u0448\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0441 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0434\u0438\u0441\u043a\u0430 mov ah,42h int 13h ret<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u043f\u0435\u0447\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 <strong>PRINT<\/strong>.<\/p>\n<pre><code class=\"assembly\">macro PRINT STR,COLOR {     mov ah,2     push cs     pop ds     mov di,STR     mov bl,COLOR     int 90h }<\/code><\/pre>\n<p>\u041e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <strong>2<\/strong> \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f <strong>90h<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>F_PRINT<\/strong>.<\/p>\n<pre><code class=\"assembly\">;--------------------\u041f\u0435\u0447\u0430\u0442\u044c \u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0421\u0442\u0440\u043e\u043a\u0438------------------------- F_PRINTSF:;ds:di-str,bl-color     call F_GET_CURSOR xor cx,cx mov cl,[ds:di] inc di MAIN_START_F_PRINTSF: call F_READ_VIDEO mov ah,013h push ds pop es mov bp,di mov al,1 int 10h ret ;--------------------\u041f\u0435\u0447\u0430\u0442\u044c \u0421\u0442\u0440\u043e\u043a\u0438------------------------- F_PRINT:;ds:di-str,bl-color push di push ds call F_GET_CURSOR call F_GET_LEN_STR pop ds pop di call MAIN_START_F_PRINTSF ret ;-------------------\u0427\u0442\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0435\u043e \u0440\u0435\u0436\u0438\u043c\u0430------------------------------------------------------ F_READ_VIDEO:;out al=video ah=\u0447\u0438\u0441\u043b\u043e \u043a\u043e\u043b\u043e\u043d\u043e\u043a bh= \u043d\u043e\u043c\u0435\u0440 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0438\u0441\u043f\u043b\u0435\u044f     mov ah,0fh     int 10h ret ;------------\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430; \u0412\u044b\u0445\u043e\u0434: dh,dl - string,char ch,cl=\u043d\u0430\u0447.\u0438 \u043a\u043e\u043d\u0447\u0435\u0447 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 ---------------------------------------------------- F_GET_CURSOR:;out= dh,dl - string,char ch,cl=\u043d\u0430\u0447.\u0438 \u043a\u043e\u043d\u0447\u0435\u0447 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u0443\u0440\u0441\u043e\u0440\u0430     call F_READ_VIDEO     mov ah,03h     int 10h ret ;-------------------\u0424\u0443\u0435\u043a\u0446\u0438\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u0434\u043b\u0438\u043d\u044b \u0441\u0442\u0440\u043e\u043a\u0438.------------------------------------------------------------------------------  ;-|-in - ds:di=str, cx=len ; |-out - cx=len F_GET_LEN_STR: xor cx,cx START_F_GET_LEN_STR: mov al,[ds:di] cmp al,0 je EXIT_F_GET_LET_STR inc di inc cx jmp START_F_GET_LEN_STR EXIT_F_GET_LET_STR: ret<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <strong>cmd<\/strong> \u0438 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 <strong>SEACH_FILE<\/strong> \u0438 <strong>LOAD_DAPS<\/strong>.<\/p>\n<pre><code class=\"assembly\">macro SEACH_FILE TABLE_FILES, FILENAME {     push cs     pop ds     mov bx,TABLE_FILES     mov di, FILENAME     mov ah,10h     int 90h }<\/code><\/pre>\n<p>\u041c\u0430\u043a\u0440\u043e\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <strong>10h<\/strong> \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f <strong>90h<\/strong>.<\/p>\n<pre><code class=\"assembly\">;-------------------\u041f\u043e\u0438\u0441\u043a \u0430\u0434\u0440\u0435\u0441\u0430 \u0444\u0430\u0439\u043b\u0430------------------------------------------------------------------------------------------  ;-|-in - ds:bx=tableFiles, ds:di=flename ; |-out - ch-dorogka cl=sector, al=numSectors ah = type ; |-except - not found - ax=0, cx=0 F_SEACH_FILE: jmp startpfseachFile pfseachFilecxsave: db 0 pfseachFilebxsave: db 0,0 pfseachFiledisave: db 0,0 startpfseachFile: xor cx,cx mov cl,32 add bx,4 mov [pfseachFiledisave],di startSeach: mov [pfseachFilecxsave],cl mov [pfseachFilebxsave],bx mov di,[pfseachFiledisave] mov si,[pfseachFilebxsave] call F_CMP_STRING cmp al,0 je pgetDataForstartFile mov cl,[pfseachFilecxsave] mov bx,[pfseachFilebxsave] add bx,16 loop startSeach xor bx,bx xor cx,cx xor ax,ax jmp exitpfseachFile pgetDataForstartFile: mov bx,[pfseachFilebxsave] mov di,bx dec di mov cl,[ds:di] dec di mov ch,[ds:di] mov al,ch dec di mov ch,[ds:di] dec di mov ah,[ds:di] exitpfseachFile: ret<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a \u0444\u0430\u0439\u043b\u0430 <strong>cmd<\/strong>.<\/p>\n<pre><code class=\"assembly\"> START_PROGRAMM:     mov si, DAPS_RUNTIME_FILE     mov [si + 2], al     mov [si + 8], cl     LOAD_DAPS DAPS_RUNTIME_FILE     ;LOAD_FILE ch, cl, al, 0000, 0500h     NEW_LINE jmp 0000:7E00h<\/code><\/pre>\n<p><strong>DAPS<\/strong> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<pre><code class=\"assembly\">DAPS_RUNTIME_FILE:     db 16;const paksize     db 0;null     db 1;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432     db 0;null     dw 7E00h;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435     dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442     dq 7;\u043d\u0430\u0447\u0430\u043b\u043e<\/code><\/pre>\n<h2>\u041a\u043e\u0434 \u042f\u0434\u0440\u0430<\/h2>\n<pre><code class=\"assembly\">org 0500h GLOBAL: mov [BOOT_DISK],dl jmp START_K ;-----------------------------------------------------------     include 'INCLUDES\\MACROS.INC'     include 'INCLUDES\\BASE_FUNCTIONS.INC'     include 'INCLUDES\\INTERRUPT_HANDLER_RETURN.INC'     include 'INCLUDES\\MAIN_INTERRUPT_HANDLER.INC'     include 'INCLUDES\\KEYBOARD.INC'     include 'INCLUDES\\CONST.INC' ;----------------------------------------------------------- START_K: SET_INTERRUPT_HANDLER 90H,MAIN_INTERRUPT_HANDLER SET_INTERRUPT_HANDLER 91H,INTERRUPT_HANDLER_RETURN LOAD_DAPS DAPS_TABEL_FILES PRINT HELLO_WORLD, BLACK MAIN: ;NEW_LINE ;PRINT INPUT_STR, BLACK ;GET_STRING BUFFER, 13 SEACH_FILE TABLE_FILES, CMD cmp ax,0 je PRINT_ERROR   cmp ah,1 je START_PROGRAMM jmp MAIN  START_PROGRAMM:     mov si, DAPS_RUNTIME_FILE     mov [si + 2], al     mov [si + 8], cl     LOAD_DAPS DAPS_RUNTIME_FILE     ;LOAD_FILE ch, cl, al, 0000, 0500h     NEW_LINE jmp 0000:7E00h  PRINT_ERROR:     NEW_LINE     PRINT ERROR, RED jmp MAIN   RETURN_INT:     jmp MAIN ;\u0441\u044e\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 int 91h jmp $ DAPS_RUNTIME_FILE:     db 16;const paksize     db 0;null     db 1;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432     db 0;null     dw 7E00h;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435     dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442     dq 7;\u043d\u0430\u0447\u0430\u043b\u043e DAPS_TABEL_FILES:     db 16;const paksize     db 0;null     db 1;\u043a\u043e\u043b-\u0432\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432     db 0;null     dw TABLE_FILES;\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435     dw 0;\u0441\u0435\u0433\u043c\u0435\u043d\u0442     dq 1;\u043d\u0430\u0447\u0430\u043b\u043e HELLO_WORLD: string \"WaaOS Loaded, Hello! =)\" ERROR: string \"Command not found :(\" CMD: string \"cmd\" INPUT_STR: string \"user:>\" BOOT_DISK: db 0 BUFFER: db 13 dup(0) TMP: db 255 dup(0) TABLE_FILES: CALC_SIZE SIZE_KERNEL, GLOBAL<\/code><\/pre>\n<h2>\u041a\u043e\u0434 CMD<\/h2>\n<pre><code class=\"cpp\">#include \"BASE_LIB.H\" void clear_str_file_name(u_char8 *str, u_char8 len){     for(u_int16 i = 0; i &lt; len; i++){         str[i] = 0;     } } void main(void) {     u_char8 user[] = \"user:>\";     u_char8 not_found[] = \"Command not found :(\";     while (true)     {         print(new_line, Black);         print(user, White);         f_string user_guffer = input();         for(u_char8 i =0 ; i &lt; 254; i++){             if(user_guffer.data[i] == ' '){                 user_guffer.data[i] = 0;             }         }         u_char8 file_name[13];         clear_str_file_name(file_name, 13);         for(u_char8 i = 0; i &lt; 13; i++){             if(user_guffer.data[i] == 0) break;             if(user_guffer.data[i] == ' ') break;             file_name[i] = user_guffer.data[i];         }         if(file_name[0] != ' ' &amp;&amp; file_name[0] != 0){             daps daps_file = get_r_daps_file(file_name, (u_int16) 0x07E00);             print(new_line, Black);             if(daps_file.p_empty != 1){                 start_programm(&amp;daps_file,<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-333904","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/333904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=333904"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/333904\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=333904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=333904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=333904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}