SHARE
TWEET

Untitled

a guest Dec 5th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. JMP start
  2.  
  3. X:  DB "1;7;3;6;5;5;2"
  4.     DB 0
  5.  
  6. Y:  DB 7d
  7.  
  8. start: 
  9.     MOV C, X
  10.     MOV B, 0d
  11.  
  12.     CALL escreverMensagemInicial
  13.  
  14. escreverMensagemInicial:
  15.     MOV D, 232d
  16.  
  17.     MOV [D], 77
  18.     INC D
  19.     MOV [D], 69
  20.     INC D
  21.     MOV [D], 68
  22.     INC D
  23.     MOV [D], 40
  24.     INC D
  25.    
  26.     MOV D, 0d
  27.  
  28.     CALL calculo
  29.  
  30. calculo:
  31.     MOV A, [C]
  32.  
  33.     CMP A, 59d
  34.     JE virgula
  35.  
  36.     SUB A, 48d
  37.     ADD B, A
  38.    
  39. virgula:
  40.     INC C
  41.     CMP D, [C]
  42.     JNZ calculo
  43.    
  44.     MOV A, B
  45.     MOV B, [Y]
  46.  
  47.     DIV B
  48.     PUSH A
  49.  
  50. organizarRegistradores:
  51.     MOV A, 0d
  52.     MOV B, 0d
  53.     MOV C, 2d
  54.     MOV D, 236d
  55.    
  56.     CALL escreverValoresVetor
  57.  
  58. escreverValoresVetor:
  59.     MOV A, [C]
  60.     MOV [D], A
  61.     INC D
  62.     INC C
  63.  
  64.     CMP B, [C]
  65.     JNZ escreverValoresVetor
  66.  
  67. escreverFinalMensagem:
  68.     MOV [D], 41
  69.     INC D
  70.     MOV [D], 32
  71.     INC D
  72.     MOV [D], 61
  73.     INC D
  74.     MOV [D], 32
  75.     INC D
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top