<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cpp on Ayman Bagabas</title><link>https://aymanbagabas.com/tags/cpp/</link><description>Recent content in Cpp on Ayman Bagabas</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 18 Nov 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://aymanbagabas.com/tags/cpp/index.xml" rel="self" type="application/rss+xml"/><item><title>Run native C/C++ code in the browser using Emscripten</title><link>https://aymanbagabas.com/blog/2020/11/18/run-native-c-c-code-in-the-browser-using-emscripten/</link><pubDate>Wed, 18 Nov 2020 00:00:00 +0000</pubDate><guid>https://aymanbagabas.com/blog/2020/11/18/run-native-c-c-code-in-the-browser-using-emscripten/</guid><description>&lt;p&gt;While working on &lt;a href="https://aymanbagabas.com/wmidumpper/"&gt;WMIDumpper&lt;/a&gt;, a simple tool that analyzes ACPI WMI blocks, I had to figure out how to implement &lt;a href="https://github.com/pali/bmfdec"&gt;bmfdec&lt;/a&gt; in JavaScript. My first thought was to port it to JavaScript and put in the time and effort to rewrite ~1500 lines of C code in JS. But then a light bulb went on in my head, WebAssembly! A quick search showed that &lt;a href="https://emscripten.org/"&gt;Emscripten&lt;/a&gt; is exactly what I need. It can compile C/C++ native code into WebAssembly and run it on the web.&lt;/p&gt;</description></item><item><title>Writing a Chip-8 emulator</title><link>https://aymanbagabas.com/blog/2018/09/17/chip-8-emulator/</link><pubDate>Mon, 17 Sep 2018 00:00:00 +0000</pubDate><guid>https://aymanbagabas.com/blog/2018/09/17/chip-8-emulator/</guid><description>&lt;p&gt;If you ever played retro games on modern computers, then you probably know what an emulator is. Chip-8 is an interpreted programming language that was created originally by &lt;a href="https://en.wikipedia.org/wiki/Joseph_Weisbecker"&gt;Joseph Weisbecker&lt;/a&gt;{target=&amp;quot;_blank&amp;quot; rel=&amp;ldquo;noopener&amp;rdquo;}. Chip-8 programs get interpreted by a virtual machine. It offers a very simple monochrome graphics and uses a 4Kb of memory. It has the &amp;ldquo;8&amp;rdquo; part because all the system&amp;rsquo;s components, like CPU registers, have a size of 8 bits or 1 byte.&lt;/p&gt;</description></item></channel></rss>