{"id":2918,"date":"2011-11-25T22:06:24","date_gmt":"2011-11-25T13:06:24","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=2918"},"modified":"2011-11-26T02:07:14","modified_gmt":"2011-11-25T17:07:14","slug":"nasm-%e3%81%ae%e3%83%9e%e3%82%af%e3%83%ad%e5%ae%9a%e7%be%a9%e3%81%a7%e3%83%9e%e3%82%af%e3%83%ad%e5%bc%95%e6%95%b0%e3%82%92%e5%90%8d%e5%89%8d%e3%81%a7%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%99","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=2918","title":{"rendered":"NASM \u306e\u30de\u30af\u30ed\u5b9a\u7fa9\u3067\u30de\u30af\u30ed\u5f15\u6570\u3092\u540d\u524d\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b"},"content":{"rendered":"<p>Ut Video Codec Suite \u306e Mac \u7248\u306b\u304a\u3051\u308b\u30a2\u30bb\u30f3\u30d6\u30e9\u5316\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001MASM \u304b\u3089 NASM \u3078\u306e\u66f8\u304d\u63db\u3048\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002Mac \u3067 MASM \u306f\u4f7f\u3048\u306a\u3044\u305f\u3081\u306a\u306e\u3067\u3059\u304c\u3001GAS \u306b\u79fb\u690d\u3057\u30662\u30d0\u30fc\u30b8\u30e7\u30f3\u30e1\u30f3\u30c6\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001NASM \u306b\u79fb\u690d\u3057\u30661\u3064\u306e\u30bd\u30fc\u30b9\u304b\u3089 Visual C++ \u7528\u3068 gcc \u7528\u306e\u4e21\u65b9\u3092\u751f\u6210\u3059\u3079\u304d\u3067\u3057\u3087\u3046\u3002<\/p>\n<p><!--more--><\/p>\n<p>NASM \u3067\u306f MASM \u3068\u9055\u3044\u3001\uff08\u8907\u6570\u884c\u306e\uff09\u30de\u30af\u30ed\u306e\u5f15\u6570\u306f\u540d\u524d\u3067\u306f\u306a\u304f\u756a\u53f7\u3067\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001MASM \u3068 NASM \u306b\u304a\u3051\u308b\u4ee5\u4e0b\u306e\u30de\u30af\u30ed\u5b9a\u7fa9\u306f\u3001\u7b49\u4fa1\u306a\u30de\u30af\u30ed\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<blockquote>\n<pre>MASM_MACRO macro foo, bar\r\n        mov eax, foo\r\n        mov ebx, bar\r\nendm\r\n\r\n%macro NASM_MACRO 2\r\n        mov eax, %1\r\n        mov ebx, %2\r\n%endmacro<\/pre>\n<\/blockquote>\n<p>\u53ef\u5909\u500b\u5f15\u6570\u30de\u30af\u30ed\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u756a\u53f7\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u65b9\u304c\u90fd\u5408\u304c\u3044\u3044\u3053\u3068\u304c\u591a\u3044\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u305d\u3046\u3067\u306a\u3044\u5834\u5408\u306f\u540d\u524d\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u65b9\u304c\u53ef\u8aad\u6027\u304c\u9ad8\u3044\u3067\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5f15\u6570\u3054\u3068\u306b\u540d\u524d\u3092\u3064\u3051\u308b\u3053\u3068\u306f\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<blockquote>\n<pre>%macro MY_MACRO 3\r\n%push\r\n%xdefine %$hoge %1\r\n%xdefine %$fuga %2\r\n%xdefine %$homu %3\r\n        mov eax, %$hoge\r\n        ...\r\n%pop\r\n%endmacro<\/pre>\n<\/blockquote>\n<p>\u3067\u3082\u8907\u6570\u884c\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3001\u3061\u3087\u3063\u3068\u7f8e\u3057\u304f\u306a\u3044\u3002\u5f15\u6570\u304c7\u3064\u3042\u308b\u30de\u30af\u30ed\u3068\u304b\u66f8\u304b\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u3057\u3002<\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u30011\u884c\u3067\u5f15\u6570\u306b\u540d\u524d\u3092\u3064\u3051\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30de\u30af\u30ed\u3092\u5b9a\u7fa9\u3057\u3066\u307f\u307e\u3057\u305f<\/p>\n<blockquote>\n<pre>%macro MACRO_PARAM_NAME 1-*\r\n%assign i 1\r\n%rep %0\r\n%xdefine %$%1 %i\r\n%rotate 1\r\n%assign i i + 1\r\n%endrep\r\n%endmacro\r\n\r\n%macro MY_MACRO 3\r\n%push\r\n        MACRO_PARAM_NAME hoge, fuga, homu\r\n        mov eax, %$hoge\r\n        ...\r\n%pop\r\n%endmacro<\/pre>\n<\/blockquote>\n<p>\u3068\u3053\u308d\u304c\u3053\u308c\u3060\u3068\u5185\u5074\u306e\u30de\u30af\u30ed MACRO_PARAM_NAME \u304b\u3089\u5916\u5074\u306e\u30de\u30af\u30ed MY_MACRO \u306e\u5f15\u6570\u3092\u53c2\u7167\u3067\u304d\u306a\u3044\u306e\u3067\u3046\u307e\u304f\u884c\u304b\u306a\u3044\u3093\u3067\u3059\u306a\u3002\u3068\u3044\u3046\u304b\u3001\u8907\u6570\u884c\u30de\u30af\u30ed\u306e\u5c55\u958b\u306f\u5b9a\u7fa9\u6642\u3067\u306f\u306a\u304f\u4f7f\u7528\u6642\u306b\u884c\u308f\u308c\u308b\u306e\u3067\u3001MACRO_PARAM_NAME \u3092\u5c55\u958b\u3057\u3066\u540d\u524d\u3092\u3064\u3051\u3088\u3046\u3068\u3057\u305f\u6642\u306b\u306f\u3001\u65e2\u306b MY_MACRO \u306f\u5c55\u958b\u6e08\u307f\u3067\u6d88\u6ec5\u3057\u3066\u304a\u308a\u30de\u30af\u30ed\u5f15\u6570\u3082\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3057\u3087\u3046\u304c\u306a\u3044\u306e\u3067\u3001\u7d50\u5c40\u59a5\u5354\u3057\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u65b9\u6cd5\u3067\u9003\u3052\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<blockquote>\n<pre>\r\n%macro MULTI_CONTEXT_XDEFINE 0-*\r\n%rep %0 \/ 2\r\n%xdefine %$%1 %2\r\n%rotate 2\r\n%endrep\r\n%endmacro\r\n\r\n%macro MY_MACRO 3\r\n%push\r\n        MULTI_CONTEXT_XDEFINE hoge, %1, fuga, %2, homu, %3\r\n        mov eax, %$hoge\r\n        ...\r\n%pop\r\n%endmacro<\/pre>\n<\/blockquote>\n<p>\u898b\u305f\u76ee\u306f\u3042\u3093\u307e\u308a\u7f8e\u3057\u304f\u306a\u3044\u3067\u3059\u304c\u3001\u52d5\u4f5c\u306f\u7d20\u76f4\u306a\u306f\u305a\u3067\u3059\u3002\u3064\u307e\u3089\u306a\u3044\u89e3\u6c7a\u65b9\u6cd5\u3067\u3059\u307e\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ut Video Codec Suite \u306e Mac \u7248\u306b\u304a\u3051\u308b\u30a2\u30bb\u30f3\u30d6\u30e9\u5316\u306e\u4e00\u74b0\u3068\u3057\u3066\u3001MASM \u304b\u3089 NASM \u3078\u306e\u66f8\u304d\u63db\u3048\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002Mac \u3067 MASM \u306f\u4f7f\u3048\u306a\u3044\u305f\u3081\u306a\u306e\u3067\u3059\u304c\u3001GAS \u306b\u79fb\u690d\u3057\u30662\u30d0\u30fc\u30b8\u30e7 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-2918","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2918","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2918"}],"version-history":[{"count":10,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2918\/revisions"}],"predecessor-version":[{"id":2928,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/2918\/revisions\/2928"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2918"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}