First working assembly code in 33 years


When I say working, I mean boots into an endless loop with no ouput to the user – but then, that’s what it’s meant to do:

/* 	Microblaze start up code
	Copyright Adrian McMenamin <>, 2014
	Licensed under GPL v3

	.global _start
	.section .vectors.reset, "ax"
	.align 2
	.ent _start
	.type _start, @function

	brai	_actualstart
	.end _start

	.section .vectors.sw_exception, "ax"
	.align 2
	brai	_handle_exception

	.section .vectors.interrupt, "ax"
	.align 2
	brai	_interrupt_handler

	.section .vectors.breakpoint, "ax"
	.align 2
	brai _handle_breakpoint

	.section .vectors.hw_exception, "ax"
	.align 2
	brai	_handle_hwexception

	.section .text
	.global _actualstart
	.align 4
	.ent _actualstart
	.type _actualstart, @function

	mts	rmsr, r0
	mts	rslr, r0
	addi	r8, r0, 0xFFFFFFFF
	mts	rshr, r8

	addik	r3, r0, 0x3F
	mts	rtlbx, r3

	bri 0 /*endless loop if it ever works */

Only have to get it to do something useful now, how hard could that be? (There is a linker script to get this to work also – as it has to be loaded to address 0x00000000. Have a look at my github (mcmenaminadrian) repos.