loop:
mov rax, SYS_WRITE
mov rdi, STDOUT
mov rsi, newLine
mov rdx, newLineLength
syscall
; PATIENT 1
mov rsi, 0 ; reset rsi
lea rsi, [record + (printLoop * patient_record)]
mov r8, rsi
call print_detail
inc byte[printLoop]
cmp byte[printLoop], bl
jne loop
jmp main_menu
I have this code and i keep on getting errors on the lea line :
error: invalid effective address: impossible segment base multiplier
But if I change the printLoop to a constant multiplier (e.g. 0), it runs. What seems could be the problem? This is a loop so I wish to run this at most 5 times
Basically, I want to access the structs dynamically
I changed the printLoop to constant multiplier and it works but as I want it to loop, i use printLoop variable as my multiplier and increments every loop but it gives invalid effective address error
Milai Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.