Advertisement
Guest User

test_shit

a guest
Mar 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include C:/masm32/include/console.inc  
  2.  
  3. .data
  4.   buf db 200 dup ('$')
  5.   sym db ?
  6.   err db 1
  7. .code
  8.   begin: outstr "Input text not longer than 100 characters: "
  9.          mov ebx, 1
  10.   L:     inchar sym; ввод очередного символа  
  11.          cmp ebx, 200
  12.            jb preOK
  13.          ja ERROR
  14.   preOK: cmp sym, '.'
  15.            cmp ebx, 1
  16.              je ERROR
  17.            ja NEXT
  18.          mov cl, sym
  19.          mov buf[ebx], cl
  20.          add ebx, 2
  21.          jmp L
  22.   NEXT:  mov ebx, 1
  23.      V:  cmp buf[ebx], '$'
  24.            je Q
  25.          outchar buf[ebx]
  26.          add ebx, 2
  27.          jmp V
  28.   ERROR: outstr "Incorrect input"
  29.   Q: end begin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement