added case
todo make it so case accepts input from stdin
This commit is contained in:
parent
7fd7c2f657
commit
5d56028dee
2 changed files with 56 additions and 1 deletions
|
@ -14,4 +14,4 @@ set(CMAKE_ASM_NASM_LINK_EXECUTABLE "gcc <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS>
|
|||
add_link_options(-fno-pie -m64 -no-pie -pedantic-errors)
|
||||
|
||||
#Make a EXE with cpp and asm files
|
||||
add_executable(yes yes.asm)
|
||||
add_executable(case case.asm)
|
||||
|
|
55
case.asm
Normal file
55
case.asm
Normal file
|
@ -0,0 +1,55 @@
|
|||
extern puts
|
||||
|
||||
section .data
|
||||
text db "rEEEeee!EEeeeEeEEeE!EEEEEeEEE$eeeEE)EEeEeEEeeeEeEEEEEeeeEeeEeeEeeeeeEeEeEeeE",0
|
||||
textlength db 76
|
||||
section .text
|
||||
global main
|
||||
|
||||
main:
|
||||
sub rsp, 8
|
||||
|
||||
|
||||
|
||||
xor rcx, rcx
|
||||
_loop:
|
||||
;do loop things
|
||||
|
||||
mov r9, text
|
||||
add r9, rcx
|
||||
|
||||
;do text checks and modify the text here
|
||||
|
||||
mov r8b, [r9]
|
||||
cmp r8b, 90
|
||||
ja _endloop
|
||||
cmp r8b, 65
|
||||
jb _endloop
|
||||
|
||||
add r8b, 32
|
||||
mov [r9], r8b
|
||||
|
||||
_endloop:
|
||||
;end loop
|
||||
inc rcx
|
||||
cmp rcx, [textlength]
|
||||
jle _loop
|
||||
|
||||
|
||||
|
||||
|
||||
_print:
|
||||
|
||||
mov rdi, text
|
||||
cld
|
||||
call puts ;this is the put s way of printing a string
|
||||
|
||||
_end:
|
||||
add rsp, 8
|
||||
ret
|
||||
|
||||
; mov rax, 60 ; exit
|
||||
; mov edi, 1 ; error 1 dont need the exit anymore beacue libc or somthing
|
||||
; syscall
|
||||
|
||||
|
Loading…
Reference in a new issue