Assembly Language Programming Lesson 4: Binary Counting. By Robert M (adapted by Duane Alan Hahn, a.k.a. Random Terrain). As an Amazon Associate I earn from qualifying purchases. (I get commissions for purchases made through certain links on this page.). .data msg1 db 'enter hexadecimal value:$' msg2 db CR, LF 'in decimal it is: 1' char db?, '$'.CODE Main proc mov ax, @ data;initialize data set.
Write a Assembly program for ASCII-Binary conversion with proper output . First of all do ASCII-Gray conversion by Dividing the ASCII number by 2 until the quotient is 0 .
Algorithm for ASCII-Binary conversion
Step I : Get the number whose binary code equivalent is to be found. Step II : Initialize count in CL = 08 H Step III : Divide the number by 2 i.e. shift the number by 1 it to the left. Step III : Display the bit shifted in carry. Step IV : Decrement count Step V : Check if count =0 ? Step VI : If yes go to step VII else go to step III. Step VII : Stop.
Program Code for ASCII-Binary conversion
How to Run this Program
For Running this program you should have installed Tasm on you computer . If you have not installed Tasm yet please install from Here .
Result : 0000 1010
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |