<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by M Salman A on Medium]]></title>
        <description><![CDATA[Stories by M Salman A on Medium]]></description>
        <link>https://medium.com/@mohammadalfarisi00?source=rss-4d484b2c5c7f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*FPXQ3bJ3hSwKu3QU</url>
            <title>Stories by M Salman A on Medium</title>
            <link>https://medium.com/@mohammadalfarisi00?source=rss-4d484b2c5c7f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:55:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohammadalfarisi00/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Gaul-lang, an Indonesian Programming Language written for Highschool Students]]></title>
            <link>https://medium.com/@mohammadalfarisi00/gaul-lang-an-indonesian-programming-language-written-for-highschool-students-8cfca87f55ad?source=rss-4d484b2c5c7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cfca87f55ad</guid>
            <category><![CDATA[indonesian]]></category>
            <category><![CDATA[programming-languages]]></category>
            <dc:creator><![CDATA[M Salman A]]></dc:creator>
            <pubDate>Wed, 30 Nov 2022 09:38:04 GMT</pubDate>
            <atom:updated>2022-11-30T09:38:04.290Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://gaul-lang.up.railway.app/">🔥 Gaul-lang by Kobar</a></p><p>Looks like my personal publication is due tommorrow… Welp, time to write some hundred-word article at 1 A.M. Let’s see how many typos this article will have when I’m finished.</p><p>Let’s see…</p><p>What should I write about…</p><p>Looking for anything that happened lately…</p><p>Adding more words to this article….</p><p>Oh right. Maybe I’ll tell you about that time I created an Indonesian programming language. Not sure if this is article-worthy but who cares I guess, I just want some sleep.</p><h3>Acknowledgement</h3><p>Okay. Let’s start. Before we start, I have to confess. I didn’t make this Indonesian programming language by myself. I had help from my wonderful team at the Apple Developer Academy. I definitely couldn’t have taken part in creating this Indonesian programming language, without their constant support and positivity by my side. So, for that, if any of you are ready this, I have two words to say. Thank. you.</p><p>There are many sources that we took inspiration for Gaul-lang and have tremendously helped in the development of this project, such as the <a href="https://github.com/RioChndr/jaksel-language">Jakselscript programming language</a>, also to <a href="https://www.youtube.com/watch?v=4m7ubrdbWQU">this course on Youtube</a> by Dmitry Soshnikov, and to this <a href="https://www.youtube.com/watch?v=eIA4nN9KxXk&amp;list=PLOech0kWpH8-njQpmSNGSiQBPUvl8v3IM">other course on Youtube</a> by Nicolas Laurent.</p><p>Nonetheless, in this article, I will tell you all about the programming language that we made, <strong>Gaul-lang</strong>, and all of the things that I learned from the journey.</p><h3>Gaul-lang</h3><p>So first of all, what does Gaul-lang look like? Simply, it’s a programming language that looks like Python or Ruby, but has keywords in Indonesian language, or Bahasa Indonesia. <strong>Here is a small snippet showing the FizzBuzz program in Gaul-lang:</strong></p><pre>baca n<br>ulangin i dari 1 sampe n<br> kalo i % 3 == 0 dan i % 5 == 0<br>  tulis &quot;FizzBuzz&quot;<br> kalogak i % 3 == 0<br>  tulis &quot;Fizz&quot;<br> kalogak i % 5 == 0<br>  tulis &quot;Buzz&quot;<br> lainnya<br>  tulis i<br> yaudah<br>yaudah</pre><p>Gaul-lang is made to be as close as possible to pseudocode without compromising on clarity. That is why you will not see many brackets and semicolons in this language. The reasoning behind this is that the language was meant to be used by Highschool Students and beginner programmers in Indonesia.</p><p>As you can see from the snippet, this language currently support most features you see in other languages, such as:</p><ul><li><strong>Variable Declarations</strong></li></ul><pre>umur_salman itu 22</pre><ul><li><strong>Inputs and outputs</strong></li></ul><pre>baca umur_salman<br><br>tulis umur_salman</pre><ul><li><strong>Operators</strong></li></ul><pre>dua itu 1 + 1<br><br>saya_keren itu benar</pre><ul><li><strong>Sequences</strong></li></ul><pre>umur_salman itu 22<br><br>salman_dewasa itu umur_salman &gt; 18<br><br>tulis salman_dewasa</pre><ul><li><strong>Conditionals</strong></li></ul><pre>umur_salman itu 22<br><br>kalo umur_salman &gt; 18<br>  tulis &quot;salman udah dewasa&quot;<br>kalogak umur_salman &gt; 30<br>  tulis &quot;salman udah tua&quot;<br>lainnya<br>  tulis &quot;salman masih bocah&quot;<br>yaudah</pre><ul><li><strong>Loops</strong></li></ul><pre>umur_salman itu 22<br><br>selama umur_salman &lt; 18<br>  tulis &quot;salman masih bocah&quot;<br>  umur_salman itu umur_salman + 1<br>yaudah</pre><p>You can read more about Gaul-lang from the documentation, courtesy of my colleague <a href="https://github.com/deXOR0/">Awesa</a> from the Apple Developer Academy. Currently, the documentation is available only in Indonesian 😀.</p><p><a href="https://sweltering-thursday-343.notion.site/Dokumentasi-Gaul-lang-10d312582e804b83953c2d858fb94df7">Dokumentasi Gaul-lang</a></p><p>And now for the big question, <strong>“Is Gaul-lang </strong><a href="https://en.wikipedia.org/wiki/Turing_completeness"><strong>Turing Complete</strong></a><strong>”</strong>? Well, maybe. Although it is theoritically possible, I have not made a Turing Machine using this programming language, so I can’t say whether this is the case.</p><p>Even though Gaul-lang has most features that a programming language needs, there are still many improvements that need to be made. For example, <strong>arrays</strong> and <strong>functions</strong> are currently <strong>not supported </strong>in Gaul-lang, which are important programming language features that you need to create a <strong>fully-functioning</strong> (haha) program.</p><p>Aside from that, error handling is also currently very shaky in Gaul-lang. There is a good chance you will experience problems while using this language and not understand what you did wrong from the error message.</p><p>There is also currently no documentation for Gaul-lang 😢, but you can search through and read the source code for yourself in this GitHub repo.</p><p><a href="https://github.com/m-salman-a/gaul-lang">GitHub - m-salman-a/gaul-lang</a></p><p>We are terribly sorry about all of Gaul-lang’s shortcomings 🙏🏽, we had a limited time to work on this and there are many things that we had to cut out some things that would take too much time. Here’s hoping I can continue <strong>one of my favorite programming projects</strong> in the future (and maybe rewrite it in a more performant<strong> </strong>programming language, like Rust or Go).</p><p>If you haven’t, you can try out Gaul-lang at this website, also created by <a href="https://github.com/deXOR0/">Awesa</a>!</p><p><a href="https://gaul-lang.up.railway.app/">🔥 Gaul-lang by Kobar</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cfca87f55ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Graph With SwiftUI]]></title>
            <link>https://medium.com/better-programming/building-a-graph-with-swiftui-b16dc48f7fe6?source=rss-4d484b2c5c7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b16dc48f7fe6</guid>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[M Salman A]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 17:58:49 GMT</pubDate>
            <atom:updated>2022-08-15T04:26:55.278Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn the basics of graphs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S7kNaSsDi_OwqtO4" /><figcaption>Photo by <a href="https://unsplash.com/@lxrcbsv?utm_source=medium&amp;utm_medium=referral">Алекс Арцибашев</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>Prerequisites</strong></h3><ul><li>Basic knowledge of Swift (understand how to code in swift)</li><li>Basic knowledge of SwiftUI (understand the basic components in SwiftUI and how to use them)</li><li>The will to learn!</li></ul><p>Have you ever opened a website and come across a graph visualization such as this one?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*2fIt9Gr9P9TPpqOTn-Z4nQ.png" /><figcaption>A network graph visualizing <a href="https://www.connectedpapers.com/main/49a049dc85e2380dde80501a984878341dd8efdf/wav2vec-2.0%3A-A-Framework-for-Self%20Supervised-Learning-of-Speech-Representations/graph">similar papers</a></figcaption></figure><p>This is called a <a href="https://en.wikipedia.org/wiki/Network_theory">Network Graph</a>, and is commonly used to model relationships between many items. Some applications of such a graph are to visualize friends in a social network, interconnecting cities, or even the typical food chain you find in any Biology textbook. A Network Graph consists of two components, the vertex (or vertices) and the edges. A vertex represents the items that are visualized in the graph, and the edges show the relationships between similar items.</p><p>But have you ever wondered how such graphs are made? How do you lay out each items in the graph? I won’t go into too much detail about graph theory and whether you need one in your app, but what I will show you in this article is the technical details behind showing such a visualization for your SwiftUI app.</p><h3><strong>Mr. Nice Graph</strong></h3><p>Before we get to deep on how to build complex graph visualizations with many vertices and edges, let’s first start with a basic graph. This simple graph has two vertices and one edge. It will look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*SOuNrKAZSGKpNt9yHLkhbQ.png" /><figcaption>No, it’s not Baymax. It’s a graph with two vertices and one edge.</figcaption></figure><p>First, we start with our background. Setup a SwiftUI project in Xcode (if you don’t know how to, check out tutorials from YouTube such as <a href="https://www.youtube.com/watch?v=tPWUsSELJyY">this one</a>). You should start with an empty ContainerView.</p><p>To give the background for our graph, start by creating a ZStack with a Rectangle as the first item. For the ZStack, we will give it the topLeading alignment for our coordinate system (I will explain this in a bit) and for the rectangle, just give it a fill with the color you desire for the background of your graph. I chose white.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/71c7ab63d99fcce6880ea6bf76b296d1/href">https://medium.com/media/71c7ab63d99fcce6880ea6bf76b296d1/href</a></iframe><p>Our graph works by plotting each vertex into a two-dimensional coordinate system in the ZStack. Because we gave it the topLeading alignment, the coordinate (0, 0) will start at the top left of the device screen.</p><p>Each pixel on your device screen represents a point in the coordinate system, where adding a value to the x coordinate moves our point to the right, and adding a value to the y coordinate moves our point down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*VKsuKubsONXZitQ5LEh2kg.png" /><figcaption>The coordinate system for our graph.</figcaption></figure><h3><strong>Say Hello to My Little Friends.</strong></h3><p>Now that we have our coordinate system, we can start by placing a vertex in the graph by using the Circle shape in SwiftUI (in reality, any shape would work but most graphs use a circle to represent a vertex).</p><p>We will modify two properties in our circle, the frame (how tall and wide our circle is) and the offset. The x and y values in the offset property of our circle dictates where the circle is placed within our graph’s coordinate system.</p><p>For example, if you input 50 for the x and y value, our circle should show up somewhere near the top left edge of our device’s screen. You can experiment with different x and y values, but you should remember that the greater the x, the more further right our circle will show up, and the greater the y, the further down our circle will be placed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/190fe41cd1e66c0cf9710713ed4aaedd/href">https://medium.com/media/190fe41cd1e66c0cf9710713ed4aaedd/href</a></iframe><h3><strong>Make sure that our Circle (the vertex) component comes after the Rectangle (the background) component in our ZStack</strong>.</h3><p>Now you should be able to see your vertex in the preview, however, you can see it&#39;s a bit lonely on its own. So, let’s give it a friend somewhere else within the coordinate system of our graph. For this friend, I will color her red by giving the red value to the circle’s fill property.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f3f631eadecfd4e5853b7c8eeacdd9b/href">https://medium.com/media/0f3f631eadecfd4e5853b7c8eeacdd9b/href</a></iframe><p>Your screen should look something like this now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*86BHcVRirKdlrFt5mo2oHg.png" /><figcaption>Two dots. Looks like your phone has eyes now.</figcaption></figure><p>If it doesn’t yet, don’t worry, stay calm and review the code that you have written with the snippets above.</p><h3><strong>Feeling Edgy.</strong></h3><p>Now, we will make these two vertices look like they are connected to each other by drawing a line between them. First, we will create a new Swift file and name it EdgeShape.swift. In this file, we will add a new shape component to SwiftUI by creating a new Struct and making it conform to the Shape protocol and call it EdgeShape.</p><p>This struct will have two properties, start (the starting coordinate of the edge) and end (the ending coordinate of the edge). These will be of type CGPoint.</p><p>To conform to the Shape protocol, this struct must have one method, which is path(in rect:). This method defines how to draw this shape in the UI. In this method’s implementation, we will do four things:</p><ul><li>Create a path object</li><li>Move our path to the starting coordinate by using the path.move(to:) method</li><li>Add a line from the starting coordinate by using the path.addLine(to:) method</li><li>Return our path inside the method</li></ul><p>The code for our EdgeShape should look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/127ff0daf539b074826b464546078775/href">https://medium.com/media/127ff0daf539b074826b464546078775/href</a></iframe><p>Now we can go back to our ContentView.swift file and add the EdgeShape component inbetween our two Circle components in the ZStack to draw an Edge. First, give a start and end value to the EdgeShape constructor by creating two CGPoint objects.</p><p>For the start CGPoint, give its start x and y the same values as our black vertex’s coordinate. Then for the end CGPoint, give its start x and y the same values as our red vertex’s coordinate.</p><p>Notice how the line has still not been drawn yet even though we already used our EdgeShape component. That’s because we have only drawn a path, but we haven’t given it any color or thickness. To do so, give our EdgeShape a stroke, with optional color.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d1d4a6647e8d2e848cfd613574582af/href">https://medium.com/media/4d1d4a6647e8d2e848cfd613574582af/href</a></iframe><p>Yay! You have successfully connected your two vertices with an edge. However, you may notice that your edge seems to be out of place even though you placed your start and end coordinates correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*YpA2az-bPecFlCSIc4sSzg.png" /><figcaption>A stubborn edge not being in the correct place.</figcaption></figure><h3><strong>Fixin’ It!</strong></h3><p>No worries, this behavior is totally expected, because the vertex is aligned by its top left corner to the coordinate we gave it, not the center. We will fix this, along with refactoring our code for our vertex view.</p><p>First, create a new Swift file named VertexView.swift. Import SwiftUI in the file, then create a new struct that extends View named VertexView with a body attribute of type some View.</p><p>This struct will have three other attributes, radius of type Double, color of type Color, and the coordinate of type CGPoint.</p><ul><li>In the body property, we will define a Circle as we have done previously for our vertices then add a color property from our color attribute.</li><li>Then, give the circle its frame attribute with the width and height being the radius multiplied by 2, and an offset attribute with the x and y attributes of the respective coordinate.</li><li>However, we will now subtract the x and y values with the circle’s radius, to offset the circle according to its center.</li></ul><p>Your code should look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a095e264dc50e9ec6ba5fad5910f52a/href">https://medium.com/media/3a095e264dc50e9ec6ba5fad5910f52a/href</a></iframe><p>Now, go back to the ContentView.swift file, then replace each one of our Circle components with our newly built VertexView. Make sure to give the same CGPoint x and y values to each of the first VertexView to the start of our EdgeShape, and the second VertexView to the end of our EdgeShape.</p><p>The code should look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/48667db7d287eb9658559877eb1e7a12/href">https://medium.com/media/48667db7d287eb9658559877eb1e7a12/href</a></iframe><p>Now, our UI should look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*oJsQ4ADbfILfVxMJ8-gNqQ.png" /><figcaption>The start of a graph</figcaption></figure><p>Next, you can experiment with the graph by adding as many vertices and edges as you’d like! Once you have done so, you can try the challenge of automatically showing the vertices and edges of the graph from an array of CGPoint objects! (hint: use an array of CGPoints with the ForEach component in SwiftUI).</p><p>If you got stuck at any point during the tutorial, here’s the <a href="https://github.com/m-salman-a/graph-sample">full source code of the project</a>.</p><p>Also, if you’d like, it would be really nice if you could check out <a href="https://github.com/m-salman-a/refgraph">this project</a> I made using to build a Force-Directed Graph in SwiftUI from the Graph basics we have learned!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b16dc48f7fe6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/building-a-graph-with-swiftui-b16dc48f7fe6">Building a Graph With SwiftUI</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Music using Assembly, Part 2]]></title>
            <link>https://medium.com/@mohammadalfarisi00/making-music-using-assembly-part-2-3f1f1db091ba?source=rss-4d484b2c5c7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f1f1db091ba</guid>
            <dc:creator><![CDATA[M Salman A]]></dc:creator>
            <pubDate>Tue, 28 Sep 2021 12:55:58 GMT</pubDate>
            <atom:updated>2021-09-30T02:59:09.183Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tNGdTKaCdL1-q7djUI1v8g.png" /></figure><h4>In this part of the tutorial, we will learn how to code music with Assembly!</h4><p>This is the second part of the 2 part series on making music with Assembly Language. Now that we have DOSBox all set up for running our program, we will edit using our text editor of choice. You can also edit using other programs, such as emu8086, but I will use Visual Studio Code with the MASM/TASM extension. What I will do might look different from you, but it should work all the same.</p><p>First, make sure that the folder contains a template file (song.asm) You can try playing it using DOSBox using the steps from <a href="https://medium.com/@mohammadalfarisi00/making-music-using-assembly-1e4df1c34f68">Part 1</a>.</p><p>After that, open the file. It might look like there’s a lot going on, but here is the rundown:</p><h3>Data Segment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*riX5hFlgjR8WkhrE7KCwww.png" /><figcaption>Defining each note</figcaption></figure><p>In this segment, you will define the notes that are used in the song. To define a note, write down the name that you want for that note, then use the <strong>dw </strong>keyword. Next, you will write the frequency value of that note, which you can find <a href="http://muruganad.com/8086/8086-assembly-language-program-to-play-sound-using-pc-speaker.html">here</a>. You can define each note by its name (C, C#, D, etc.) or by Solfège (Do, Re, Mi, etc.).</p><h3>Code Segment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*GnVgBufA6dX9rM8XlFtSjw.png" /><figcaption>Example of a procedure</figcaption></figure><p>In this segment, there are some macros and procedures that you will use to make sounds. Try to understand what these macros and procedures do from the comments!</p><h3>Startup Segment to End Segment</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*ruCZKbP8XPSkYJ1MllTCNw.png" /></figure><p>This segment is where you will play each note, similar to a piano.</p><ul><li>To start playing a note, use the <strong>pencet </strong>macro and give it the note that you have defined in the data segment for the argument (Example: pencet C).</li><li>To keep playing that note, use the <strong>delay </strong>procedure.</li><li>To stop playing a note, use the <strong>matisuara </strong>procedure. If you call delay after matisuara, it will be a pause.</li></ul><p>Now, you can run the program that you have made using DOSBox to start listening. If you forget how to do so, refer back to <a href="https://medium.com/@mohammadalfarisi00/making-music-using-assembly-1e4df1c34f68">Part 1</a> of this tutorial.</p><h4><strong>Your task now is to code 30 seconds of your favorite song in Assembly</strong></h4><p>That’s it! Now you know how to code music using Assembly! Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f1f1db091ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Music using Assembly, Part 1]]></title>
            <link>https://medium.com/@mohammadalfarisi00/making-music-using-assembly-1e4df1c34f68?source=rss-4d484b2c5c7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e4df1c34f68</guid>
            <category><![CDATA[music]]></category>
            <category><![CDATA[assembly]]></category>
            <category><![CDATA[dosbox]]></category>
            <dc:creator><![CDATA[M Salman A]]></dc:creator>
            <pubDate>Mon, 27 Sep 2021 16:09:48 GMT</pubDate>
            <atom:updated>2021-09-29T11:53:17.738Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mX_FeyZPycA781W6" /><figcaption>Photo by <a href="https://unsplash.com/@marius?utm_source=medium&amp;utm_medium=referral">Marius Masalar</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Yes! Today, we will make an 8-bit cover of your favorite song, using a program called DOSBox and everyone’s favorite programming language, Assembly. 🙂</h4><p>This is Part I of II, where I will go over the introduction to what we will be doing today, and how to use the DOSBox program. We will start making music using Assembly in the second part of the tutorial.</p><p>Here are the things you will need</p><ul><li>Basic knowledge of Assembly programming</li><li>DOSBox program</li><li>An assembler (in this tutorial I will be using TASM)</li><li>A text editor (VS Code, Notepad++, even Notepad will work)</li></ul><p><a href="https://drive.google.com/drive/folders/1oaT1pLaoAIt6e14caI6i1k_Fs_X1DR8H?usp=sharing">Here are the files I will use in this tutorial</a>.</p><p>An IDE such as emu8086 is optional, and could help when inspecting the registers of the 8086 processor.</p><h3>Introduction to DOSBox</h3><blockquote>Soo.. what is DOSBox?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*1PQhbjbLT2NHdqFw6t-FgA.png" /><figcaption>DOSBox User Interface</figcaption></figure><p>DOSBox is an emulator of the old operating system DOS, short for <em>disk operating system. </em>The DOS operating system is a family of operating systems made by different manufacturers, and is most known for Microsoft’s MS-DOS. Through DOSBox you can play old games and try the DOS operating system the exact same way as it was made in the 80&#39;s.</p><p>We will be using DOSBox to play the music that we have made.</p><h3>Getting Started</h3><p>To get started, we need to setup the environment first. You will need to first download and install DOSBox from <a href="https://www.dosbox.com/download.php?main=1">this link</a>.</p><p>First, create a new folder somewhere and put your assembler &amp; linker files inside (TASM.exe &amp; TLINK.exe). I will put mine on the Desktop. Inside, I will also put some sample files (hello.asm &amp; song.asm) to make sure everything is working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*1Z9Bx6rCAnESAZeu0jaEfQ.png" /><figcaption>Files inside of the folder</figcaption></figure><h3>Running your first program in DOSBox</h3><p>Before we can run a program in DOSBox, we must compile it first to convert it from assembly language to machine code.</p><p>You can start by running the DOSBox program that you have installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*ea4RcAaGTERcByCDSZ5FWA.png" /></figure><p>Then, we need to mount the folder that contains our files to DOSBox. To do that, use the <strong>mount </strong>command in DOSBox. The first argument should be a drive name such as C:, and the second argument should be the path to your folder. For example, I put my folder on the Desktop, so it looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*7YtUtRK1cPrIgcMdGKDl9Q.png" /></figure><p>If it works, then you should be able to access your folder by going to the drive using <strong>c:</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/105/1*yqkHTCqWIFwLyr1_qYYS1w.png" /></figure><p>You can use <strong>dir </strong>command to check if all your files are there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*z3DHAPrpID5iC1ZaDQXDjg.png" /></figure><p>If you see that your file is in the folder, then all is well. Also, DOSBox might shorten your file name if its too long, usually ending in ~1 or ~2. Next, we will compile the file using the <strong>tasm </strong>command and give the filename as the argument.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*J2hg7oKJUBEnaNG0yhhwZQ.png" /></figure><p>This will create a .obj file inside of the directory. Next, we will use the <strong>tlink </strong>command to link our object file and turn it into executable machine code (.exe). Use the file name without the extension as the argument.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*VcdmN3cJ-9SXssqxYQUexQ.png" /></figure><p>Now we have our executable file! To run it in DOSBox, simply type the file name. We should see the program output a “Hello, World!”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*RPt3MaqsEd3baL9pul2W8g.png" /></figure><blockquote><strong>QUICK WARNING</strong>: I would not recommend running these files directly on your terminal, only use DOSBox to run them. While it is unlikely, you may crash your system. I am not responsible for anything that happens.</blockquote><p>Now we have the environment set up to play music in DOSBox. In <a href="https://medium.com/@mohammadalfarisi00/making-music-using-assembly-part-2-3f1f1db091ba">Part 2</a>, we will start making music using Assembly Language!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e4df1c34f68" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>