064-Assembly汇编01

Assembly

0.template

we have a file named template.asm

this is a template file for assembly

check it out

section .data
section .text

	global _start

_start:
	nop
	; start code here
	
	; end code here

Exit:	mov eax,1
        mov ebx,0
        int 80H
	nop

section .bss

1.adding two numbers

the code is

	mov rax, 3
	mov rbx, 4
	add rax, rbx

so the complete code is

section .data
section .text

	global _start

_start:
	nop
	; start code here
	mov rax, 3
	mov rbx, 4
	add rax, rbx
	; end code here

Exit:	mov eax,1
        mov ebx,0
        int 80H
	nop

section .bss

2.add three numbers

section .data
section .text

	global _start

_start:
	nop
	; start code here
	mov rax, 3
	mov rbx, 4
	mov rcx, 5
	add rax, rbx
	add rax, rcx
	; end code here

Exit:	mov eax,1
        mov ebx,0
        int 80H
	nop

section .bss

3.multiplying two numbers

section .data
section .text

	global _start

_start:
	nop
	; start code here
	mov eax, 3
	mov ebx, 4
 	mul ebx
	; end code here

Exit:	mov eax,1
        mov ebx,0
        int 80H
	nop

section .bss

4.

发布了1081 篇原创文章 · 获赞 42 · 访问量 21万+

猜你喜欢

转载自blog.csdn.net/qq_33781658/article/details/104509712
064