Added source files.
This commit is contained in:
		
							
								
								
									
										14
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
AS=as
 | 
			
		||||
LINKER=ld
 | 
			
		||||
OBJ=src/HelloWorld.o
 | 
			
		||||
 | 
			
		||||
%.o: %.asm
 | 
			
		||||
	$(AS) -o $@ $<
 | 
			
		||||
 | 
			
		||||
helloworld: $(OBJ)
 | 
			
		||||
	$(LINKER) -o $@ $^
 | 
			
		||||
 | 
			
		||||
.PHONY: clean
 | 
			
		||||
 | 
			
		||||
clean:
 | 
			
		||||
	rm $(OBJ)
 | 
			
		||||
							
								
								
									
										17
									
								
								src/HelloWorld.asm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/HelloWorld.asm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
.section .data
 | 
			
		||||
    hello:
 | 
			
		||||
        .ascii "Hello, World.\n"
 | 
			
		||||
 | 
			
		||||
.section .text
 | 
			
		||||
    .global _start
 | 
			
		||||
 | 
			
		||||
_start:
 | 
			
		||||
    mov $1, %rax
 | 
			
		||||
    mov $1, %rdi
 | 
			
		||||
    mov $hello, %rsi
 | 
			
		||||
    mov $14, %rdx
 | 
			
		||||
    syscall
 | 
			
		||||
 | 
			
		||||
    mov $60, %rax
 | 
			
		||||
    xor %rdi, %rdi
 | 
			
		||||
    syscall
 | 
			
		||||
		Reference in New Issue
	
	Block a user