In: Computer Science
Write an assembly program that lets the user to input only the word MASM and displays invalid input for any other user inputs.
.LC0:
.string "%c"
.LC1:
.string "MASM"
.LC2:
.string "Invalid Input"
main:
push rbp
mov rbp, rsp
sub rsp, 16
lea rax, [rbp-4]
mov rsi, rax
mov edi, OFFSET FLAT:.LC0
mov eax, 0
call scanf
lea rax, [rbp-4]
cmp rax, OFFSET FLAT:.LC1
je .L2
mov edi, OFFSET FLAT:.LC2
mov eax, 0
call printf
.L2:
mov eax, 0
leave
ret