Nvis 5586A
Nvis Technologies Pvt. Ltd.
113
Program 8:
Searching a number in given array.
Address
Opcode
Mnemonic
Comment
400
BE 00 05
MOV SI,500
403
BF 00 06
MOV DI,600
406
8A 0C
MOV CL,[SI]
408
46
INC SI
409
8A 04
MOV AL,[SI]
40B
46
INC SI
40C
3A 04
CMP AL,[SI]
40E
74 09
JZ END
410
46
INC SI
411
FE C9
DEC CL
413
75 F7
JNZ 40C
415
B0 FF
MOV AL,0FFH
417
88 04
MOV [SI],AL
419
8A 1C
END: MOV BL,[SI]
41B
88 1D
MOV [DI],BL
41D
CD 02
INT 02H
41F
F4
HLT
Note:
Press F7 button of keyboard (connected to techbook) and then press D, enter address
(from where data is to be entered), press enter and start feeding data.
Input:
500 = 04H (Length of Array)
501 = 35H (Element to be search)
502 = 18H
503 = 35H
504 = 54H
505 = 72H
Note: The element which one we want to search is stored at location 501h & The number of
elements in an array is stored at location 500H.
Result:
1.
If the element which one we want to search is in an array, then it will be store at
the location [600] i.e. 35 is stored
2.
If the element which one we want of search is not in an array, then FF will be
stored at location 600 to indicate ERROR condition.
Summary of Contents for 5586A
Page 2: ...Nvis 5586A Nvis Technologies Pvt Ltd 2...
Page 23: ...Nvis 5586A Nvis Technologies Pvt Ltd 23 Memory Read Timing in Maximum Mode...
Page 30: ...Nvis 5586A Nvis Technologies Pvt Ltd 30...
Page 48: ...Nvis 5586A Nvis Technologies Pvt Ltd 48 Diagram of module RESET power Instruction Set Note...