Saturday, April 23, 2016

Approaching a New Technology

Approaching new technology can be quite intimidating to people.  I have been asked a few times lately what my approach is since I always seem to be working with something new.  What I do is not really anything complex.  I simply dive in the deep end and start working at it.

A good example of this is when I decided to learn x86 Assembly.  Rather than taking a class (not that I would be able to find one at the local community college or anything), or reading a book (surprisingly hard to find).  I simply chose a project and started learning on the run.

The project I chose was to port Richard Garriott's DnD #1 into x86 Assembly.  I thought it would be cool since it was written just before the introduction of the x86 processor family.  I also decided I would do it bare metal (no existing operating system) so I could get really embedded into how it works.

Starting the project I new nothing but a plan, but I took the time to read the code and analyze it.  I figured out the first basic things I would need and decided to build them from the ground up.  The first of course being the ability to get something displayed on the screen, and the second something to handle strings.  So I went and dug around until I found the basic info I needed to get started with that and spent a good couple days simply building string manipulation and graphics libraries.

From there the project went pretty well and I learned things including hard drive access, memory addressing, and some nifty tricks with binary math.  It was definitely an investment of time.  If I had simply stuck to reading a book on the topic I would have probably learned a lot more theory (and forgotten about as much), but would have had very little practical knowledge to use in the real world.

Basically my trick is simply to get hands on with my learning.  I am not saying that learning from a book is bad, I learned a lot from different forums and blogs during the process of porting that game which is a similar concept.  The big difference is that I immediately put that knew knowledge to use which helps to ingrain it into memory.  When learning something from a book there is a reason they put chapter exercises.  Without them, the amount you will retain is significantly less than if you simply read the book.

I suppose in all of this, it does not hurt that I have a passion for learning.  I am constantly reading a new book or testing out a new technology, it is something I enjoy.  If you are just going through the motions, you will likely not have the attention to learn a new technology.

Wednesday, February 18, 2015

Testing and the Oculus Rift

Over the weekend I finished up the code for the game I have been working on in Assembly.  I still have to do a little more work on it with documentation and testing though.  It is really exciting to be to this part though because it means I am almost done.  The way it is looking maybe another couple weeks and I will have a fully tested beta out.

When looking into my next project I noticed that many people have done tutorials on software rendering, so unless I get feedback saying otherwise I may not do that.  So many projects to do, I am thinking I should focus on the fun ones (aside from finally getting that website up).  I think next is likely going to be the website so I have somewhere to feature the projects and code.

After the website is complete I may finally start on the Adventure RPG that I have planned many times and even made a couple rough copies.  I feel that I am now strong enough as a developer to at least make some good real progress on the game.  Most RPGs require a lot of fighting and are all battle intense, I know of a lot of people that shy away from those games because they are not into action fighting games.  Really in an RPG not everyone should be a fighter, in the real world though we have wars there are also people that do stuff other than fighting.  Resources are not gained from monster drops.  They are mined, farmed, or otherwise obtained.  The hope is for a classless game where every character is unique and can do their own thing.

On a more exciting note my Oculus Rift DK2 came yesterday.  It is more impressive than I thought it would be.  Very solid construction, and the "screen door" effect is not as bad as people made it out to be.  It really would be easy to lose yourself in a virtual world with it.  While it does take a bit of adjusting and software support is not consistent I can really see potential for it.  I think at this point really it is more software than hardware holding it back.

Wednesday, January 28, 2015

Project Progress

As it may have been notice, I have been quiet lately.  This is not because I have forgotten about this blog, or because I have had nothing to talk about.  I have been focusing on a big project that I have been working on.

As I mentioned in a couple other posts, I am porting an old game into 8086 assembly.  I have finally had time to sit down and work on this project, and I am making good progress.  It should be ready for a beta release in the next couple of weeks.  I really had not anticipated how big this project really was.  It is requiring me to write up a lot of algorithms that we take for granted in in development these days.  Also I am wanting to really do this right so there is a lot of testing and documenting going on, as well as a lot of planning work behind the scenes.

Keep an eye out for more posts on this because the release is quickly approaching.

Tuesday, January 13, 2015

A New Year A Better Blog

It has been nearly a month since my last post.  I do apologize to anyone that follows this blog for the delay in this post.  Life is finally winding back down from the holidays so we should be back to having regular posts.

Work on the new website is under way, but it will be a while before that is released.  That is the problem with being a perfectionist.  In the mean time I do plan to blog about small topics here.  Unless there is a request for certain topics I will be holding off on any tutorials until the site is finished as I would rather dedicate entire sections to the tutorials.

I look forward to this new year, as it already looks like it is going to be a great one.

Tuesday, December 2, 2014

New Website Coming

After looking back on my tutorial series, I have decided to hold off on writing future parts of the series until I have a website to support the content better.  The context of a blog post keeps me limited in the amount of content I can put into the tutorial.

Going forward the plan is to write an in depth tutorial in assembly programming.  Hopefully getting a little more hands on, and with a lot more visuals.  I will continue to post updates and useful information here.  

Keep on the lookout for updates on the new website.

Monday, December 1, 2014

Welcome December with Cyber Monday

I hope everyone in the US had a great Thanksgiving, and has had luck with any Black Friday or Cyber Monday purchases.

On the tech side there are a few good deals to note.

InformIT is having a 50% off sale on eBooks as well as 70% off on Video Tutorials

O'Reilly Media is having a 50% off sale as well with purchases over $100 getting 60% off.

There are of course plenty of other sales out there, leave a comment if you know of a deal that is hard to pass up.

Also keep watching for more tutorial installments.

Saturday, November 22, 2014

Assembly Tutorial 5: Strings

Accepting input from the user is basically pointless if you don't have the ability to do anything with it.  That is where string functions come in handy.

It is always handy to be able to change the case of a string.  This is handy for formatting the output or for string comparison.

To Upper
To make a character uppercase we will first check to make sure that it is a lowercase character by comparing it to 'a' and 'z' to make sure that it is between them.  After that we will simply subtract the difference between 'a' and 'A' from the character.

To Lower
Making a character lowercase is almost exactly the same as making it upper case.  We simply make sure it is between 'A' and 'Z' and then add the difference between 'a' and 'A' to the character.

For an entire string we simply loop through the whole string and do this to each character.

Substring
Taking a substring is a little more involved than changing the case, though not too complicated.  Using a length parameter in register CX and the address of the string in BX.

We need to copy the character at BX into a buffer and then decrement CX and increment BX.  When CX or BX are zero we null terminate the string in the buffer and return the buffer address in BX.

String Compare
Comparing two strings is very similar to taking a substring, except without the count or copy.

We simply take the addresses of 2 strings and then compare the characters at their addresses.  If they are equal and not 0 we increment the addresses and repeat.  If they are both zero we return that they are equal, if the characters are not equal we return which one was greater in value as a 1 or -1.

Like usual examples of this are in the repository for this tutorial.
https://github.com/musicman89/Assembly-Tutorial