The software

Two Gnome workspaces make a development environment.

I am more comfortable with a soldering iron than a keyboard, so this is no show of expertise. It works well.

My system kernel is v 2.6, Gnome desktop, bash shell. There are four programs running in two workspaces.

Gedit is the text editor for source code.
Gpasm assembler from the gputils package (command line).
Gtkterm for serial communication.
Qcad 2-D vector drawing for schematics.

Thanks.

A project folder contains the source code, and a bash script to execute gpasm and do some hex file processing in one command. This one is called (asmblink).
.................................................
#!/bin/bash
	#assemble this directory's **.asm
	#path of this directory
cd /home/user/blink
	#assemble the project
gpasm -n blink.asm   #-n for crlf, dos endline
	#filter the redundancy with Rick's perl script
hxfx blink.hex  blinkx.hex > blinkld.hex
	#save current hex for next iteration
cp blink.hex blinkx.hex
	#replace the eof line removed by filter
echo ':00000001FF' >> blinkld.hex

#gpasm makes the blink.hex file
#blinkx.hex is the last file loaded into the flash
#blinkld.hex is the non-redundant code
.................................................
I can't write any high level code so my friend Rick made this elegant little thing for me. It's a perl script (hxfx).
GPL(c)Rick Wegner,perly@zoidian.net
.................................................
#!/usr/bin/perl
# print lines that are in newfile that aren't in oldfile
if (@ARGV != 2) {
    die "usage is: $0 newfile oldfile\n";
}

open newfh, "<$ARGV[0]" or die "can't open $ARGV[0]\n";
@newhex = readline(newfh);
close(newfh);

open oldfh, "<$ARGV[1]" or die "cant open $ARGV[1]\n";
@oldhex = readline(oldfh);
close(oldfh);

NEW:
foreach $newline (@newhex) {
    foreach $oldline (@oldhex) {
        if ($newline eq $oldline) { next NEW; }
    }
    print($newline);
}
.................................................
Put hxfx in a search path (usr/local/bin), and when asmblink is called You will have two new hex files that can be uploaded. blink.hex is an image of the whole assembled program, and blinkld.hex is only the code that has changed. Uploading this file saves time and flash cycles, and if you choose your code blocks in the flash space strategically, the process can be very quick and interactive.
back to monitor