Month: November 2014

Historic memories: how to create a DOS executable in the EDIT.COM

This is an old trick I used to do in the EDIT.COM of DOS to impress my friends. I discovery that some binary instructions could be represented in the text editor.

This is the sequence to create an executable that prints the ALAN name:

ALT 180 // 180 = B4h = mov AH
ALT 02  // 2
ALT 178 // 178 = B2h = mov DL
A       // C
ALT 205 // 205 = CDh = INT
!       // ! = 33 = 21h
ALT 178 ...
ALT 205
ALT 178
ALT 205
ALT 178
ALT 205
ALT 180 // mov AH
L       // L = 4Ch 
ALT 205 // INT 21 => exit to DOS

This will generate this binary file sequence:

B4 02 B2 43 CD 21 B2 4C CD 21 B2 41 CD 21 B2 55
CD 21 B2 44 CD 21 B2 49 CD 21 B2 41 CD 21 B4 4C
CD 21

This assembly instructions are equivalent to assembly instruction:

MOV AH,02 ; To select subfunction 2, move the appropriate number, 2, to AH.
MOV DL,”A” ; In the interrupt list, it says that the character to output should be
INT 21h ; in register DL. So we move the character to DL.
; Finally when all the registers are set as required, we call the interrupt.

MOV AH,4Ch ; Select the subfunction
INT 21h ; Select a return value (optional but recommended)
; Call the DOS interrupt.


Using Blender to develop for 3D Printer

I’m developing a new project with more complex shapes and I need tight control over all meshes as accurate as possible. Initially I was planing to use FreeCAD, but my FreeCAD’s skill is limited.

Then I decide to test Blender to 3D printing. Fortunately since version 2.67 Blender has a native 3D Printing Toolbox. The Blender toolbox is useful to analyze your object before sending it to printer, this way you will save time and money.

I started reading this tutorial:

First thing you need to do is enable the 3D Print toolbox addon. It is not enabled by default, but it is just a preference checkbox. Easy, en?

A useful tutorial is this from Shapeways:

I still learning about using Blender for 3D Printing, but I decided to post these links here to help other people willing to use Blender.

Another good video tutorial:

How to print to Makerbot Replicator 2X using open-source tools

I’m trying to print on Makerbot Replicator 2X using open-source software instead using Makerware software.

Initially I used Cura: with Cura_Makerbot_standard_profile.ini. You just need to select File -> Open Profile and choose Cura_Makerbot_standard_profile.ini.

Unfortunately Cura 14.09 in my Debian Jessie/sid is not able to detect and communicate with Replicator2X over serial port (ttyACM0). Then I decided to “Save GCode …” and then convert this saved myfile.gcode to myfile.x3g that can be read by Replicator2X from SD Card.

$ gpx -g -m r2x myfile.gcode myfile.x3g

It “barely workes”. I noticed the object is printed more to right side of build bed. Then my suggestion is to put the object more to left side of Cura bed before saving the gcode file.

Conclusion: this approach is not mature enough, but could work if you really care about using only open-source software to control your Makerbot Replicator 2X.

Running NuttX in the simulator

If you don’t have a board supported by NuttX or if you want to debug an application without resource limitation of embedded boards, then running NuttX in the simulator is a nice idea.

All you need to do is:

$ git clone
$ git clone
$ cd nuttx/tools
$ ./ sim/nsh
$ cd ..
$ make
$ ddd nuttx &

(gdb) b main
Breakpoint 1 at 0x4015ab: file up_head.c, line 74.

(gdb) r
Starting program: /comum/workspace/Basic/nuttx-git/nuttx/nuttx 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
Breakpoint 1, main (argc=1, argv=0x7fffffffe2f8, envp=0x7fffffffe308) at up_head.c:74

(gdb) c
[New Thread 0x7ffff75fa700 (LWP 26105)]

NuttShell (NSH)