Advertisement
LincolnArantes

Par ou impar e mostra na tela

Dec 6th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Lincoln Cesar dos Reis Arantes
  2. ;https://www.tutorialspoint.com/compile_asm_online.php
  3.  
  4. section .text
  5.    global _start          
  6.    
  7. _start:                    
  8.    mov   ax, 13h ;aqui alterar numero impar ou par hexadecimal          
  9.    and   ax, 1              
  10.    jz    par
  11.    mov   eax, 4            
  12.    mov   ebx, 1            
  13.    mov   ecx, impar_msg      
  14.    mov   edx, len2          
  15.    int   0x80              
  16.    jmp   saida
  17.  
  18. par:  
  19.  
  20.    mov   ah,  09h
  21.    mov   eax, 4            
  22.    mov   ebx, 1            
  23.    mov   ecx, par_msg      
  24.    mov   edx, len1        
  25.    int   0x80              
  26.  
  27. saida:
  28.  
  29.    mov   eax,1              
  30.    int   0x80              
  31.  
  32. section   .data
  33. par_msg  db  'Numero par!'
  34. len1  equ  $ - par_msg
  35.    
  36. impar_msg db  'Numero impar!'  
  37. len2  equ  $ - impar_msg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement