SHARE
TWEET

Untitled

a guest Dec 5th, 2019 90 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.     PUSH D
  27.     MOV D, 0d
  28.  
  29.     CALL calculo
  30.  
  31. calculo:
  32.     MOV A, [C]
  33.  
  34.     CMP A, 59d
  35.     JE virgula
  36.  
  37.     SUB A, 48d
  38.     ADD B, A
  39.    
  40. virgula:
  41.     INC C
  42.     CMP D, [C]
  43.     JNZ calculo
  44.    
  45.     MOV A, B
  46.     MOV B, [Y]
  47.  
  48.     DIV B
  49.     PUSH A
  50.  
  51. organizarRegistradores:
  52.     MOV A, 0d
  53.     MOV B, 0d
  54.     MOV C, 2d
  55.     MOV D, 236d
  56.    
  57.     CALL escreverValoresVetor
  58.  
  59. incrementoC:
  60.     INC C
  61.  
  62. escreverValoresVetor:
  63.     MOV A, [C]
  64.     MOV [D], A
  65.     INC D
  66.  
  67.     CMP B, [C]
  68.     JNZ incrementoC
  69.  
  70. escreverFinalMensagem:
  71.     MOV [D], 41
  72.     INC D
  73.     MOV [D], 32
  74.     INC D
  75.     MOV [D], 61
  76.     INC D
  77.     MOV [D], 32
  78.     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