Commit 348dfea0 authored by joel.guest's avatar joel.guest

Initial commit

parent 37935f93
...@@ -31,24 +31,24 @@ xor rdx,rdx ;sets all value of rdx to 0 ...@@ -31,24 +31,24 @@ xor rdx,rdx ;sets all value of rdx to 0
mov rax, r9 mov rax, r9
mov r12, 15 ; r9 = loop counter mov r12, 15 ; r9 = loop counter
DIV r12 ; RDX:RAX/3->RAX Remainder ->RDX DIV r12 ; RDX:RAX/3->RAX Remainder ->RDX
CMP rdx, 0 ; compared rdx to r12 CMP rdx, 0 ; compared rdx to 0
jz test15 ; jump not zero test 15 jz test15 ; jump zero test 15
;sets uptest for bang ;sets uptest for bang
xor rdx,rdx ;sets all value of rdx to 0 xor rdx,rdx ;sets all value of rdx to 0
mov rax, r9 mov rax, r9
mov r12, 5 ; r9 = loop counter mov r12, 5 ; r9 = loop counter
DIV r12 ; RDX:RAX/3->RAX Remainder ->RDX DIV r12 ; RDX:RAX/3->RAX Remainder ->RDX
CMP rdx, 0 ;compared rdx to r12 CMP rdx, 0 ;compared rdx to 0
jz test5 ; jump not zero test 5 jz test5 ; jump zero test 5
;sets uptest for fizz ;sets uptest for fizz
xor rdx,rdx ;sets all value of rdx to 0 xor rdx,rdx ;sets all value of rdx to 0
mov rax, r9 mov rax, r9
mov r12, 3 ; r9 = loop counter mov r12, 3 ; r9 = loop counter
DIV r12 ; RDX:RAX/3->RAX Remainder ->RDX DIV r12 ; RDX:RAX/3->RAX Remainder ->RDX
CMP RDX, 0 ;compared rdx to r12 CMP RDX, 0 ;compared rdx to 0
Jz test3 ; jump no zero test 5 Jz test3 ; jump zero test 5
jmp number ;jumps to number jmp number ;jumps to number
...@@ -58,54 +58,54 @@ test15: ...@@ -58,54 +58,54 @@ test15:
;output bang ;output bang
inc r14 inc r14
inc r15 inc r15
mov rax,1 mov rax,1 ; set write command
mov rdi,1 mov rdi,1
mov rsi,fizzbang mov rsi,fizzbang ; set rsi to location of string
mov rdx,9 mov rdx,9 ; sets rdx to length of the string
syscall syscall ; invokes system call
jmp start_loop jmp start_loop ;jump to start loop
test5: test5:
inc r15 inc r15
;output bang ;output bang
mov rax,1 mov rax,1 ; set write command
mov rdi,1 mov rdi,1
mov rsi,bang mov rsi,bang ; set rsi to location of string
mov rdx,5 mov rdx,5 ; sets rdx to length of the string
syscall syscall ; invokes system call
jmp start_loop jmp start_loop ;jump to start loop
test3: test3:
inc r14 inc r14
;output fizz ;output fizz
mov rax,1 mov rax,1 ; set write command
mov rdi,1 mov rdi,1 ;
mov rsi,fizz mov rsi,fizz ; set rsi to location of string
mov rdx,5 mov rdx,5 ; sets rdx to length of the string
syscall syscall ; invokes system call
jmp start_loop jmp start_loop ;jump to start loop
fizzcounter: fizzcounter:
mov rax, r14 mov rax, r14 ; move value r14 to rax
mov rdi,1 mov rdi,1 ; set rsi to location of string
mov rdx,1 mov rdx,1
mov rcx, 64 mov rcx, 64
jmp loop jmp loop ;jump to loop
bangcounter: bangcounter:
mov rax,r15 mov rax,r15 ; move value r15 to rax
mov rdi, 1 mov rdi, 1 ; set rsi to location of string
mov rdx,1 mov rdx,1
mov rcx, 64 mov rcx, 64
jmp loop jmp loop ;jump to loop
number: number:
mov rax,r9 mov rax,r9 ; move value r9 to rax
mov rdi,1 mov rdi,1 ; set rsi to location of string
mov rdx,1 mov rdx,1
mov rcx, 64 mov rcx, 64
jmp loop jmp loop ;jump to loop
loop: loop:
push rax push rax
......
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment