http://www.fourtheye.org/armasm.shtml


http://www.fourtheye.org/armasm.shtml

  .section	.rodata  	.align	2  string:  	.asciz "Sum of %d and %d is %d\n"  .text  	.align	2  	.global	main  	.type	main, %function  main:  	stmfd	sp!, {r0, r1, r2, r3, lr}  	ldr	r0, =string	@ store address of start of string to r0  	mov	r1, #1		@ then each parameter to subsequent registers  	mov	r2, #41  	mov	r3, #42  	bl	printf		@ call the c function to display information  	ldmfd	sp!, {r0, r1, r2, r3 , pc}  	mov	r7, #1		@ set r7 to 1 - the syscall for exit  	swi	0		@ then invoke the syscall from linux  

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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