Advertisement
Eternoseeker

ass1 Array

Apr 6th, 2023 (edited)
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASM (NASM) 0.78 KB | Source Code | 0 0
  1. section .data
  2.     msg1 db 10,13,"Enter 5 64 bit numbers:"
  3.     len1 equ $-msg1
  4.     msg2 db 10,13,"Entered 5 64 bit numbers:"
  5.     len2 equ $-msg2
  6.  
  7. section .bss
  8.     array resd 200
  9.     counter resb 1
  10.  
  11. section .text
  12.     global _start
  13.     _start:
  14.  
  15. ;display
  16.     mov Rax, 1
  17.     mov Rdi, 1
  18.     mov Rsi, msg1
  19.     mov Rdx, len1
  20.     syscall
  21. ;accpet
  22.     mov byte[counter],05
  23.     mov rbx,00
  24.  
  25.     loop1:
  26.         mov rax,0
  27.         mov rdi,0
  28.         mov rsi,array
  29.         add rsi,rbx
  30.         mov rdx,17
  31.         syscall
  32.         add rbx,17
  33.         dec byte[counter]
  34.         JNZ loop1
  35.  
  36. ;display
  37.     mov Rax,1
  38.     mov Rdi,1
  39.     mov Rsi,msg2
  40.     mov Rdx,len2
  41.     syscall
  42. ;display
  43.     mov byte[counter],05
  44.     mov rbx,00
  45.  
  46.     loop2:
  47.         mov rax,1
  48.         mov rdi,1
  49.         mov rsi,array
  50.         add rsi,rbx
  51.         mov rdx,17
  52.         syscall
  53.         add rbx,17
  54.         dec byte[counter]
  55.         JNZ loop2
  56. ;exit
  57.     mov rax,60
  58.     mov rdi,0
  59.     syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement