<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>FreeBASIC Insight</title>
	<link>http://insight.freebasic.net</link>
	<description>A fresh perspective on an old community</description>
	<pubDate>Tue, 14 Nov 2006 02:17:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>The Eternal Noob and the Noob Ladder</title>
		<link>http://insight.freebasic.net/archives/the-eternal-noob-and-the-noob-ladder/</link>
		<comments>http://insight.freebasic.net/archives/the-eternal-noob-and-the-noob-ladder/#comments</comments>
		<pubDate>Tue, 14 Nov 2006 02:17:05 +0000</pubDate>
		<dc:creator>hartnell</dc:creator>
		
	<category>Articles</category>
		<guid isPermaLink="false">http://insight.freebasic.net/archives/the-eternal-noob-and-the-noob-ladder/</guid>
		<description><![CDATA[(note to management, this is just a draft as I collect my thoughts for this article, it shouldn&#8217;t be published anytime soon)
I suppose that I&#8217;m getting a well-earned reputation for writing for and about noobs. This begs the question, am I, hartnell, a noob myself? Could I possibly suffer to wear this title? You betcha! [...]]]></description>
			<content:encoded><![CDATA[<p>(note to management, this is just a draft as I collect my thoughts for this article, it shouldn&#8217;t be published anytime soon)</p>
<p>I suppose that I&#8217;m getting a well-earned reputation for writing for and about noobs. This begs the question, am I, hartnell, a noob myself? Could I possibly suffer to wear this title? You betcha! I, before everyone in the FreeBASIC community, fully confess am a bona-fide, know-nothing, noob from the pits of noobiedom. And the thing is, I&#8217;ve been programming for over 20 years.</p>
<p>I&#8217;ve written numerous web games in Php. I&#8217;ve reinvented arcade classics from the ground up. I&#8217;ve documented programming languages. I fondly recall my VIC-20 and Tandy 1000 through tear stained eyes. And yet, I am a noob. Confused? Good. Let&#8217;s continue.</p>
<p>I am an eternal noob. I&#8217;ve just given you some of my accomplisments and I&#8217;ll tell you what - 3D mystifies me. Artificial intelligence rattles my brain. Microprocessor architecture makes it stop completely. For everything I know, theres tons more that I can&#8217;t yet comprehend.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://insight.freebasic.net/archives/the-eternal-noob-and-the-noob-ladder/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Doing It Yourself (A Series on Self Sufficiency). Part One</title>
		<link>http://insight.freebasic.net/archives/doing-it-yourself-a-series-on-self-sufficiency-part-one/</link>
		<comments>http://insight.freebasic.net/archives/doing-it-yourself-a-series-on-self-sufficiency-part-one/#comments</comments>
		<pubDate>Sat, 09 Sep 2006 15:56:53 +0000</pubDate>
		<dc:creator>MystikShadows</dc:creator>
		
	<category>Articles</category>
		<guid isPermaLink="false">http://insight.freebasic.net/archives/doing-it-yourself-a-series-on-self-sufficiency-part-one/</guid>
		<description><![CDATA[INTRODUCTION:
In today’s computer world, a programmer (new comer or experienced) often finds himself or herself needing a specific tool.  Sometimes, finding that tool is rather easy especially if one is willing to sacrifice feature to save himself the trouble of creating his own set of tools.  On the other hand, when you really [...]]]></description>
			<content:encoded><![CDATA[<p><strong>INTRODUCTION:</strong></p>
<p>In today’s computer world, a programmer (new comer or experienced) often finds himself or herself needing a specific tool.  Sometimes, finding that tool is rather easy especially if one is willing to sacrifice feature to save himself the trouble of creating his own set of tools.  On the other hand, when you really get down and do what you know you’ll need and can’t find anything that matches every feature you are looking for, creating them yourself can be one of the most rewarding projects you can get yourself into.  Some of the main reasons why are:</p>
<p>1.	You can give your application the look and feel you want, you’re in control.<br />
2.	You can make it work the way you want, if you like a certain way of working, nothing’s stopping you from making your project work exactly that way.<br />
3.	You can set your own standards for code, code quality, naming conventions making the work even more enjoyable based on how you like to work.<br />
4.	Best reason, there’s nothing quite as fun as programming on a project that you want to program on.  </p>
<p>There are more reasons of course, the sheer reward of making your own tools in itself is quite rewarding.  Depending on the tool or application you want to make yourself, some research might be in order if you’re not too familiar with the domain.  That too can be very rewarding.  Not to mention it can broaden your field of personal knowledge quite a bit.  </p>
<p><a id="more-11"></a></p>
<p><strong>ESTABLISHING YOUR OWN NEEDS:</strong></p>
<p>I’m sure you’ve heard me at some point complain about windows, express how much I love DOS and text based programs, etc… That shouldn’t be a secret to many people reading this.  So I decided to do something about it.  I started taking notes, organizing the different aspects of the project.  But before I go there, I want to let you know how I defined, so to speak, the needs of that project.  Hence, how I got the inspiration to create Developer’s Desktop.</p>
<p>It all started when I wrote my <a href="http://www.petesqbsite.com/sections/express/issue12/#guievolution">Evolution Of GUIs</a> article, looking at all these classic GUIs I came across <a href="http://toastytech.com/guis/deskmate.html">Tandy’s Deskmate</a>.  Now sure it’s success wasn’t too long lived, but it did that certain something I liked about it.  For instance, the ability to get windows of files. A visual window of files, where you could then view more than one directory at one time.  I just liked that “see it all” aspect of it. Now, since I wrote that article, I’ve been juggling this concept in my head, trying to see if today, it was possible to make something like that, but better for today’s type of work.  Hence was born the Developer’s Desktop project.</p>
<p>Here&#8217;s are 2 screenshots to give you an idea of what Developer&#8217;s Desktop will look like.  This first screenshot is the desktop area itself.  This is where it all starts.</p>
<p><center><img id="image12" src="http://insight.freebasic.net/wp-content/uploads/dddesktop.png" alt="dddesktop.png" /> </center> </p>
<p>This next screenshot is from one of the applications, this one is the project manager.  The screenshot shows the project tasks on the left and their time lines on the &#8220;gantt view&#8221; representation on the right.</p>
<p><center><img id="image13" src="http://insight.freebasic.net/wp-content/uploads/ddprojects.png" alt="ddproject.png" /></center></p>
<p>Basically, once I got the idea, a bunch of questions raised in my head.  When you start asking your questions about a project (whatever the type of project) of course you’re trying to cover all the grounds that you can at least think of.  This helps to determine things like how many things you’ll need to do, what you need to think about, etc… So then, Here are some of the questions I asked myself.</p>
<p>1.  What will it look like?<br />
In my case, I had my inspiration for the looks, I wanted, essentially, a text version of the Tandy DeskMate application.  I wanted the file list windows, the calendar, to do list, calculator.  All can be positioned wherever you want on the desktop.  So I used the same color palette as Deskmate but in Text mode.</p>
<p>2.  How will it work?<br />
Once again, I aimed to offer the same type of functionality and organization that can be found in DeskMate.  Although at a Text based level, I wanted to offer the same “features and functionalities” that could be found in DeskMate (and more).  DeskMate is aimed at everybody.  Developer’s Desktop is aimed at programmers.  This mean that I wanted it to both be useful to as many people as possible.  But, I also wanted to add enough features to give developers the flexibility to have Developer’s Desktop work like they do.  This started to give me some serious design issues which I’ve overcome just by thinking about all the different ways people could/would use this system.</p>
<p>3.  What can it do?<br />
I know what DeskMate offers, and well I wanted to offer at least that much so it will do Text based word processing, spreadsheet, databases and everything else DeskMate offers.  But on top of that, I also wanted to offer even more tools and programs to make DeskMate both more useful to everyone and more useful to programmers (of course).  As such, home accounting, home inventory specific programs will be made, as well bank related programs (like you might find in Microsoft money) the best it can be done in a text based program.  For developers, Project management, scheduling, planning will all be present, code editors that can call the compilers in just about any language will be there as well.  Some analysis and text based visual design tools to help with the creation of objects and modules will also be present.  And whatever else I can think of that the developer could make good use of.  </p>
<p>Just from these three questions you can guess that I have a lot to do.  And I’ve already covered a lot of aspects of what would be in Developer’s Desktop.  I now have the start of a “to do” list that I’ll be able to follow.  With this bunch of tools and applications planned to be implemented.  You might wonder how it’s all going to fit together.  Of course, since this is an environment, I’ll want things to look like they all fit together somehow. So basically, the idea to create a set of visual design rules, similar to those of DeskMate had to be.  All the same visual aspects, locations, colors and sizes as needed are followed through in the design of any tool and application that will be part of this project.  Add to that a keyboard standard where a given key combination performs the same action throughout all applications and you have yourself a good standard to follow throughout the development of all tools and applications.</p>
<p><strong>SPECIAL NOTES:</strong></p>
<p>What you’ve read so far was for my particular project.  I had a set of needs that I want to build into a solution.  Sure in my case, I want it to be as useful to as many people as possible.  So I had to be open minded about how to design something that can be used so many different ways.  Maybe in your case, you only need one specific way of doing things.  Maybe my example inspired you to think about “different people working different ways” with your application.  That’s all great.  The important thing is to think about it for a sec and ask yourself the right questions to really put on paper what you need for what you are doing.</p>
<p>As far as keyboard standards, mouse standards and User Interface standards, well in my case they become important because if all the applications work the same way, I’ve cut down, considerably, the learning curve of all the applications making my project useful as soon as possible.  If you’re making one program only, you can think about which keyboard shortcuts you want to use, but since it’s just one program, a standard is not as needed.  The same goes for User Interface design.  Making my programs all look the same helps the users visually find what they expect to find in the same place also helping with the learning curve.  </p>
<p>Of course, if you’re project is a game, things can also be considered very differently.  No matter what the project type is, I think that asking these three questions will at least put you on the right track to ask the right questions for the project.  If you are doing a paint program or some kind of graphic editor, again you have to take the type of project into consideration when asking the questions and designing the look and feel.  When you don’t have a clue about how a project should look and feel to the users, your best bet is to do some internet search for similar things.  You might get some great ideas to get you started just by doing that.   Typically, programs that have been around for a while have a reason to exist for so long, they must have done something right.  So it can prove to be a great learning experience to take the time to do some research.</p>
<p><strong>IN CONCLUSION:</strong></p>
<p>Some people think that we’re created just about everything that can be created with a computer.  There’s nothing new to create anymore.  To that I answer we’ve been so busy making the computer do what we don’t want to do that we’ve forgotten that we haven’t even begun to create things with a computer.  There’s so many things left to do it can’t be mentioned in a list because it doesn’t exist yet.  Just think about it, aside games, the rest of the programs make computers do what we, as humans don’t want to do.</p>
<p>This brings this first part to an end. I think as far as “establishing the needs” we’ve covered most of what we need to know.  Just remember that in the case of your project, things can be very different.  It’s just important, especially in bigger projects, to sit down first and set things up on paper.  It helps at the start and keeps on helping all the way to the finished project.  For one thing, it doesn’t stop you from adding to that last after.  It just gives you a good solid starting point from which to do your work.  </p>
<p>In the next part, I’ll go more into details, the main idea is to document my project as I go along when the time comes to coding, I’ll also comment my source and basically explain what I’ve been through while I was making the project.  This is a pretty big project and it should give me a chance to talk about a lot of experiences you might go through in your “bigger” projects too.  The kind of thing that can happen, some situations, and basically walk you through my minding and thoughts as I face the situations see how I cope with them so you can  get a glimpse at what you could be up against in your own programming projects.  Feel free to comment or ask questions by emailing me or by leaving comments here on the insight website.  Until the next installment happy planning and coding.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://insight.freebasic.net/archives/doing-it-yourself-a-series-on-self-sufficiency-part-one/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>The Noob&#8217;s Robot Slave and How To Re-activate it</title>
		<link>http://insight.freebasic.net/archives/the-noobs-robot-slave-and-how-to-re-activate-it/</link>
		<comments>http://insight.freebasic.net/archives/the-noobs-robot-slave-and-how-to-re-activate-it/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 12:47:26 +0000</pubDate>
		<dc:creator>hartnell</dc:creator>
		
	<category>Articles</category>
		<guid isPermaLink="false">http://insight.freebasic.net/archives/the-noobs-robot-slave-and-how-to-re-activate-it/</guid>
		<description><![CDATA[The FreeBASIC community is an interesting one. It came into being like a phoenix, rising from the ashes of the QBASIC community (even though we still call it the Qmunity). QBASIC programmers have brought with them the long experience of decades. After all, if you know QBASIC, you&#8217;re right at home with FreeBASIC. Unfortunately, with [...]]]></description>
			<content:encoded><![CDATA[<p>The FreeBASIC community is an interesting one. It came into being like a phoenix, rising from the ashes of the QBASIC community (even though we still call it the Qmunity). QBASIC programmers have brought with them the long experience of decades. After all, if you know QBASIC, you&#8217;re right at home with FreeBASIC. Unfortunately, with all these experienced programmers around, it seems that we have forgotten something vital : The Noob&#8217;s Robot Slave. I&#8217;ve written this article to remind you what that is and give you proper instructions for re-activating it.</p>
<p>Most of us started programming BASIC a decade or more ago, and yes, that&#8217;s a long time. Some of us started with the Vic-20, some of us started with QBASIC. No matter what each of us started with, we all started the same way : with an amazing computer. Our very own electronic brain.</p>
<p><a id="more-9"></a></p>
<p>You should remember that time. Back then, computers were not as common as they are today. Having your own computer was something special, something exiciting. Before you even had your own computer you had heard about the wondrous things it could do. It could play games, it could balance your checkbook, it could play games, it could help you write your report, and it could play games. All it needed was a disk or cassette tape and your amazing new electronic brain could do anything. Anything!</p>
<p>But then, one day, you found out that you could turn this digital genius to your own nefarious purposes. So you opened the manual, read about a few commands, and few minutes later, the screen probably looked like this :</p>
<p><code>READY.<br />
10 PRINT "I AM YOUR LOYAL AND OBEDIENT ROBOT SLAVE."<br />
READY.<br />
RUN<br />
I AM YOUR LOYAL AND OBEDIENT ROBOT SLAVE<br />
READY.</code></p>
<p>In sheer amazement, you discovered that you had your own robot slave. You didn&#8217;t need premade software. You, yourself, could make your amazing electronic brain do anything. Anything! Bwa ha ha ha! All that was left now was to learn how to tell it to do your evil deeds. </p>
<p>So you read  the manual some more. You bought some books with short and sweet BASIC games in them. Some of them I&#8217;m sure you fondly remember. You discovered how to make a random insult generator, a space trading game, or a simple interactive story - usually in less than 100 lines of code. These little games taught by example as you spent many happy afternoons playing with their code. You improved the code, added new features, and changed the name of the evil nemesis to the name of your math teacher.</p>
<p>Eventually, you learned how to make your own games. A bit of code from here, a bit of code from there, a bit of sweat, creativity and ingenuity and your latest, greatest work was complete! You worked on more projects. Made better games. Experimented with dubious code of your own design. You poked your robot slave to give you all of its secrets. After all, you had become its complete master.</p>
<p>This is the simple joy of programming, and how it turns a noob into a good programmer. </p>
<p>The FreeBASIC community  is lacking in this kind of experience. It seems we are focused on cutting-edge programming techniques. We marvel at all the new things that FreeBASIC can do that QBASIC couldn&#8217;t. We gawk in awe at the newest 3D demos while our roots lie withering. </p>
<p>Its sad that all these great little programs and games, so often ported to QBASIC during the days of yore, are almost completely  forgotten in FreeBASIC.  And few new ones are being written. This is natural, considering the phoenix-like birth of FreeBASIC. It came fully formed, ready to continue on from where QBASIC died.  Unfortunately, the robot slave lies in the ashes of the phoenix, and with it, the sheer piss in your pants joy of programming. </p>
<p>We need to help noobs have the same fun experiences we had with the same types of games. We need to re-embrace simple, creative text games that the noob can write and understand. They need to discover that they, too, have a robot slave in their computer, learn to tell it to do nefarious deeds, and eventually master it in almost exactly the same way we did.</p>
<p>So write a random insult generator, a space trading game, or a simple choose-your-own-adventure style game. They&#8217;re not outdated, they&#8217;re our roots. Post them in the FB Game Dev forum, make your own website about them, or even write an ebook full of them.  You&#8217;ll be helping future FB noobs, preserving our roots,  rediscovering the joy of programming, and who knows, you could become the next David Ahl or Tim Hartnell.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://insight.freebasic.net/archives/the-noobs-robot-slave-and-how-to-re-activate-it/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>How to write for FreeBASIC Insight</title>
		<link>http://insight.freebasic.net/archives/how-to-write-for-freebasic-insight/</link>
		<comments>http://insight.freebasic.net/archives/how-to-write-for-freebasic-insight/#comments</comments>
		<pubDate>Thu, 17 Aug 2006 14:03:18 +0000</pubDate>
		<dc:creator>aetherFox</dc:creator>
		
	<category>Site News</category>
		<guid isPermaLink="false">http://insight.freebasic.net/archives/how-to-write-for-freebasic-insight/</guid>
		<description><![CDATA[It has been brought to my attention recently that it is not completely clear how to submit an article to us.  I thought to clarify the procedure.  Rather, I thought to actually make a proper procedure.

Once you have written an article, tutorial, code snippet or little trick you want to share with the [...]]]></description>
			<content:encoded><![CDATA[<p>It has been brought to my attention recently that it is not completely clear how to submit an article to us.  I thought to clarify the procedure.  Rather, I thought to actually make a proper procedure.</p>
<p><a id="more-7"></a></p>
<p>Once you have written an article, tutorial, code snippet or little trick you want to share with the world via FreeBASIC Insight, simply fill out our snazzy <a href="http://insight.freebasic.net/submissions/">article submission form</a>.</p>
<p>There are a few things to note.  Firstly, <strong>we will not accept every submission</strong>.  We want to maintain a high level of quality on this website, so writing that is substandard will not be accepted.  Barring a few typos, try the following:</p>
<ul>
<li>Write proper, structured American English.</li>
<li>Be reasonable in your writing (e.g. no swearing, unnecessary digression).</li>
<li>Submit your document in a plaintext document.  Separate paragraphs, code etc. with whitespace and proper HTML tags.  Use the following HTML tags only: p, code, strong, em.</li>
<li>Do not provide your own syntax highlighting for the code your provide, or try to style the HTML.</li>
<li>Any accompanying code or data should be in a zip-compressed archive.</li>
</ul>
<p>If it is something small (like the document is an HTML file as opposed to a TXT file), it should not be a major problem, but we cannot guarantee we will spend time fixing your submission.</p>
<p>Once you&#8217;ve submitted your document via email, expect to receive a response in a few days.  If your submission was not accepted, one of us will detail the reason why.  You are absolutely welcome to try again, following the above guidelines.</p>
<p>If we like what we read, we will provide you with the login details for your own account on FreeBASIC Insight.  This &#8216;Contributor&#8217; account will allow you to post your article straight to the main page.  The reason we do this and not actually post ourselves is for several reasons.  Firstly, the article is immediately associated with you.  It will be tagged with your name, and will show up in the archives as yours.  Secondly, if you submit future articles, the same applies.  Your articles will be grouped together in the archives and your record at this website will remain intact so long as the database does not implode.</p>
<p>However, you will still <strong>not</strong> have the freedom to post what you want, when you want.  Each article will have to go through the submission process.  This is something we cannot stress seriously enough, and if it occurs, we will place a permanent ban to that user on this website.</p>
<p>Eventually, if you produce a stream of top-notch content, and we fall in love with you, we may ask you to join us &#8220;full-time&#8221;.  You will be promoted to the role of &#8216;Author&#8217; and have the freedom to post what you want, when you want.  You illll instantly gain cool status with all your friends, as well as having the authority to strut around like a pirate because you are one of us.  Hey, we do it.</p>
<p>I hope this clarified things.  Let me know if there is something else that should be said or something that should be said differently.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://insight.freebasic.net/archives/how-to-write-for-freebasic-insight/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>So, what now?</title>
		<link>http://insight.freebasic.net/archives/so-what-now/</link>
		<comments>http://insight.freebasic.net/archives/so-what-now/#comments</comments>
		<pubDate>Wed, 16 Aug 2006 09:31:44 +0000</pubDate>
		<dc:creator>aetherFox</dc:creator>
		
	<category>Site News</category>
		<guid isPermaLink="false">http://insight.freebasic.net/archives/so-what-now/</guid>
		<description><![CDATA[Update:  I have added several (hopefully) cool new features.  The main page has received an upgrade of its sidebar - with a better mini archive, recent comments and a nifty translation service (via Google Translate).  There is now a dedicated submissions form, too.  More to come.
You&#8217;ve read a couple of articles, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>:  I have added several (hopefully) cool new features.  The main page has received an upgrade of its sidebar - with a better mini archive, recent comments and a nifty translation service (via Google Translate).  There is now a dedicated submissions form, too.  More to come.</p>
<p>You&#8217;ve read a <a href="http://insight.freebasic.net/archives/fb-c/">couple</a> of <a href="http://insight.freebasic.net/archives/freebasic-inline-assembly-introduction-registers/">articles</a>, maybe browsed through the <a href="http://insight.freebasic.net/archives/">archives</a> and taken a look at the <a href="http://insight.freebasic.net/about/">About</a> page.</p>
<p><a id="more-6"></a></p>
<p>What now?  What would you like to see that&#8217;s different?  New features or additions to the website?  Changes to something currently on the site?</p>
<p>Here&#8217;s what we&#8217;re looking into:</p>
<ul>
<li>Auto-magic syntax highlighting of the source code</li>
<li>Live preview of comments</li>
<li>Export individual articles</li>
</ul>
<p>Let me know what you think.  I couldn&#8217;t guarantee everything will be implemented, but I&#8217;ll try to gradually add as much as I can.</p>
]]></content:encoded>
			<wfw:commentRSS>http://insight.freebasic.net/archives/so-what-now/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>An Introduction to Inline Assembly and Registers</title>
		<link>http://insight.freebasic.net/archives/freebasic-inline-assembly-introduction-registers/</link>
		<comments>http://insight.freebasic.net/archives/freebasic-inline-assembly-introduction-registers/#comments</comments>
		<pubDate>Tue, 15 Aug 2006 14:23:48 +0000</pubDate>
		<dc:creator>Unknown</dc:creator>
		
	<category>Tutorials</category>
		<guid isPermaLink="false">http://insight.freebasic.net/archives/freebasic-inline-assembly-introduction-registers/</guid>
		<description><![CDATA[Without much dispute, FreeBASIC is one of the most powerfull BASIC compilers created to date. With the combination of its standard BASIC features to its advance features, (pointers, C/C++ library support, etc&#8230;) FreeBASIC supplies its users with the familiarity of classic BASIC, but ability beyond what BASIC users have experienced. However, even with FreeBASIC&#8217;s array [...]]]></description>
			<content:encoded><![CDATA[<p>Without much dispute, FreeBASIC is one of the most powerfull BASIC compilers created to date. With the combination of its standard BASIC features to its advance features, (pointers, C/C++ library support, etc&#8230;) FreeBASIC supplies its users with the familiarity of classic BASIC, but ability beyond what BASIC users have experienced. However, even with FreeBASIC&#8217;s array of potent features, few of its users have ever embraced its most powerful feature, &#8216;Inline Assembly&#8217;.</p>
<p><a id="more-5"></a></p>
<p>Assembly is the first PC programming language. It is considered &#8220;low-level&#8221;, because it&#8217;s functionality and syntax is greatly dependant on the target system&#8217;s architecture. Whereas BASIC is considered &#8220;high-level&#8221;, because it&#8217;s functionality and syntax is designed to remain consistent despite its targeted system&#8217;s architecture. The advantage of high-level languages is their syntax and grammar greater resembles that of spoken languages. The greatest advantage of low-level languages is their speed. However, low-level languages, (such as Assembly) hardly resemble spoken languages. For this reason, they are often intimidating to even the more experienced programmers. Fortunately, programming FreeBASIC&#8217;s inline assembly is notably simpler than programming  Assembly alone.</p>
<p>To inform FreeBASIC that a line of code is written in Assembly, it must be preceded by the keyword <strong>Asm</strong>. Such as:</p>
<p><code>Asm ...</code></p>
<p>If more than one line of Assembly is being used, it can be included with an <code>Asm</code> block:</p>
<p><code>Asm<br />
...<br />
End Asm</code></p>
<p>Keep in mind, all variables and procedures declared previous to the <code>Asm</code> statement or block are accessible by the <code>Asm</code>statement or block. Which will be demonstrated.</p>
<p>As with any language, one of Assembly&#8217;s fundamentals is data transferring. However, in Assembly, data can never be transferred directly from one memory location to another. It must first be transferred to hardware-embedded variables known as registers. These &#8216;variables&#8217; are Intel created. These registers have varying sizes, that range from 8bit to 32bit. The 8bit registers include AL, AH, BL, BH, CL, CH, DL, DH. The 16bit registers are AX, BX, CX, DX, BP, SP, DI, SI. Lastly, the 32bit registers consist of EAX, EBX, ECX, EDX, EBP, ESP, EDI, ESI. Each of these registers, (or hardware-embedded variables) serve specific purposes during certain circumstances. To avoid confusion their situation-specific purposes will be mentioned only when necessary.</p>
<p>In order to store data within any register, the chosen register&#8217;s size must be equal or greater than that of the data. For instance, an 8bit register can not hold 32bits of data, but a 32-bit register can, logically, hold 8 bits of data. To transfer data, one would use the <code>Mov</code> command, (also know as a &#8220;mnemonic&#8221; in Assembly). Its format is:</p>
<p><code>Mov SizeOverride Operand1, Operand2</code></p>
<p><code>SizeOverride</code> is not required, but if included specifies the amount of data being transferred. The possible size overrides are:</p>
<ul>
<li>Byte (move 8 bits)</li>
<li>Word (move 16 bits)</li>
<li>DWord (move 32 bits, or a Single)</li>
<li>QWord (move 64 bits, or a Double)</li>
</ul>
<p>Both <code>Operand1</code> and <code>Operand2</code> can either be registers, immediate data, or memory locations. Immediate data is either a literal number, (such as 5 or 3), or a FreeBASIC variable&#8217;s name. How to specify memory locations will be covered shortly. There are certain criteria when transferring data that must be satisfied:</p>
<ul>
<li><code>Operand1</code> is always the destination of the moved data</li>
<li><code>Operand2</code> is always the source of the moved data</li>
<li>both <code>Operand1</code> and <code>Operand2</code> can be registers, (even the same register) but both registers must be of the same size</li>
<li><code>Operand1</code> can never be immediate data</li>
<li><code>Operand1</code> and <code>Operand2</code> can not both be memory locations</li>
</ul>
<p>A memory location is specified by simply including a register, certain combinations of registers, immediate data, or a combination of these within braces ([ ]). The only registers that can be used to specify a memory location on their own or in combination with immediate data include BX, SI, DI, EAX, EBX, ECX, EDX, EBP, ESI, EDI. However, the following pairs of registers can be used to specify a memory location by themselves or with immediate data:</p>
<ul>
<li>BX+SI</li>
<li>BX+DI</li>
<li>BP+SI</li>
<li>BP+DI</li>
</ul>
<p>In the case of a pair of registers the sum, (and only the sum) of the specified registers&#8217; values will determine the memory location. To better understand data transferring let us study the various scenarios. Throughout these examples various registers will be used. For simplicity&#8217;s sake, assume these registers&#8217;s values have been preset as necessary. Suppose we need to move data from one register to another.</p>
<p><code>Asm Mov BL, AL</code></p>
<p>Now the register BL contains the same data as that of AL. Remember, when transferring data amongst registers both registers must be the same size. Now, let us see how to move the contents of a register to the memory location indicated by the register EAX:</p>
<p><code>Asm Mov [EAX], AL</code></p>
<p>When a register&#8217;s data is being transferred to memory, the register&#8217;s size dictates how much memory is effected. Also, notice that the registers&#8217; sizes do not match. This is permitted, because the contents of register AL are not being transferred to register EAX, but rather to the memory location specified by EAX. Now, study this example:</p>
<p><code>Mov [BX+SI], AL</code></p>
<p>This example is quite similar to the previous. In this example though, the contents of register AL are stored at the memory location indicated by the sum of the registers BX and SI. Any of the valid pairs of registers previously mentioned may be used. These were randomly chosen solely for example. A register&#8217;s data can even be stored in a variable. Let us assume there is a FreeBASIC variable named Number, of data type <code>Long</code> (32-bit), that has the value 5 and that register CL contains the value 10.</p>
<p><code>Dim Number As Long = 5<br />
Asm Mov [Number], CL</code></p>
<p>The intention would be to store the value 10 in the variable Number. Keep in mind, though, when transferring data from a register to memory the register&#8217;s size dictates how much memory is stored and effected. In this example the contents of register CL is stored in the variable Number. However, since Number is 32 bits and CL is 16 bits only half of Number is altered. This can cause different results than expected. To ensure that the appropriate value is stored in Number, use a register of the same size. Let us now assume ECX contains the value 10.</p>
<p><code>Asm Mov [Number], ECX</code></p>
<p>Now, since both Number and register ECX are 32-bit, all of Number is effected and the expected outcome of this statement would be accurate. The variable Number now holds the value 10. One can use a literal number to specify a memory location. Such as:</p>
<p><code>Asm Mov [012345], ECX</code></p>
<p>However, this can be dangerous. Remember, the operating system and other software are using memory as well. Altering their reserved memory can have unpredictable results. Let us now view how to transfer data from memory to a register.</p>
<p><code>Asm Mov ECX, [BX+SI]</code></p>
<p>By default, The register&#8217;s size determines the amount of data that will be transferred to it. Therefore, in this example, 32 bits, (from the memory location indicated by the sum of registers BX and SI) are stored in register ECX. To ensure that a certain number of bytes is transferred use a size-override.</p>
<p><code>Asm Mov Word ECX, [BX+SI]</code></p>
<p>Now 16 bits of data would be transferred from the specified memory location to the chosen register. However, 16 bits is only half of register EAX&#8217;s size. The outcome of this statement may still not be as predicted.</p>
<p><code>Asm Mov DWord ECX, [BX+SI]</code></p>
<p>In this example 32 bits of data would be transferred from the specified memory location to register ECX. Since the register&#8217;s size and the size of data being stored into the register are the same this statements outcome would be accurate. Of course, a variable&#8217;s data can be transferred to a register as well. Let us assume, again, there is a FreeBASIC variable named Number, of data type Long, that has the value 5.</p>
<p><code>Dim Number As Long = 5<br />
Asm Mov ECX, [Number]</code></p>
<p>Register ECX would now contain the value 5. Now, assume there is a variable named Number, of data type Double, that has the value 5.1234 . Since variables of data type Double are 64 bits in size, and none of the registers mentioned are 64 bits, one could not transfer the contents of a variable of data type double to any of the mentioned registers. However, the address of a variable of data type Double could, indeed, be stored into a 32-bit register. Although mathematics (both integer and floating-point) will not be discussed as of yet, this is important to remember when the subject is discussed.</p>
<p><code>Dim Number As Double = 5.1234<br />
Dim Adr As Long = @Number<br />
Asm Mov EAX, [Adr]</code></p>
<p>Register EAX now contains the address of the FreeBASIC variable Number. Notice the use of a 32-bit register. Obviously, 32-bit operating systems use 32-bit addresses. Using a 32-bit register ensures the whole address is stored. The case of variables of data type String is similar. Since strings can be of virtually any size, only a string&#8217;s address should be stored in a 32-bit register. Such as:</p>
<p><code>Dim MyString As String = "some text"<br />
Dim Adr As Long = StrPtr(MyString)<br />
Asm Mov EAX, [Adr]</code></p>
<p>Notice that the FreeBASIC function <code>StrPtr</code> was used to retrieve the string&#8217;s address. This is because strings in FreeBASIC include headers, (or &#8216;descriptors&#8217;). To retrieve the actually location of the string&#8217;s characters, <code>StrPtr</code> must be used.</p>
<p>This concludes general data transferring using FreeBASIC&#8217;s inline Assembly. With this knowledge, one is prepared for Integer Mathematics using inline Assembly. Which will be discussed in the next lesson of this tutorial.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://insight.freebasic.net/archives/freebasic-inline-assembly-introduction-registers/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>FB == C++?</title>
		<link>http://insight.freebasic.net/archives/fb-c/</link>
		<comments>http://insight.freebasic.net/archives/fb-c/#comments</comments>
		<pubDate>Sun, 13 Aug 2006 19:37:56 +0000</pubDate>
		<dc:creator>aetherFox</dc:creator>
		
	<category>Articles</category>
		<guid isPermaLink="false">http://insight.freebasic.net/archives/fb-c/</guid>
		<description><![CDATA[Over the Internet, it is sometimes difficult to truly understand what people mean.  Misinterpreted meanings sometimes then come off as insults, and you have yourself a flame war.  It’s unfortunate, because for the most part, people mean no harm, and it is just a matter of a simple issue snowballing out of control.
The [...]]]></description>
			<content:encoded><![CDATA[<p>Over the Internet, it is sometimes difficult to truly understand what people mean.  Misinterpreted meanings sometimes then come off as insults, and you have yourself a flame war.  It’s unfortunate, because for the most part, people mean no harm, and it is just a matter of a simple issue snowballing out of control.</p>
<p>The programming community is no exception.  The Basic community itself is constantly fighting itself on the various forums that govern its social existence.  Bickering, flaming and flame baiting has resulted in forums that have almost every thread polluted with arguments over miniscule issues that have been blown way out of proportion.</p>
<p><a id="more-3"></a>There is another community which is like this.  In fact, over many discussions in forums and on <span class="caps">IRC</span>, people jokingly refer to this type of behavior as that typical of the C++ community; forums renown to be places where beginner programmers get torn apart by coding guru vultures.</p>
<p>Unfortunately, this is where the FreeBASIC community seems to be headed.  Recently, a change in attitude has come over the people active in the forums, a clashing of egos rather than a collective focus of intellect, a bashing of creativity and opinion in the effort to impress oneself on others.</p>
<p>This is not to say that the forums are only filled with ego-wielding maniacs.  There are kind-natured people who will help others or offer criticism with the proper respect, but times have changed since the “glory days” that were QB.  What has changed?  How has FB caused such rifts in the community?</p>
<p>I recently had a conversation with KiZ on this subject.  He agreed that the general changes in attitude have not been for the better.  His reasoning, which I am not going to dismiss that quickly, was that, &#8220;&#8230;arrogant people don&#8217;t use <span class="caps">DOS</span>.&#8221;  Funny as I immediately found it, I soon saw depth in this, whether KiZ had meant it or not.</p>
<p>The programmers who were around when the scene was known as the Qmunity, when it was cool to have an on-going <span class="caps">RPG</span> project and a raycasting engine were programmers who had <em>fun</em> with their code.  Almost nobody did real, serious work.  People did turn up giving stories about their corporation keeping a twenty year-old piece of legacy <span class="caps">BASIC</span> code, giving good laughs all around, but these were few and far between.</p>
<p>It is possible the implications FreeBASIC has in serious and professional applications has attracted the kind of crowd that would normally be associated with C++.  FreeBASIC has caused major changes in the way people look at a <span class="caps">BASIC</span> language.  Finally, there is a new, powerful <span class="caps">BASIC</span> derivative, that is as easy to learn as the original was, but has the power to produce games that rival the commercial games of <em>today</em>.  That usually sounds like C++ speaking.</p>
<p>I cannot claim to be an expert in psychoanalysis, but maybe the mindset of a serious C++ programmer is just too different to one of the Qmunity to work.  It certainly has not worked yet.  I just hope people come to their senses before this community, which has been a dear part of many of our lives for several years, comes crushing down to its knees.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://insight.freebasic.net/archives/fb-c/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://insight.freebasic.net/archives/hello-world/</link>
		<comments>http://insight.freebasic.net/archives/hello-world/#comments</comments>
		<pubDate>Sun, 13 Aug 2006 19:05:29 +0000</pubDate>
		<dc:creator>aetherFox</dc:creator>
		
	<category>Site News</category>
		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hey, and welcome to FreeBASIC Insight!
I&#8217;m glad you&#8217;re here and hope you&#8217;ll enjoy your time listening to the banterings of myself and the other authors here.  Keep posted, we&#8217;ll be added stuff on a (hopefully) regular basis.
Thanks,
Avinash &#8216;aetherFox&#8217; Vora

]]></description>
			<content:encoded><![CDATA[<p>Hey, and welcome to FreeBASIC Insight!</p>
<p>I&#8217;m glad you&#8217;re here and hope you&#8217;ll enjoy your time listening to the banterings of myself and the other authors here.  Keep posted, we&#8217;ll be added stuff on a (hopefully) regular basis.</p>
<p>Thanks,</p>
<p>Avinash &#8216;aetherFox&#8217; Vora
</p>
]]></content:encoded>
			<wfw:commentRSS>http://insight.freebasic.net/archives/hello-world/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
