Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9574766

Have any Question?


Related Questions in Computer Engineering

Why regulated industries should be required to follow

Why regulated industries should be required to follow security standards. Provide 2 examples of industries that would fall under this category.

Question a tank for propane gas is a cylinder with

Question : A tank for propane gas is a cylinder with hemispheres at each end. Write a process that asks the user to enter the length of the cylinder and the radius of the cylinder (same as the radius of the hemisphere (s ...

Suppose you had the following backup plan full backups on

Suppose you had the following backup plan: Full backups on the first Sunday of every month, differential backups on the other Sundays of the month, and incremental backups M-F. Suppose something bad happened on April 26t ...

In a standard s - t maximum flow problem we assume edges

In a standard s - t maximum flow problem, we assume edges have capacities, and there is no limit on how much flow is allowed to flow through a node. In this problem, we consider the variant of the maximum flow and minimu ...

Question suppose you have a 50-bit string that contains

Question : Suppose you have a 50-bit string that contains exactly 37 ones at random positions. How many bits of entropy does this string contain?

Maureen has preferences for two goods to be consistent with

Maureen has preferences for two goods to be consistent with the utility function. The price of good 1 is $4 each, and the price of good 2 is $12 each. For what incomes will good 1 be normal?

Question suppose a process in host c has a udp socket with

Question : Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and Host B each send a UDP segment to Host C with destination port number 6789. Will both of these segments be directed t ...

Shellys preferences for consumption and leisure can be

Shelly's preferences for consumption and leisure can be expressed as U(C, L) = (C - 100) (L - 40). This utility function implies that Shelly's marginal utility of leisure is C - 100 and her marginal utility of consumptio ...

The equation of regression line for sons heighty in inches

The equation of regression line for son's height(y) in inches versus father's height in inches is y = 35 + 0.5x. For a 72 inch tall father, what would we predict for the son's height?

Part 1 if false change the incorrect parts to make them

Part 1, If false, change the incorrect parts to make them true. DO NOT NEGATE THE FALSE SENTENCES. 1. According to the weak-form efficient market hypothesis, investors can take advantage of historical information. 2. The ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As