theinhumaneme

SEARCH

Oct 28th, 2021
1,035
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ASSUME CS:CODE,DS:DATA
  2. CODE SEGMENT
  3. MOV AX,DATA
  4. MOV AL,00H
  5. MOV CL,ARRAYSIZE
  6. MOV DL,KEY
  7. MOV SI,OFFSET ARRAY
  8. ITER: ;ITERATION CODE BLOCK
  9.     CMP DL,[SI]
  10.     JE FOUND ; IF EQUAL TO KEY EXIT LOOP
  11.     INC SI
  12. LOOP ITER
  13. MOV AX,0000H
  14. JMP EXITOUT
  15. FOUND:
  16.     MOV AX,1111H
  17.     JMP EXITOUT ;EXIT CODE
  18. EXITOUT:
  19.     HLT
  20. CODE ENDS
  21. DATA SEGMENT
  22. ARRAY DB 01H,05H,11H,25H,10H ; DEFINE YOUR ARRAY
  23. ARRAYSIZE DB 05H ;DEFINE ARRAY SIZE
  24. KEY DB 25H ; DEFINE THE LETTER TO BE FOUND
  25. DATA ENDS
  26. END
RAW Paste Data