From 3b53c3c9013c4735a62e31ee05fe3e519297dd92 Mon Sep 17 00:00:00 2001 From: "Matsuura Tomoya(Windows)" Date: Sun, 17 Nov 2024 01:44:15 +0900 Subject: [PATCH] [obsidian] vault backup: 2024-11-17 01:44:15[ --- ...µéšŽè¨ˆç®—を命令型VMインストラクションã§è¡¨ç¾ã™ã‚‹.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/content/多段階計算を命令型VMインストラクションã§è¡¨ç¾ã™ã‚‹.md b/content/多段階計算を命令型VMインストラクションã§è¡¨ç¾ã™ã‚‹.md index d7931993..942ccf56 100644 --- a/content/多段階計算を命令型VMインストラクションã§è¡¨ç¾ã™ã‚‹.md +++ b/content/多段階計算を命令型VMインストラクションã§è¡¨ç¾ã™ã‚‹.md @@ -30,27 +30,34 @@ let addc x y = &(~x + ~y) in ~(addc &n &m ) ``` -`addc`ã®åž‹ã¯`&int -> &int` +`addc`ã®åž‹ã¯`(&int,&int) -> &int` Codeã‚‚Escapeã‚‚ãƒã‚¹ãƒˆã§ãる構造ãªã‚“ã ã‹ã‚‰å‘½ä»¤åž‹ã«ç›´ã™ã¨ãªã«ã‹ã—らã®ã‚¹ã‚¿ãƒƒã‚¯æ§‹é€ ã‚’æ“作ã™ã‚‹ã‚‚ã®ã«ãªã‚‹ã¯ãš Escapeã¯ã‚ãã¾ã§åŸ‹ã‚込むã ã‘ã§è©•ä¾¡ã‚’ã™ã‚‹ã‚ã‘ã˜ã‚ƒãªã„ã‚“ã ã‚ˆãª `&(~x + ~y)`ã“ã“ã ã‘å–り出ã™ã¨ã©ã†ã ã‚ㆠ+`~x`ã¯xを評価ã—ãŸå¾Œã«ã‚¨ã‚¹ã‚±ãƒ¼ãƒ—ã™ã‚‹ã€ã£ã¦ã“ã¨ã ã‚‚ã‚“ãªã‚ + ``` fn addc x y // reg 1,2ã«ã¯ãƒ—ログラム辺ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ +startescape mov 1 x +endescape +startescape mov 2 y +endescape add 1 1 2 //最後ã¯å¿…ãšã“ã†ãªã‚‹ã‚ã‘㧠fn main movc 1 100 movc 2 200 -lift 1 1 -lift 2 2 +lift 2 1 +lift 3 2 startescape -call "addc" 1 2 +move 1 "addc" +call 1 2 1 endescape ret 1 ```