{"id":2283,"date":"2014-12-26T18:03:30","date_gmt":"2014-12-26T12:33:30","guid":{"rendered":"https:\/\/www.suramya.com\/blog\/?p=2283"},"modified":"2022-06-16T15:19:18","modified_gmt":"2022-06-16T09:49:18","slug":"writing-a-virtual-machine-in-excel","status":"publish","type":"post","link":"https:\/\/www.suramya.com\/blog\/2014\/12\/writing-a-virtual-machine-in-excel\/","title":{"rendered":"Writing A Virtual Machine In Excel"},"content":{"rendered":"<p>Microsoft Excel should soon be classified as an Operating System. In the past we have seen a 3D shoot them up Doom Clone, a Flight Simulator and other games included in it as Easter eggs. Then we saw people <a href='https:\/\/www.suramya.com\/blog\/2014\/11\/use-excel-to-watch-movies-at-work\/'>using it to watch movies at work<\/a>, and now here&#8217;s the latest entry that forces Excel way outside its comfort zone&#8230; <\/p>\n<p>A programmer named \u00c3\u0081d\u00c3\u00a1m was participating in a contest where he had to solve a problem in Excel but the official rules prohibited the use of Excel macros so he went and created an assembly interpreter for Excel and used it to solve the problem instead. Talk about overkill. The idea is quite interesting. However the thought process required to imagine this as a possibility and then actually going ahead and implementing this is mind boggling. <\/p>\n<blockquote><p>This is a virtual Harvard architecture machine without writable RAM; the stack is only lots and lots of IFs.  The instructions \u00e2\u20ac\u201c mostly load, MOV, JNZ, INC, and CMP solves this problem, examining two inputs to see if they multiples of each other. If you\u00e2\u20ac&#x2122;re wondering, an example cell from [\u00c3\u0081d\u00c3\u00a1m]\u00e2\u20ac&#x2122;s Excel sheet looks like this:<\/p><\/blockquote>\n<pre class='code'>=F6\r\n   INDEX($C$2:$C99999,$G2,1),\r\n   IF(AND(INDEX($B$2:$B99999,$G2,1)=\"JZ\",$I2=0),\r\n      INDEX($C$2:$C99999,$G2,1),\r\n         IF(AND(INDEX($B$2:$B99999,$G2,1)=\"JNZ\",$I2<>0),\r\n         INDEX($C$2:$C99999,$G2,1),\r\n         G2+1\r\n         )\r\n      )\r\n   )\r\n)\r\n<\/pre>\n<p>You can check out Adam&#8217;s solution at <https: \/\/hackaday.io\/project\/3680-exembler'>Hackaday.io if you are interested. I think I am going to go find my excel for Dummies book now and get just a little bit more proficient in it. <\/p>\n<p>Thanks to <a href=\"http:\/\/hackaday.com\/2014\/12\/25\/writing-a-virtual-machine-in-excel\/\">hackaday.com<\/a> for the original article.<\/p>\n<p>-Suramya<\/p>\n<p><\/https:><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Excel should soon be classified as an Operating System. In the past we have seen a 3D shoot them up Doom Clone, a Flight Simulator and other games included in it as Easter eggs. Then we saw people using it to watch movies at work, and now here&#8217;s the latest entry that forces Excel [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[18,4,2],"tags":[],"class_list":["post-2283","post","type-post","status-publish","format-standard","hentry","category-computer-software","category-my-thoughts","category-techie-stuff"],"_links":{"self":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/2283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/comments?post=2283"}],"version-history":[{"count":3,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/2283\/revisions"}],"predecessor-version":[{"id":5057,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/2283\/revisions\/5057"}],"wp:attachment":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/media?parent=2283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/categories?post=2283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/tags?post=2283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}