So this is what I have so far, and every time I get to the loop part of the code, I get Segmentation fault (core dumped)
. Is this because some of my registers are holding things that are an incorrect size?
.data
Welcome:
.ascii "Welcome to League of Legends!!.\n\0"
Instruction:
.ascii "Player 1, enter a Champion's name: \0"
Text:
.space 12
Text2:
.space 12
Guess:
.ascii "Guess a letter: \0"
Letter:
.space 1
SecretCharacter:
.ascii "Your Champion is: \0"
.text
.global _start
_start:
mov $Welcome, %rax
call PrintCString
mov $Instruction, %rax
call PrintCString
mov $Text, %rax
mov $12, %rbx
call ScanCString
mov %rax, %rbx
mov %rax, %rbp
call LengthCString
mov %rax, %rcx
mov $0, %rdi
mov $45, %ch
Loop:
cmp %rcx, %rdi
jge End
mov $Text2, %eax
movb %ch, (%rax, %rdi)
add $1, %rdi
jmp Loop
End:
call PrintCString
call EndProgram