Program for encoding ASCII alpha numeric, Computer Engineering

Assignment Help:

Q. Program for encoding ASCII Alpha numeric?

; A program for encoding ASCII Alpha numeric.

; ALGORITHM:

            ; create the code table

            ; read an input string character by character

            ; translate it using code table 

            ; output the strings 

 DATA   SEGMENT

CODETABLE DB 48 DUP (0); no translation of first 

                                                ; 48 ASCII

                                    DB '4590821367'; ASCII codes 48 - 

                                                ; 57 ≡ (30h - 39h)

                                        DB 7 DUP (0); no translation of          these 7 characters

                                        DB    'GVHZUSOBMIKPJCADLFTYEQNWXR'

                                        DB 6 DUP (0); no translation

                                        DB  'gvhzusobmikpjcadlftyeqnwxr'

                                        DB 133 DUP (0); no translation of remaining 

                                                 ; Character

DATA ENDS

 

CODE SEGMENT

            MOV AX, DATA

            MOV DS, AX   ; initialize DS

            MOV BX, OFFSET CODETABLE; point to lookup table

GETCHAR:     

            MOV AH, 06; console input no wait

            MOV DL, 0FFh   ; specify input request

            INT 21h; call DOS

            JZ QUIT   ; quit if no input is waiting

            MOV DL, AL   ; save character in DL

            XLAT CODETABLE; translate the character

            CMP AL, 0; translatable?

            JE PUTCHAR   ; no: write it as is.

            MOV DL, AL; yes: move new character

                                    ; To DL

PUTCHAR:     

   MOV AH, 02   ; write DL to output 

   INT 21h  

   JMP   GETCHAR; get another character

QUIT:             MOV AX, 4C00h  

   INT 21h  

CODE ENDS    

END

Discussion: 

The program above will code the data. For illustration a line from an input file will be encoded:

A SECRET Message                          (Read from an input file)

G TUHFUY Juttgou                           (Encoded output)

The program above can be run by using following command line. If program file name is coding.asm

Coding infile > outfile 

The infile is input data file and outfile is output data file.

You can write more such applications by using 8086 assembly tables.


Related Discussions:- Program for encoding ASCII alpha numeric

Storage technology, Storage Technology: In the previous section, the, ...

Storage Technology: In the previous section, the, recent innovations relating to the processing aspects of computer technology were discussed briefly. In considering some of t

Explain bus interface unit, Q. Explain Bus Interface Unit? BIU (Bus Int...

Q. Explain Bus Interface Unit? BIU (Bus Interface Unit) mainly interacts with system bus. It executes nearly all the activities relating to fetch cycle like:  Computing

Advntages of parallel processing oversequential computation, Advntages of p...

Advntages of parallel processing oversequential computation Parallel computing has the following benefits over sequential computing: i)    Accumulate time ii)   Solves b

Artificial life - artificial intelligence, Artificial Life - artificial int...

Artificial Life - artificial intelligence: Give birth to new exits forms.  A swot of Artificial Life will certainly direct on what it means for a complex system to be 'aliv

Types of e-commerce , Types E-commerce generally based on advertising, sell...

Types E-commerce generally based on advertising, selling, marketing and buying, but due to the differences in needs, e-commerce has been classified according to the parties of the

Allocation of bits among opcode and operand, Allocation of Bits among Opcod...

Allocation of Bits among Opcode and Operand The trade-off here is between numbers of bits of opcode vs. the addressing capabilities. An interesting development in this regard i

Linear array-various interconnection networks-fully connecte, Linear Array ...

Linear Array This is a mainly fundamental interconnection pattern.  In this processors are linked in a linear one-dimensional array. The intial and last processors are linked w

Analysts in telecommunications area, Q. Analysts in Telecommunications area...

Q. Analysts in Telecommunications area? Here computer networks which play a critical role in success of any business are designed, implemented and managed. Here Network analyst

Define the karnaugh maps (k maps), Define The Karnaugh Maps (K Maps) Th...

Define The Karnaugh Maps (K Maps) The Karnaugh map (K map) provides the systematic method for simplifying a Boolean expression or a truth table function when used properly the

Differentiate between protected and real modes of an intel, Differentiate b...

Differentiate between protected and real modes of an Intel microprocessor Operation of Real mode interrupt: When microprocessor completes executing the current instruction, it

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd