IECHost: drive code upload and execution API completed and tested

I had some time this morning to write the IECHost API for direct access to the 1541 memory, i.e. the equivalent of the “M-W” and “M-E” commands. The idea was to get something like a “hello world!” program uploaded to the drive’s memory and executed. I chose to upload some code to just flash the status LED:


; record header following PRG load address: code size
sz	.word endcode - start

.logical $0300

; unless the code starts here, have a jump to the entry point from here

flash	lda $1c00
	eor #$08	; blink LED
	sta $1c00

; delay .3 seconds
	ldx #$ff
x	ldy #$ff
y	dey
	bne y
	bne x

	jmp flash


The way IECHost uploads and executes the above program is by means of the following code:

	pgm_read_word(drivecode_flashing_led),	/* PRG start address */
	drivecode_flashing_led + 4,				/* Code start in PRG */
	pgm_read_word(drivecode_flashing_led + 2),	/* Code size record in PRG */
if (st)

directaccess_memory_execute(device_number, pgm_read_word(drivecode_flashing_led), 

It’s all working as expected of course 🙂

This entry was posted in Retrocomputing, Technical and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s