Monthly Archives: April 2013

Google Code Jam 2013 – Round 1A Problem A

Maria has been hired by the Ghastly Chemicals Junkies (GCJ) company to help them manufacture bullseyes. A bullseye consists of a number of concentric rings (rings that are centered at the same point), and it usually represents an archery target. GCJ is interested in manufacturing black-and-white bullseyes. Maria starts with t millilitres of black paint, […]

Printing in Binary Form – ARM Assembly

When programming in assembly there are many occasions where you need to examine the bits at a particular register or memory address. Printf doesn’t offer the option to print in binary form, so you need to create your own function if you want to do that. Here’s one that will do just that. It prints […]

Optimizing for Speed with ARM Assembly

You probably already heard that if you want to squeeze every last cycle of performance from your programs you need to be able to tweak them in assembly, right? Well, unless you know what you are doing jumping into assembly won’t help, and in some cases it might even hurt. As I started playing around […]

ProjectEuler.net Problem 4 – ARM Assembly

I am starting to play around with ARM Assembly, and to practice I decided to solve some problems on Project Euler with it. Below you’ll find problem 4 and its solution. Keep in mind that the code is not that efficient right now, as it’s taking about 2 minutes to run, but it does solve […]

IAS Assembler in C

A couple of posts ago I started talking about the IAS architecture, mentioning that given its simplicity you can program it directly in machine code. That being said, any program slightly more complex will be painful to write in machine code. For instance, image how boring it would be if you needed to declare an […]

ProjectEuler Problem 2 in IAS Machine Code

If you want to learn more about the IAS computer, check this post. The problem: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, … By considering […]

ProjectEuler Problem 1 in IAS Machine Code

The IAS Machine was the first electronic computer built at the Institute of Advanced Studies (hence the name) at Princeton. The leader of the project was John Von Neumann, who was also a consultant at the ENIAC project (the first general purpose electronic computer). The IAS project was quite important because it was one of […]