Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- section .data ; Data segment
- userMsg db 'Silahkan memasukan angka: ' ; Meminta user untuk memasukan angka
- lenUserMsg equ $-userMsg ; Panjang Pesan
- dispMsg db 'Anda sudah memasukan: ' ; Pesan yg disampaikan
- lenDispMsg equ $-dispMsg
- section .bss ; Uninitialized data
- num resb 5
- section .text ; Code segment
- global _start
- _start:
- mov eax, 4
- mov ebx, 1
- mov ecx, userMsg
- mov edx, lenUserMsg
- int 80h
- ;Read and store the user input
- mov eax, 3
- mov ebx, 2
- mov ecx, num
- mov edx, 5 ; 5 bytes (numeric, 1 for sign) of that information
- int 80h
- ;Output the message 'Angka yg dimasukan adalah: '
- mov eax, 4
- mov ebx, 1
- mov ecx, dispMsg
- mov edx, lenDispMsg
- ;Output the number entered
- mov eax, 4
- mov ebx, 1
- mov ecx, num
- mov edx, 5
- int 80h
- ;Exit code
- mov eax, 1
- mov ebx, 0
- int 80h
Add Comment
Please, Sign In to add comment