Virtual Assembler - Learn assembly languages fast!

Miscellaneous Forums/Blitz Showcase/Virtual Assembler - Learn assembly languages fast!

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This is so cool! But couldn't you write a print_number function? I wrote this little fibonacci function but I can't be arsed to test it if it works - it's too much work writing a number-to-ascii converter when I don't know if I even can send a memory address to the print function. :)

Or maybe display what the registers contains after the program has ended? That would work!

; In: eax = n
; Out: ecx = fib(n)
	mov	ebx, 0
	mov	ecx, 1
loop:	mov	edx, ebx
	add	edx, ecx
	mov	ebx, ecx
	mov	ecx, edx
	dec	eax, 1
	cmp	eax, 0
	jg	loop


(I take no responsibility for any errors - it's been yeeears since I did any asm!)