Nvis 5586A
Nvis Technologies Pvt. Ltd.
122
Program 15:
To Divide a String of Unpacked ASCII Digits.
Address
Opcode
Mnemonic
Comment
0400
B2 36
MOV DL, 36
DL HAVING THE DIVISOR, A SINGLE 8 BIT ASCII
DIGIT.
0402
BE 00 05
MOV SI, 0500
LOAD SI WITH THE STARTING ADDRESS OF
ASCII STRING.
0405
BF 08 05
MOV DI, 0508
LOAD DI WITH THE STARTING ADDRESS OF
THE RESULT LOCNS.
0408
B9 08 00
MOV CX, 0008
INITIALIZE THE COUNTER REG. WITH THE NO. OF
BYTES IN THE STRING
040B
80 E2 0F
AND DL, 0F
MS NIBBLE OF DL CONTENTS ARE ZEROED.
040E
32 E4
XOR AH,AH
INITIALIZE THE 8 BIT ACC (=00)
0410
AC
LODSB
LOAD AL WITH THE CONTENTS OF ADDRESS
ACCESSED BY SI REG.AND INCREMENT SI REG. I.E.
POINT AT THE NEXT ADDRESS LOCN.
0411
80 E0 0F
AND AL,0F
MS NIBBLE OF AL CONTENTS IS ALSO ZEROED
0413
D5 0A
AAD
PERFORM THE FN. AL=(AH * OA) + AL), AH = 00.
0415
F6 F2
DIV DL
PERFORM THE FN. AD/DL AL = QUOTIENT AND AH =
REMINDER.
0417
AA
STOSB
THE CONTENTS OF AL ARE STORED IN THE ADDRESS
POINTED TO BY THE DI REG. AND NEXT ADDRESS
LOCN IN DI REG. IS POINTED (I.E. CURRENT ADDRESS
LOCN OF DI REG. IS INCREMENTED BY ONE).
0418
E0 F5
LOOPNE 0410
CONTINUE DIVIDING THE UNPACKED ASCII DIGITS IF
THE CONTENTS OF C ARE NOT ZEROED; ELSE.
041A
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 :
31
0508 :
00
0501 :
32
0509 :
02
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...