Nvis 5586A
Nvis Technologies Pvt. Ltd.
117
Program 12:
To find the maximum no. in a given string (16 Bytes long) and store it in location 0510.
Address
Opcode
Mnemonic
Comments
0400
BE 00 05
MOV SI, 0500
LOAD SI REG. WITH STARTING ADDRESS OF STRING.
0403
B9 10 00
MOV CX, 0010
INITIALIZE COUNTER REG. (WITH THE LENGTH OF STRING
I.E. NO. OF BYTES).
0406
B4 00
MOV AH, 00
INITIALIZE THE 8 BIT ACC.
0408
3A 24
CMP AH,[SI]
THE 1ST DATA BYTE OF THE STRING WITH‗00‘.
040A
73 02
JNB 040E
IF BOTH BYTES MATCH (ABOVE IS EQUAL) THEN BRANCH
TO (L).
040C
8A 24
MOV AH,[SI]
ELSE, MOVE THE CONTENTS OF (0500) INTO 8 BIT ACC, I.E.,
A REAL NO. IN AH.
040E
46
INC SI
POINT AT THE NEXT ADDRESS OF STRING.
040F
E0 F7
LOOPNE 0408
DECREMENT
THE
COUNTER
VALUE,
IFNOT
ZERO,
CONTINUE PROCESSING (SEARCHING TO THE MAX. NO.
CONTINUED.)
0411
88 24
MOV[SI],AH
MAX. NO. IN 0510 ADDRESS.
0413
F4
HLT
HALT.
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.
For example:
After Execution
0500 : 01
0508 :
12
0501 : 02
0509 :
08
0502 : 03
050A :
09
0503 : 04
050B :
0A
0504 : 05
050C :
0B
0505 : 06
050D :
0E
0506 : 15
050E :
0C
0507 : 07
050F :
0D
0510 :
15
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...