{"id":476091,"date":"2026-04-15T20:06:13","date_gmt":"2026-04-15T20:06:13","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=476091"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=476091","title":{"rendered":"\u0414\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f Go: CPU, RAM \u0438 \u0447\u0442\u043e \u0442\u0430\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. Go Assembler \u0431\u0430\u0437\u0430. \u0427\u0430\u0441\u0442\u044c 1.1"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Go-\u043a\u043e\u0434 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.<\/p>\n<p>\u041b\u044e\u0431\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 Go \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 CPU.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c:<\/p>\n<p>1) \u041a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Go<\/p>\n<p>2) \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 Go assembler<\/p>\n<p>3) \u0418 \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440<\/p>\n<p>\u0414\u0443\u043c\u0430\u044e \u0441 <a href=\"https:\/\/habr.com\/ru\/articles\/1023762\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u0437\u043e\u0440\u043e\u043c \u0438 \u043e\u0431\u0449\u0438\u043c\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438<\/a> \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430 \u2013 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 CPU \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0435 GO-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e CPU \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Go, \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438 \u043a\u0430\u043a \u0441\u043e\u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0441 \u043a\u043e\u0434\u043e\u043c Go. \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u041d\u0415 \u0433\u0430\u0439\u0434 \u043f\u043e Go Assembler, \u0430 \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Go End 2 End. \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0434\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0438\u0441\u0442\u0438\u043d\u044b<\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0441\u0430\u043c CPU \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u044f(reorder) \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u043a\u044d\u0448\u0435\u0439<\/p>\n<\/li>\n<li>\n<p>\u0410\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0411\u0430\u0440\u044c\u0435\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a \u0447\u0442\u043e CPU \u2013 \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Go-\u043a\u043e\u0434\u0430<\/p>\n<p><em>Reminder<\/em><\/p>\n<p>\u0427\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u201c\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0435\u0439\u201d?<\/p>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u044c \u0442\u043e Go, JS, Java\u2026 \u0415\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u0430 \u043d\u0430 \u0435\u0433\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0430 \u043b\u0438\u0448\u044c \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c, \u0447\u0442\u043e CPU \u0443\u043c\u0435\u0435\u0442 \u043b\u0438\u0448\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c<\/p>\n<ul>\n<li>\n<p>load\/store<\/p>\n<\/li>\n<li>\n<p>\u0410\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435\/\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>branch\/jump\/call\/return<\/p>\n<\/li>\n<li>\n<p>\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>fence\/barrier-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b, \u0435\u0441\u043b\u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e syscall\/runtime<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443<\/p>\n<p><strong>\u0412\u0432\u043e\u0434\u043d\u0430\u044f<\/strong><\/p>\n<p>\u041f\u043e\u043a\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430<\/p>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u044f\u0447\u0435\u0435\u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445,<\/p>\n<p>\u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430<\/p>\n<p>\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0437\u0430 \u043e\u0434\u0438\u043d \u0442\u0430\u043a\u0442.<\/p>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e, \u0432\u0441\u0451 \u0447\u0435\u043c \u043c\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 ASM \u2013 \u044d\u0442\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0438 \u0438\u0445 \u0431\u0430\u0439\u0442\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u0435\u043c<\/p>\n<p>Go<\/p>\n<pre><code class=\"go\">x := 1x += 1y = x<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>ASM<\/p>\n<pre><code class=\"assembly\">mov rax, 1         ; \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXadd rax, 1         ; \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 AXmov [rip + y], rax ; \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 AX \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e y<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u0441\u0432\u043e\u0435\u043c <a href=\"http:\/\/main.go\" rel=\"noopener noreferrer nofollow\">main.go<\/a> \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:  <\/p>\n<pre><code class=\"bash\">go tool compile -S main.go<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041b\u0438\u0431\u043e \u0447\u0442\u043e-\u0442\u043e \u0432 \u0434\u0443\u0445\u0435<\/p>\n<pre><code class=\"bash\">go build -gcflags=\"-N -l\" -o app main.gogo tool objdump -s \"main.main\" .\/app<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0423\u0447\u0442\u0438\u0442\u0435, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 Go Assembly<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u0432\u043e\u0442 <a href=\"http:\/\/www.ccfit.nsu.ru\/~kireev\/lab2\/lab2com.htm\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a>(\u041d\u0435 \u043f\u0443\u0433\u0430\u0439\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0442\u0430\u043c http) \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f x86. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u041d\u0413\u0423. \u0410 \u0442\u0430\u043a\u0436\u0435 <a href=\"https:\/\/go.dev\/doc\/asm\" rel=\"noopener noreferrer nofollow\">\u0441\u0435\u0440\u0438\u044f \u0433\u0430\u0439\u0434\u043e\u0432 \u043f\u043e Go Assembler<\/a>\u00a0<\/p>\n<p><em>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f Go Assembler!<\/em><\/p>\n<p><strong>Go Assembler<\/strong><\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0430\u043a\u0442 \u043f\u0440\u043e Go \u2013 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0439 \u201c\u0441\u043b\u0435\u043d\u0433\u201d Assembly, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Go Assembler<\/p>\n<p>\u0412 \u0447\u0435\u043c \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f?<\/p>\n<p>\u042d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e Go \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b (GAS\/Intel), \u0430 \u0432\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0430\u0434 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438. \u0412\u043e\u0442 \u044d\u0442\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437:<\/p>\n<p>1) \u041f\u0441\u0435\u0432\u0434\u043e\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b<\/p>\n<p>\u0412 Go ASM \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 <abbr class=\"habraabbr\" title=\"Instructions Set Architecture\" data-title=\"&lt;p&gt;Instructions Set Architecture&lt;\/p&gt;\" data-abbr=\"ISA \">ISA <\/abbr>\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430<\/p>\n<p>Go assembler \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0434\u043b\u044f:<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 ABI(Application Binary Interface)<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0431\u043e\u0442\u044b \u043b\u0438\u043d\u043a\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 stack maps \u0434\u043b\u044f GC<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435 \u2013 \u0432\u043e\u0442 \u043e\u043d\u0438<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">\u041f\u0441\u0435\u0432\u0434\u043e\u0440\u0435\u0433\u0438\u0441\u0442\u0440<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">SB<\/p>\n<\/td>\n<td>\n<p align=\"left\">symbol base. global\/static symbols, \u0442\u0443\u0434\u0430 \u0438\u0434\u0443\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">SP<\/p>\n<\/td>\n<td>\n<p align=\"left\">stack pointer. \u041f\u0441\u0435\u0432\u0434\u043e\u0440\u0435\u0433\u0438\u0441\u0442\u0440, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e stack frame<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">FP<\/p>\n<\/td>\n<td>\n<p align=\"left\">frame pointer. \u041f\u0441\u0435\u0432\u0434\u043e\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438) <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">PC<\/p>\n<\/td>\n<td>\n<p align=\"left\">program counter. \u0410\u0434\u0440\u0435\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0410 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 CPU-\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b:<\/p>\n<p>AX BX CX DX SI DI BP R8\u2013R15<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c<\/p>\n<pre><code class=\"assembly\">MOVQ AX, main.y(SB)   ; GoASMmov [rip+offset], rax ; x86 ASM<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>2) \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438<\/p>\n<p>\u0412 Go assembler \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u044b:<\/p>\n<p>name(SB)<\/p>\n<p>x-8(SP)<\/p>\n<p>arg+0(FP)<\/p>\n<pre><code class=\"assembly\">MOVQ arg+0(FP), AX ; \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>3) \u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/p>\n<pre><code class=\"assembly\">TEXT main.main(SB), ABIInternal, $0-8<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c<\/p>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f main.main<\/p>\n<p>ABI<\/p>\n<p>stack frame size<\/p>\n<p>4) \u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f runtime<\/p>\n<p>Go assembler \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 <strong>\u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a CPU<\/strong>, \u043d\u043e \u043d\u0443\u0436\u043d\u044b runtime.<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>FUNCDATA<\/p>\n<p>PCDATA<\/p>\n<p>5) \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 ABI<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 ABIInternal, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 ABI Go<\/p>\n<p>6) \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 SB) \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432<\/p>\n<p><strong>\u0410 \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 Go Assembler?<\/strong><\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0431\u0449\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043f\u0440\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 GC, \u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u044d\u0442\u043e \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b.<\/p>\n<p>\u0423 Go \u0435\u0441\u0442\u044c runtime \u2014 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 goroutine, \u0441\u0442\u0435\u043a\u043e\u043c, GC \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u043c\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b. \u0427\u0430\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b Go Assembler \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b, \u0442\u043e runtime \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0435\u0451 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 (x86, ARM, RISC-V \u0438 \u0442.\u0434.). \u042d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u043e \u0431\u044b \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043d\u043e\u0432\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c.<\/p>\n<p>Go Assembler \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0432\u0432\u043e\u0434\u044f \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0438 \u043b\u0438\u043d\u043a\u0435\u0440. \u0412 \u043d\u0451\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 SB, SP, FP, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b runtime (TEXT, FUNCDATA, PCDATA).<\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 runtime \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e Go (stack frame, \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 GC), \u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 asm-\u0444\u0430\u0439\u043b\u0430\u0445 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c.<\/p>\n<p><strong>Go Load-n-Store<\/strong><\/p>\n<p>\u0415\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u2013 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.\u00a0<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432 ASM \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435:<br \/>1) \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432. \u041e \u043d\u0438\u0445 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0442\u043e \u0435\u0441\u0442\u044c &#171;\u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b&#187;<\/p>\n<p>2) \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c\u0438 \u0438 \u043f\u0430\u043c\u044f\u0442\u044c\u044e<\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434<\/p>\n<pre><code class=\"go\">x := 1y = x<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u043e:<\/p>\n<pre><code class=\"assembly\">MOVQ $1, AX        ; \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXMOVQ AX, main.y(SB); \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 AX \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e y<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 (-N -l), \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u0438\u0436\u0435 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<pre><code class=\"assembly\">MOVQ $1, main.x-8(SP) ; \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e xMOVQ main.x-8(SP), AX ; load: \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 x \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXMOVQ AX, main.y(SB)   ; store: \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 AX \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u044d\u0442\u043e \u0447\u0438\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441:<\/p>\n<p>MOVQ \u2013 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c load\/store?<\/p>\n<p>MOVQ \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0411\u0443\u043a\u0432\u0430 Q \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 quadword (8 \u0431\u0430\u0439\u0442) \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 B(1), W(2), L(4)<\/p>\n<p><em>\u0420\u0435\u043c\u0430\u0440\u043a\u0430<\/em><\/p>\n<p>\u041d\u0430 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445 (amd64) \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f MOVQ \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 8-\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430 \u043e\u0434\u043d\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e.<\/p>\n<p>\u041d\u0430 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445 (386) \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 64-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 MOVL \u043f\u043e 4 \u0431\u0430\u0439\u0442\u0430.<\/p>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440. \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u0448\u043b\u043e \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e<\/p>\n<p>\u0421\u0430\u043c\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f MOV \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>immediate -&gt; register<\/p>\n<p>register -&gt; register<\/p>\n<p>register -&gt; memory<\/p>\n<p>memory -&gt; register<\/p>\n<p>Load \u0438 Store \u2013 \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442:<\/p>\n<p>load = \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440<\/p>\n<p>store = \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c<\/p>\n<p>\u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0441 \u0441\u0430\u043c\u043e\u043c Go Load \u0438 Store \u0442\u0440\u0430\u043a\u0442\u0443\u044e\u0442\u0441\u044f \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e CPU, \u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/p>\n<p>\u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0430 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u0438\u0448\u0435\u043c, \u0441\u043a\u0430\u0436\u0435\u043c, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430 16 \u0431\u0430\u0439\u0442, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0442\u043e\u043b\u044c\u043a\u043e 8(MOVQ)?<\/p>\n<pre><code class=\"go\">type Point struct {x inty int}func main() {p1 := Point{1, 2}p2 := p1}\/\/ int = 8 bytes\/\/ Point = 16 bytes<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>p1 := p2<\/p>\n<p>\u042d\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b!<\/p>\n<p>p2.x = p1.x<\/p>\n<p>p2.y = p1.y<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u043b\u044f. \u0418 \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439 MOVQ \u043c\u044b \u043d\u0435 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0447\u0442\u043e-\u0442\u043e \u0432 \u0434\u0443\u0445\u0435<\/p>\n<pre><code class=\"assembly\">MOVQ main.p1(SP), AX   ; load \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AX p1.xMOVQ AX, main.p2(SP)   ; store \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0438\u0437 AX p1.x(\u0437\u0430\u043f\u0438\u0441\u044c \u0432 p2.x)MOVQ main.p1+8(SP), AX ; load \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AX p1.y(\u043e\u0442\u0441\u0442\u0443\u043f \u043a\u0430\u043a \u0440\u0430\u0437 8 \u0431\u0430\u0439\u0442, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440)MOVQ AX, main.p2+8(SP) ; store \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 p2.y \u0438\u0437 AX(\u0442\u0430\u043a\u0436\u0435 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043e\u0442\u0441\u0442\u0443\u043f\u0430)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c 4 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438<\/p>\n<p>\u0418 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u2013 \u043a\u0430\u043a \u0441\u0435\u0431\u044f \u0432\u0435\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c\/\u0447\u0442\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439<\/p>\n<p>\u0417\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c: \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0432 Go \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 ASM \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044e<\/p>\n<p>Go:<\/p>\n<pre><code class=\"go\">x := 10p := &amp;xp2 := p*p = 20<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>ASM:<\/p>\n<pre><code class=\"assembly\">LEAQ main.x(SP), AX  ; Load Effective Address x \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXMOVQ AX, main.p(SP)  ; store \u0438\u0437 AX \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e p \u0432 \u043f\u0430\u043c\u044f\u0442\u0438MOVQ main.p(SP), AX  ; load p \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXMOVQ AX, main.p2(SP) ; store \u0438\u0437 AX \u0432 p2MOVQ main.p(SP), AX  ; load \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f p \u0432 AXMOVQ $20, (AX)       ; \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 20 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 p<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, \u0441 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438<\/p>\n<p><strong>Go \u0432 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443(\u0438 \u043b\u043e\u0433\u0438\u043a\u0443)<\/strong><\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0432\u0435\u043b\u0438\u043a\u0430\u044f \u043c\u0438\u0441\u0441\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0436\u0435\u043b\u0435\u0437\u0430 \u2013 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0435 \u0437\u0440\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u2013 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u0431\u043e\u0440 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f <abbr class=\"habraabbr\" title=\"Instructions Set Architecture\" data-title=\"&lt;p&gt;Instructions Set Architecture&lt;\/p&gt;&lt;p&gt;&lt;\/p&gt;\" data-abbr=\"ISA \">ISA <\/abbr>\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041d\u043e Go Assembler \u0438\u043c\u0435\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u043e-\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u0438 x86<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443(\u043f\u0440\u0438\u043c\u0435\u043c \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043d\u0430\u0448\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 x \u0438 y \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438)<\/p>\n<p><strong>\u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435<\/strong><\/p>\n<p>Go:<\/p>\n<pre><code class=\"go\">z := x + yz1 := x - y<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>ASM:<\/p>\n<pre><code class=\"assembly\">ADDQ BX, AX ; AX = AX + BX (z)MOVQ AX, CX ; \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442            ; \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0447\u0442\u043e \u0433\u0434\u0435 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0441\u044f AXSUBQ BX, AX ; AX = AX - BX (z1)MOVQ AX, DX ; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>Go:<\/p>\n<pre><code class=\"go\">z := x * yz1 := x \/ y<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>ASM:<\/p>\n<pre><code class=\"assembly\">IMULQ BX, AX ; AX = AX * BXMOVQ AX, CX  ; store \u0432 zCQO      ; \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0437\u043d\u0430\u043a AX \u0432 DX, Convert Quadword to Octoword \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.          ; \u0412 DX \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c -1, \u0432 AX \u043d\u0430\u0448\u0435 \u0447\u0438\u0441\u043b\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440-5IDIVQ BX ; AX = (DX:AX) \/ BX, DX = \u043e\u0441\u0442\u0430\u0442\u043e\u043a<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p> \u0412 Go assembler \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 amd64 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 x86-64. \u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u0432 x86 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f IDIV \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b DX:AX \u043a\u0430\u043a \u0434\u0435\u043b\u0438\u043c\u043e\u0435. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 AX, \u0430 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2014 \u0432 DX.<\/p>\n<p>\u0414\u0430, \u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u2013 \u0434\u043e\u0440\u043e\u0433\u043e\u0432\u0430\u0442\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0445\u043e\u0442\u044f \u0432 \u0443\u0437\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0435\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430<\/p>\n<p><strong>AND, OR, XOR<\/strong><\/p>\n<p>Go:<\/p>\n<pre><code class=\"go\">z := x &amp; yz1 := x | yz2 := x ^ y<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>ASM:<\/p>\n<pre><code class=\"assembly\">ANDQ BX, AX ; AX = AX &amp; BXMOVQ AX, CX ; zORQ BX, AX  ; AX = AX | BXMOVQ AX, DX ; z1XORQ BX, AX ; AX = AX ^ BXMOVQ AX, SI ; z28-<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0421\u0434\u0432\u0438\u0433\u0438 \u0432\u043b\u0435\u0432\u043e\/\u0432\u043f\u0440\u0430\u0432\u043e<\/strong><\/p>\n<p>Go:<\/p>\n<pre><code class=\"go\">z := y &lt;&lt; xz1 := y &gt;&gt; x<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>ASM:<\/p>\n<pre><code class=\"assembly\">MOVQ AX, CL ; CL = \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u0432SHLQ CL, BX ; BX = BX &lt;&lt; CLMOVQ BX, DX ; zSHRQ CL, BX ; BX = BX &gt;&gt; CLMOVQ BX, SI ; z1<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/strong><\/p>\n<p>Go:<\/p>\n<pre><code class=\"go\">x &lt; y<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>ASM:<\/p>\n<pre><code class=\"assembly\">CMPQ BX, AX ; \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c AX \u0438 BXJLT less    ; \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0435\u0441\u043b\u0438 AX &lt; BX, JLT \u043f\u043e\u043a\u0430 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>CMPQ \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0444\u043b\u0430\u0433\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430<\/p>\n<p><strong>Test<\/strong><\/p>\n<pre><code class=\"go\">if x == 0<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>ASM:<\/p>\n<pre><code class=\"assembly\">TESTQ AX, AX ; \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c AX == 0JEQ zero ; \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0435\u0441\u043b\u0438 \u043d\u043e\u043b\u044c<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u0430\u0441 \u043d\u0435 \u043f\u0443\u0442\u0430\u0442\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u044e: TEST \u2013 <em>\u044d\u0442\u043e \u0431\u0438\u0442\u043e\u0432\u043e\u0435 AND \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u0441\u0430\u043c\u0438\u043c \u0441 \u0441\u043e\u0431\u043e\u0439<\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 0 \u0442\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e\u2026 0!<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e Q(8) \u0432\u0441\u0435 \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c B(1), W(2), L(4)<\/p>\n<p><strong>Go \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u043e\u043c<\/strong><\/p>\n<p>\u0418\u0442\u0430\u043a, \u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b, \u0447\u0442\u043e \u043f\u043e\u043c\u0438\u043c\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0412\u043e\u043e\u0431\u0449\u0435, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442?<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e <em>\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/em> \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u0447\u0442\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0435\u0441\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p><strong>jump <\/strong>\u2013 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434(goto)<\/p>\n<p><strong>branch <\/strong>\u2013 \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0445\u043e\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f(\u0430\u043d\u0430\u043b\u043e\u0433 if)<\/p>\n<p><strong>call <\/strong>\u2013 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/p>\n<p><strong>return <\/strong>\u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/p>\n<p>\u0412\u0441\u0451 \u044d\u0442\u043e \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0451\u0442\u0435 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e <strong>PC<\/strong>: \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043b\u0438\u0431\u043e \u0438\u0434\u0451\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043b\u0438\u0431\u043e \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u0412 Go assembler \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u0438 \u0436\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0438 \u0432\u044b\u0437\u043e\u0432\u0430, \u0447\u0442\u043e \u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c asm \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<p><strong>Jump<\/strong><\/p>\n<p>\u041f\u043e \u0444\u0430\u043a\u0442\u0443 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u043a\u043e\u0434\u0430. \u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0443\u0436\u0435 \u0432\u044b\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430, \u043a\u0430\u043a \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0446\u0438\u043a\u043b. JMP \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043c\u0435\u0442\u043a\u0435 \u0432 \u043a\u043e\u0434\u0435. \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0438\u0436\u0435<\/p>\n<pre><code class=\"assembly\">lbl: MOVQ $1, AX ; \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AX                 ; \u0443\u0441\u043b\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0442\u0441\u044e\u0434\u0430JMP lbl          ; \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a lbl.                  ; PC = address(label), \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0442\u0430\u0432\u0438\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0430 \u043c\u0435\u0442\u043a\u0443 lbl<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f:<\/p>\n<ul>\n<li>\n<p>\u0445\u0432\u043e\u0441\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/p>\n<\/li>\n<li>\n<p>\u0446\u0438\u043a\u043b\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430 \u043a\u0443\u0441\u043a\u043e\u0432 \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 runtime<\/p>\n<\/li>\n<\/ul>\n<p><strong>Branch<\/strong><\/p>\n<p>branch \u2014 \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043e\u043d \u0438\u0434\u0451\u0442 \u043f\u043e\u0441\u043b\u0435 CMP \u0438\u043b\u0438 TEST, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0444\u043b\u0430\u0433\u0438 CPU. \u0412\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 CMPQ \u0432\u044b\u0448\u0435<\/p>\n<pre><code class=\"assembly\">CMPQ BX, AX ; \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c AX \u0438 BXJLT less    ; \u0435\u0441\u043b\u0438 AX &lt; BX, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043c\u0435\u0442\u043a\u0435 less<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418 \u044f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0432\u044b \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u043b\u0438, \u0447\u0442\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f Go Assembler \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f<\/p>\n<p><strong>Call<\/strong><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043f\u043e\u0434\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b(\u0444\u0443\u043d\u043a\u0446\u0438\u0438)<\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u0432 \u043a\u043e\u0434\u0435 \u0442\u0430\u043a<\/p>\n<pre><code class=\"assembly\">CALL\u00b7panicUnaligned(SB) <\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u0437\u044f\u043b \u0438\u0437 <a href=\"https:\/\/github.com\/golang\/go\/blob\/master\/src\/internal\/runtime\/atomic\/atomic_386.s\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/a><\/p>\n<p>\u041d\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/p>\n<p>\u0412 Go assembler \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043c\u0432\u043e\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 runtime\u00b7abort(SB), \u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u0438\u043d\u043a\u0435\u0440. \u042d\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 runtime.<\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e<\/p>\n<p>CALL -&gt; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 return address<\/p>\n<p>JMP\u00a0 -&gt; \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u044b\u0433\u0430\u0435\u0442<\/p>\n<p><strong>Return<\/strong><\/p>\n<p>RET \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0414\u0443\u043c\u0430\u044e, \u0432\u0441\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u044d\u0442\u043e \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>\u0412\u0437\u044f\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, CALL \u0438 RET \u2013 \u043f\u0430\u0440\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a () \u0438 return<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438. \u041f\u0443\u0441\u0442\u044c \u0435\u0441\u0442\u044c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"go\">package mainfunc add(a, b int) int {return a + b}func main() {x := add(2, 3)_ = x}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438:<\/p>\n<p><strong><em>main.main<\/em><\/strong><\/p>\n<p>CALL main.add<\/p>\n<p>\u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/p>\n<p>\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c<\/p>\n<p><strong><em>main.add<\/em><\/strong><\/p>\n<p>\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b<\/p>\n<p>\u0441\u043b\u043e\u0436\u0438\u0442\u044c<\/p>\n<p>\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e: <\/p>\n<pre><code class=\"assembly\">TEXT main.add(SB), ABIInternal, $0-24 ; TEXT - \u043d\u043e\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0430 0-24 \u2013 stack frame \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430. ABI \u044f \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u043e \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u044eMOVQ a+0(FP), AX    ; AX = aMOVQ b+8(FP), BX    ; BX = bADDQ BX, AX         ; AX = a + bMOVQ AX, ret+16(FP) ; \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442RETTEXT main.main(SB), ABIInternal, $0-16MOVQ $2, AXMOVQ AX, 0(SP) ; \u043f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442MOVQ $3, AXMOVQ AX, 8(SP) ; \u0432\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442CALL main.add(SB) ; \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438MOVQ 16(SP), AX ; \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442MOVQ AX, main.x(SB)RET<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0441\u0430\u043c\u043e\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u0438, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0430\u0445 Go, \u043d\u043e \u044d\u0442\u043e \u0431\u0430\u0437\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0434\u0430\u043b\u0435\u0435 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0442\u043e, \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 Go<\/p>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u043e\u043c\u043d\u044e \u2013 <em>\u042d\u0422\u041e \u041d\u0415 \u0413\u0410\u0419\u0414 \u041f\u041e GO ASSEMBLER, \u0430 \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 End 2 End \u044f\u0437\u044b\u043a Go.<\/em> \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0438 \u0443\u0432\u0438\u0434\u0438\u043c\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u044f\u0445, \u0433\u0434\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>fence\/barrier-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b<\/p>\n<\/li>\n<li>\n<p>\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b<\/p>\n<\/li>\n<\/ul>\n<p>P.S. \u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0437\u0430\u0431\u0443\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u0435\u0435 \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u0442\u0438\u043f\u044b \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 CPU, RAM \ud83d\ude42 <\/p>\n<\/div>\n<p>\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\/articles\/1023964\/\">https:\/\/habr.com\/ru\/articles\/1023964\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go-\u043a\u043e\u0434 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.\u041b\u044e\u0431\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 Go \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 CPU.\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c:1) \u041a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Go2) \u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 Go assembler3) \u0418 \u0447\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0414\u0443\u043c\u0430\u044e \u0441 \u043e\u0431\u0437\u043e\u0440\u043e\u043c \u0438 \u043e\u0431\u0449\u0438\u043c\u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430 \u2013 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 CPU \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0435 GO-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e CPU \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Go, \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438 \u043a\u0430\u043a \u0441\u043e\u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0441 \u043a\u043e\u0434\u043e\u043c Go. \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u041d\u0415 \u0433\u0430\u0439\u0434 \u043f\u043e Go Assembler, \u0430 \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Go End 2 End. \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0434\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0438\u0441\u0442\u0438\u043d\u044b\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0441\u0430\u043c CPU \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442:\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u044f(reorder) \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438\u0420\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u043a\u044d\u0448\u0435\u0439\u0410\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439\u0411\u0430\u0440\u044c\u0435\u0440\u044b \u043f\u0430\u043c\u044f\u0442\u0438\u0422\u0430\u043a \u0447\u0442\u043e CPU \u2013 \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f Go-\u043a\u043e\u0434\u0430Reminder\u0427\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u201c\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0435\u0439\u201d?\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u044c \u0442\u043e Go, JS, Java\u2026 \u0415\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u0430 \u043d\u0430 \u0435\u0433\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443. \u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0430 \u043b\u0438\u0448\u044c \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c, \u0447\u0442\u043e CPU \u0443\u043c\u0435\u0435\u0442 \u043b\u0438\u0448\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044cload\/store\u0410\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435\/\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438branch\/jump\/call\/return\u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438fence\/barrier-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u044b\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b, \u0435\u0441\u043b\u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e syscall\/runtime\u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443\u0412\u0432\u043e\u0434\u043d\u0430\u044f\u041f\u043e\u043a\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0420\u0435\u0433\u0438\u0441\u0442\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 \u044f\u0447\u0435\u0435\u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445,\u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u0437\u0430 \u043e\u0434\u0438\u043d \u0442\u0430\u043a\u0442.\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e, \u0432\u0441\u0451 \u0447\u0435\u043c \u043c\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 ASM \u2013 \u044d\u0442\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0438 \u0438\u0445 \u0431\u0430\u0439\u0442\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u0435\u043cGox := 1x += 1y = xASMmov rax, 1         ; \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXadd rax, 1         ; \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 AXmov [rip + y], rax ; \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 AX \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e y\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u0441\u0432\u043e\u0435\u043c main.go \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:  go tool compile -S main.go\u041b\u0438\u0431\u043e \u0447\u0442\u043e-\u0442\u043e \u0432 \u0434\u0443\u0445\u0435go build -gcflags=&#187;-N -l&#187; -o app main.gogo tool objdump -s &#171;main.main&#187; .\/app\u0423\u0447\u0442\u0438\u0442\u0435, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 Go Assembly\u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0442\u043e \u0432\u043e\u0442 \u0441\u0441\u044b\u043b\u043a\u0430(\u041d\u0435 \u043f\u0443\u0433\u0430\u0439\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0442\u0430\u043c http) \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f x86. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u041d\u0413\u0423. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0441\u0435\u0440\u0438\u044f \u0433\u0430\u0439\u0434\u043e\u0432 \u043f\u043e Go Assembler\u00a0\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f Go Assembler!Go Assembler\u0412\u043e\u043e\u0431\u0449\u0435, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0430\u043a\u0442 \u043f\u0440\u043e Go \u2013 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0439 \u201c\u0441\u043b\u0435\u043d\u0433\u201d Assembly, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Go Assembler\u0412 \u0447\u0435\u043c \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f?\u042d\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e Go \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b (GAS\/Intel), \u0430 \u0432\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0430\u0434 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438. \u0412\u043e\u0442 \u044d\u0442\u0438 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437:1) \u041f\u0441\u0435\u0432\u0434\u043e\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b\u0412 Go ASM \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 ISA \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430Go assembler \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0434\u043b\u044f:\u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0441\u0442\u0438\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 ABI(Application Binary Interface)\u0440\u0430\u0431\u043e\u0442\u044b \u043b\u0438\u043d\u043a\u0435\u0440\u0430\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 stack maps \u0434\u043b\u044f GC\u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0435\u0435 \u2013 \u0432\u043e\u0442 \u043e\u043d\u0438\u041f\u0441\u0435\u0432\u0434\u043e\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435SBsymbol base. global\/static symbols, \u0442\u0443\u0434\u0430 \u0438\u0434\u0443\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435SPstack pointer. \u041f\u0441\u0435\u0432\u0434\u043e\u0440\u0435\u0433\u0438\u0441\u0442\u0440, \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0449\u0438\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e stack frameFPframe pointer. \u041f\u0441\u0435\u0432\u0434\u043e\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438) PCprogram counter. \u0410\u0434\u0440\u0435\u0441 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u0410 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 CPU-\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b:AX BX CX DX SI DI BP R8\u2013R15\u0422\u043e \u0435\u0441\u0442\u044cMOVQ AX, main.y(SB)   ; GoASMmov [rip+offset], rax ; x86 ASM2) \u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u0438\u0412 Go assembler \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u044b:name(SB)x-8(SP)arg+0(FP)MOVQ arg+0(FP), AX ; \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u04383) \u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439TEXT main.main(SB), ABIInternal, $0-8\u0422\u043e \u0435\u0441\u0442\u044c\u0444\u0443\u043d\u043a\u0446\u0438\u044f main.mainABIstack frame size4) \u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f runtimeGo assembler \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043a CPU, \u043d\u043e \u043d\u0443\u0436\u043d\u044b runtime.\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:FUNCDATAPCDATA5) \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 ABI\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 ABIInternal, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 ABI Go6) \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0430\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u044b(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 SB) \u0432\u043c\u0435\u0441\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432\u0410 \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 Go Assembler?\u041c\u043e\u0436\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0431\u0449\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u043f\u0440\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u0443\u044e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 GC, \u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u044d\u0442\u043e \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b.\u0423 Go \u0435\u0441\u0442\u044c runtime \u2014 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 goroutine, \u0441\u0442\u0435\u043a\u043e\u043c, GC \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430\u043c\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b. \u0427\u0430\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435.\u0415\u0441\u043b\u0438 \u0431\u044b Go Assembler \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b, \u0442\u043e runtime \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0435\u0451 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 (x86, ARM, RISC-V \u0438 \u0442.\u0434.). \u042d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u043e \u0431\u044b \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043d\u043e\u0432\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c.Go Assembler \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0432\u0432\u043e\u0434\u044f \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043b\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0438 \u043b\u0438\u043d\u043a\u0435\u0440. \u0412 \u043d\u0451\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0432\u0440\u043e\u0434\u0435 SB, SP, FP, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b runtime (TEXT, FUNCDATA, PCDATA).\u0412 \u0438\u0442\u043e\u0433\u0435 runtime \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e Go (stack frame, \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 GC), \u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u043e-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 asm-\u0444\u0430\u0439\u043b\u0430\u0445 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c.Go Load-n-Store\u0415\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u2013 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.\u00a0\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432 ASM \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u043e\u0439 \u0441\u0445\u0435\u043c\u0435:1) \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432. \u041e \u043d\u0438\u0445 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0442\u043e \u0435\u0441\u0442\u044c &#171;\u043f\u0440\u0435\u0434\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b&#187;2) \u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u043c\u0438 \u0438 \u043f\u0430\u043c\u044f\u0442\u044c\u044e\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434x := 1y = x\u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u043e:MOVQ $1, AX        ; \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXMOVQ AX, main.y(SB); \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 AX \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e y\u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 (-N -l), \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u0438\u0436\u0435 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:MOVQ $1, main.x-8(SP) ; \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 1 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e xMOVQ main.x-8(SP), AX ; load: \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 x \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXMOVQ AX, main.y(SB)   ; store: \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 AX \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e\u042f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u044d\u0442\u043e \u0447\u0438\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441:MOVQ \u2013 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c load\/store?MOVQ \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.\u0411\u0443\u043a\u0432\u0430 Q \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 quadword (8 \u0431\u0430\u0439\u0442) \u2014 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430.\u0415\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 B(1), W(2), L(4)\u0420\u0435\u043c\u0430\u0440\u043a\u0430\u041d\u0430 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445 (amd64) \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f MOVQ \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 8-\u0431\u0430\u0439\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430 \u043e\u0434\u043d\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e.\u041d\u0430 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445 (386) \u0442\u0430\u043a\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 64-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 MOVL \u043f\u043e 4 \u0431\u0430\u0439\u0442\u0430.\u0420\u0430\u0437\u043c\u0435\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440. \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u044c, \u043e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u0448\u043b\u043e \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e\u0421\u0430\u043c\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f MOV \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0438\u0434\u044b \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:immediate -&gt; registerregister -&gt; registerregister -&gt; memorymemory -&gt; registerLoad \u0438 Store \u2013 \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442:load = \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440store = \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c\u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0441 \u0441\u0430\u043c\u043e\u043c Go Load \u0438 Store \u0442\u0440\u0430\u043a\u0442\u0443\u044e\u0442\u0441\u044f \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e CPU, \u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0430\u043c\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b\u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0430 \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u0438\u0448\u0435\u043c, \u0441\u043a\u0430\u0436\u0435\u043c, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430 16 \u0431\u0430\u0439\u0442, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0442\u043e\u043b\u044c\u043a\u043e 8(MOVQ)?type Point struct {x inty int}func main() {p1 := Point{1, 2}p2 := p1}\/\/ int = 8 bytes\/\/ Point = 16 bytesp1 := p2\u042d\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b!p2.x = p1.xp2.y = p1.y\u0422\u043e \u0435\u0441\u0442\u044c \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u043e\u043b\u044f. \u0418 \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439 MOVQ \u043c\u044b \u043d\u0435 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0447\u0442\u043e-\u0442\u043e \u0432 \u0434\u0443\u0445\u0435MOVQ main.p1(SP), AX   ; load \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AX p1.xMOVQ AX, main.p2(SP)   ; store \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0438\u0437 AX p1.x(\u0437\u0430\u043f\u0438\u0441\u044c \u0432 p2.x)MOVQ main.p1+8(SP), AX ; load \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AX p1.y(\u043e\u0442\u0441\u0442\u0443\u043f \u043a\u0430\u043a \u0440\u0430\u0437 8 \u0431\u0430\u0439\u0442, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440)MOVQ AX, main.p2+8(SP) ; store \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 p2.y \u0438\u0437 AX(\u0442\u0430\u043a\u0436\u0435 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043e\u0442\u0441\u0442\u0443\u043f\u0430)\u0422\u043e \u0435\u0441\u0442\u044c 4 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u0418 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u2013 \u043a\u0430\u043a \u0441\u0435\u0431\u044f \u0432\u0435\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c\/\u0447\u0442\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439\u0417\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c: \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0432 Go \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0430\u0434\u0440\u0435\u0441 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438.\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 ASM \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044eGo:x := 10p := &amp;xp2 := p*p = 20ASM:LEAQ main.x(SP), AX  ; Load Effective Address x \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXMOVQ AX, main.p(SP)  ; store \u0438\u0437 AX \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e p \u0432 \u043f\u0430\u043c\u044f\u0442\u0438MOVQ main.p(SP), AX  ; load p \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 AXMOVQ AX, main.p2(SP) ; store \u0438\u0437 AX \u0432 p2MOVQ main.p(SP), AX  ; load \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f p \u0432 AXMOVQ $20, (AX)       ; \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 20 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 p\u042f \u0434\u0443\u043c\u0430\u044e, \u0441 \u0441\u0430\u043c\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438Go \u0432 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443(\u0438 \u043b\u043e\u0433\u0438\u043a\u0443)\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0432\u0435\u043b\u0438\u043a\u0430\u044f \u043c\u0438\u0441\u0441\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0436\u0435\u043b\u0435\u0437\u0430 \u2013 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0435 \u0437\u0440\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u2013 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u0431\u043e\u0440 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f ISA \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041d\u043e Go Assembler \u0438\u043c\u0435\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u043e-\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0447\u0442\u043e \u0438 x86\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443(\u043f\u0440\u0438\u043c\u0435\u043c \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043d\u0430\u0448\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 x \u0438 y \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0445 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438)\u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435Go:z := x + yz1 := x &#8212; yASM:ADDQ BX, AX ; AX = AX + BX (z)MOVQ AX, CX ; \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442            ; \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0447\u0442\u043e \u0433\u0434\u0435 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0441\u044f AXSUBQ BX, AX ; AX = AX &#8212; BX (z1)MOVQ AX, DX ; \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u0435Go:z := x * yz1 := x \/ yASM:IMULQ BX, AX ; AX = AX * BXMOVQ AX, CX  ; store \u0432 zCQO      ; \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0437\u043d\u0430\u043a AX \u0432 DX, Convert Quadword to Octoword \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.          ; \u0412 DX \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c -1, \u0432 AX \u043d\u0430\u0448\u0435 \u0447\u0438\u0441\u043b\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440-5IDIVQ BX ; AX = (DX:AX) \/ BX, DX = \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0412 Go assembler \u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 amd64 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 x86-64. \u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u0432 x86 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f IDIV \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b DX:AX \u043a\u0430\u043a \u0434\u0435\u043b\u0438\u043c\u043e\u0435. \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 AX, \u0430 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u2014 \u0432 DX.\u0414\u0430, \u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u2013 \u0434\u043e\u0440\u043e\u0433\u043e\u0432\u0430\u0442\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0445\u043e\u0442\u044f \u0432 \u0443\u0437\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043c\u043e\u0436\u0435\u0442 \u0435\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e \u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430AND, OR, XORGo:z := x &amp; yz1 := x | yz2 := x ^ yASM:ANDQ BX, AX ; AX = AX &amp; BXMOVQ AX, CX ; zORQ BX, AX  ; AX = AX | BXMOVQ AX, DX ; z1XORQ BX, AX ; AX = AX ^ BXMOVQ AX, SI ; z28-\u0421\u0434\u0432\u0438\u0433\u0438 \u0432\u043b\u0435\u0432\u043e\/\u0432\u043f\u0440\u0430\u0432\u043eGo:z := y &lt;&lt; xz1 := y &gt;&gt; xASM:MOVQ AX, CL ; CL = \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u0432SHLQ CL, BX ; BX = BX &lt;&lt; CLMOVQ BX, DX&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-476091","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/476091","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=476091"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/476091\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=476091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=476091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=476091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}