This was originally posted on Google+, which has now been shut down. It was
helpfully converted to Markdown by Robert Jacobson after which I adjusted it
for reposting here. I have dated it at its original posting date, but it was
posted here on 2019-09-07.
Since the last time, the nasm people have been able to fix the bugs I stumbled upon, and pushed them in a release.
Anything newer than 2.10.6 is probably also fine. Please note that you have to update if you are following this tutorial on OS …
Continue readingAsmtut 5: More snappy interaction
This was originally posted on Google+, which has now been shut down. It was
helpfully converted to Markdown by Robert Jacobson after which I adjusted it
for reposting here. I have dated it at its original posting date, but it was
posted here on 2019-09-07.
At this point, we are tired of the line-buffered interface. Let's make it more responsive!
Step 11: Cleanup
First, let's just clean up our code a bit by putting our constants on top:
; System defines:
SYS_write equ 0x02000004
SYS_read …
Continue readingAsmtut 4: Input
This was originally posted on Google+, which has now been shut down. It was
helpfully converted to Markdown by Robert Jacobson after which I adjusted it
for reposting here. I have dated it at its original posting date, but it was
posted here on 2019-09-07.
Let's start drawing and moving around a snake. Before we can ask the user where he wants to move the snake, we need to have a snake:
Step 9: Writing into an array
Our board is basically a char[] in C lingo, even though it doesn't have a type.…
Continue readingAsmtut 3: Redundancies
This was originally posted on Google+, which has now been shut down. It was
helpfully converted to Markdown by Robert Jacobson after which I adjusted it
for reposting here. I have dated it at its original posting date, but it was
posted here on 2019-09-07.
This time we will automate stuff with the assembler.
Step 6: String length
In our Hello world-implementation, we used a tedious and error prone mechanism to measure the length of the string: counting by brain. Let's offload that to the comput…
Continue readingAsmtut 2: Hello world!
This was originally posted on Google+, which has now been shut down. It was
helpfully converted to Markdown by Robert Jacobson after which I adjusted it
for reposting here. I have dated it at its original posting date, but it was
posted here on 2019-09-07.
Aside: For your convenience, please use a Makefile. To assemble and link, simply execute make.
# Please be aware that the indentation must be a tab character (no spaces)
all: hello true
%: %.o
ld -macosx_version_min 10.6 -o $@ -e main $<…
Continue reading