Browse Source

introduction to 'variables'

Phil 5 years ago
parent
commit
b6a687c51c
1 changed files with 27 additions and 0 deletions
  1. 27 0
      name_change.asm

+ 27 - 0
name_change.asm

@@ -0,0 +1,27 @@
+section .data
+	name db 'Zara Ali'
+
+section .text
+	
+	global _start
+_start:
+	;write out 'Zara Ali'	
+	mov edx,9	;length
+	mov ecx,name	;message
+	mov ebx,1	;fd
+	mov eax,4	;sys_write
+	int 0x80	;interupt kernel
+	
+	mov [name], dword 'Nuha'	;put 'Nuha' into name overwriting Zara
+
+	;write out 'Nuha Ali'
+	mov edx,8	;len
+	mov ecx,name	;name to ecx
+	mov ebx,1	;file discriptor
+	mov eax,4	;sys_write
+	int 0x80	;interruipt kernel
+
+	;exit
+	mov eax,1
+	mov ebx,0
+	int 0x80