Compare commits
2 commits
4fe311d996
...
6cb234ec8a
Author | SHA1 | Date | |
---|---|---|---|
6cb234ec8a | |||
4239ceeb1c |
8 changed files with 96 additions and 14 deletions
|
@ -22,4 +22,3 @@ add_executable(yes yes.asm)
|
||||||
add_executable(case case.asm)
|
add_executable(case case.asm)
|
||||||
add_executable(diff diff.asm)
|
add_executable(diff diff.asm)
|
||||||
add_executable(arg arg.asm)
|
add_executable(arg arg.asm)
|
||||||
|
|
||||||
|
|
12
LICENSE
12
LICENSE
|
@ -1,3 +1,4 @@
|
||||||
|
<<<<<<< HEAD
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 3, 29 June 2007
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
@ -230,3 +231,14 @@ The hypothetical commands `show w' and `show c' should show the appropriate part
|
||||||
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
|
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
|
=======
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) <year> <copyright holders>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
>>>>>>> 4239ceeb1ccbbab57aa904c6f3888ef0bf9e6ddb
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<<<<<<< HEAD
|
||||||
# zombie-core-utils
|
# zombie-core-utils
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
@ -13,4 +14,7 @@ cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
=======
|
||||||
|
# zombie-lib
|
||||||
|
>>>>>>> 4239ceeb1ccbbab57aa904c6f3888ef0bf9e6ddb
|
||||||
|
|
||||||
|
|
13
arg.asm
13
arg.asm
|
@ -1,20 +1,27 @@
|
||||||
extern puts
|
extern puts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
section .data
|
section .data
|
||||||
text db 48,0
|
text db "0",0
|
||||||
|
frick dq 0
|
||||||
section .text
|
section .text
|
||||||
global main
|
global main
|
||||||
|
|
||||||
main:
|
main:
|
||||||
sub rsp, 8 ;enter
|
sub rsp, 8 ;enter
|
||||||
|
|
||||||
add [text], rdi
|
add rsi, 8
|
||||||
|
mov r8, [rsi]
|
||||||
|
mov [frick], r8
|
||||||
|
|
||||||
mov rdi, text
|
|
||||||
|
mov rdi, [frick]
|
||||||
cld
|
cld
|
||||||
call puts
|
call puts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_end:
|
_end:
|
||||||
add rsp, 8 ;exit
|
add rsp, 8 ;exit
|
||||||
ret
|
ret
|
||||||
|
|
26
case.asm
26
case.asm
|
@ -4,20 +4,38 @@ global case_func
|
||||||
|
|
||||||
|
|
||||||
section .data
|
section .data
|
||||||
text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0
|
tempstore db 0
|
||||||
|
argument_error db "Argument Error!... either too many args or too little please fix", 0
|
||||||
section .text
|
section .text
|
||||||
global main
|
global main
|
||||||
|
|
||||||
main:
|
main:
|
||||||
sub rsp, 8 ;enter
|
sub rsp, 8 ;enter
|
||||||
|
|
||||||
mov rdi, text
|
|
||||||
call case_func
|
|
||||||
|
|
||||||
mov rdi, text
|
cmp rdi, 2
|
||||||
|
jne _argument_error ;if its not exactly 2 then exit
|
||||||
|
|
||||||
|
|
||||||
|
add rsi, 8 ;get the second argument because the first argument is the path
|
||||||
|
mov r8, [rsi] ;this block here fenagles the pointer into memeory instead of a register
|
||||||
|
mov [tempstore], r8 ; i also really with i had the abilty to mov [thing1], [thing2]
|
||||||
|
|
||||||
|
|
||||||
|
mov rdi, [tempstore]
|
||||||
|
call case_func ;case_func modifies the text you send it
|
||||||
|
|
||||||
|
mov rdi, [tempstore]
|
||||||
cld
|
cld
|
||||||
call puts ;this is the puts way of printing a string
|
call puts ;this is the puts way of printing a string
|
||||||
|
|
||||||
_end:
|
_end:
|
||||||
add rsp, 8 ;exit
|
add rsp, 8 ;exit
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
_argument_error:
|
||||||
|
mov rdi, argument_error
|
||||||
|
cld
|
||||||
|
call puts
|
||||||
|
|
||||||
|
jmp _end
|
||||||
|
|
28
diff.asm
28
diff.asm
|
@ -3,8 +3,9 @@ extern puts
|
||||||
%include "../inc/diff_func.inc"
|
%include "../inc/diff_func.inc"
|
||||||
|
|
||||||
section .data
|
section .data
|
||||||
text db "REEEEEEEEEE",0
|
tempstore db 0
|
||||||
text2 db "REEEEEEErEE",0
|
tempstore2 db 0
|
||||||
|
argument_error db "Argument Error!... either too many args or too little please fix", 0
|
||||||
differ db "they differ",0
|
differ db "they differ",0
|
||||||
notdiffer db "they do not differ",0
|
notdiffer db "they do not differ",0
|
||||||
section .text
|
section .text
|
||||||
|
@ -13,8 +14,20 @@ section .text
|
||||||
main:
|
main:
|
||||||
sub rsp, 8 ;enter
|
sub rsp, 8 ;enter
|
||||||
|
|
||||||
mov rdi, text
|
cmp rdi, 3
|
||||||
mov rsi, text2
|
jne _argument_error
|
||||||
|
|
||||||
|
add rsi, 8
|
||||||
|
mov r8, [rsi]
|
||||||
|
mov [tempstore], r8
|
||||||
|
|
||||||
|
add rsi, 8
|
||||||
|
mov r8, [rsi]
|
||||||
|
mov [tempstore2], r8
|
||||||
|
|
||||||
|
|
||||||
|
mov rdi, [tempstore]
|
||||||
|
mov rsi, [tempstore2]
|
||||||
call diff_func
|
call diff_func
|
||||||
|
|
||||||
cmp r10b, 1 ;why tf did i make ut r10b as the return like tf?!?!?!?
|
cmp r10b, 1 ;why tf did i make ut r10b as the return like tf?!?!?!?
|
||||||
|
@ -35,3 +48,10 @@ _notdiffer:
|
||||||
_end:
|
_end:
|
||||||
add rsp, 8 ;exit
|
add rsp, 8 ;exit
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
_argument_error:
|
||||||
|
mov rdi, argument_error
|
||||||
|
cld
|
||||||
|
call puts
|
||||||
|
|
||||||
|
jmp _end
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
|
|
||||||
diff_func:
|
diff_func:
|
||||||
xor rcx, rcx ;we do this to clear garbage in rcx (i have had garbage in it before)
|
xor rcx, rcx ;we do this to clear garbage in rcx (i have had garbage in it before)
|
||||||
|
mov r8, rdi
|
||||||
|
mov r9, rsi
|
||||||
_loopwasp12bsharknado:
|
_loopwasp12bsharknado:
|
||||||
;loop tings
|
;loop tings
|
||||||
|
|
||||||
|
mov rdi, r8
|
||||||
|
mov rsi, r9
|
||||||
|
|
||||||
|
|
||||||
add rdi, rcx
|
add rdi, rcx
|
||||||
add rsi, rcx
|
add rsi, rcx
|
||||||
|
|
||||||
|
|
20
length.asm
20
length.asm
|
@ -10,17 +10,26 @@ section .rodata
|
||||||
format db "%#d", 10, 0
|
format db "%#d", 10, 0
|
||||||
|
|
||||||
section .data
|
section .data
|
||||||
text db "rEE",0
|
|
||||||
testasd dq 0
|
testasd dq 0
|
||||||
|
tempstore db 0
|
||||||
|
argument_error db "Argument Error!... either too many args or too little please fix", 0
|
||||||
section .text
|
section .text
|
||||||
global main
|
global main
|
||||||
|
|
||||||
main:
|
main:
|
||||||
sub rsp, 8 ;enter
|
sub rsp, 8 ;enter
|
||||||
|
|
||||||
|
cmp rdi, 2
|
||||||
|
jne _argument_error ;if its not exactly 2 then exit
|
||||||
|
|
||||||
|
|
||||||
mov rdi, text
|
add rsi, 8 ;get the second argument because the first argument is the path
|
||||||
|
mov r8, [rsi] ;this block here fenagles the pointer into memeory instead of a register
|
||||||
|
mov [tempstore], r8 ; i also really with i had the abilty to mov [thing1], [thing2]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
mov rdi, [tempstore]
|
||||||
call length_func
|
call length_func
|
||||||
mov [testasd], rax
|
mov [testasd], rax
|
||||||
|
|
||||||
|
@ -35,3 +44,10 @@ main:
|
||||||
_end:
|
_end:
|
||||||
add rsp, 8 ;exit
|
add rsp, 8 ;exit
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
_argument_error:
|
||||||
|
mov rdi, argument_error
|
||||||
|
cld
|
||||||
|
call puts
|
||||||
|
|
||||||
|
jmp _end
|
||||||
|
|
Loading…
Reference in a new issue