answersLogoWhite

0


Best Answer

Org 1000

mov si,1100

mov di,1400

cld

mov bl,20h

next: lodsb

cmp al, bl

je exit

sub al,30h

cmp al,0ah

jc store

sub al,07h

store: stosb

jmp next

exit: hlt

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

As you did not specify, I will assume you are talking about three-bit binary-reflected gray code. The procedure for other possible codes and lengths would be similar.

The code table of three-bit gray code
D bin gray D'
0 000 000 0
1 001 001 1
2 010 011 3
3 011 010 2
4 100 110 6
5 101 111 7
6 110 101 5
7 111 100 4

The format of this table is:
Decimal number; bits B2,B1,B0 of natural binary number; bits G2,G1,G0 of binary number in gray code; decimal representation of the gray code number

To get natural binary numbers from the gray numbers, we need to follow the algorithm defined by the table:
( Dec' -> Dec )
zero stays zero
one stays one
three becomes two
two becomes three
six becomes four
seven becomes five
five becomes six
four becomes seven

Let us search for rules in the transformation, so our program can detect which number it is working with and how to change it to natural binary.
Both 0 and 1 don't change. Their shared property is 00 in the higher two bits.
3 and 2 change places. They both have 01 in higher two bits, and the program should toggle the lowest bit.
Next we have the circular changes 7 -> 5 -> 6 -> 4 -> 7. This is a bit trickier, but if we analyse their binary forms, we can see that any number that has 10 in its top two bits needs to have its low two bits toggled (ie. 100 becomes 111, and 101 becomes 110). Similarly, those numbers with 11 in top two bits need to have their middle bit set to 0 (ie. 110 becomes 100 and 111 becomes 101).

In essence, the program should check for the two higher bits, and depending on the values there, perform one of these four operations. That check can be done in several ways, depending on what you can do with your microcontroller. Perhaps the easiest would be using a mask to set all other bits to zero and analysing what's left.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

// INCLUDE HEADER FILES NEEDED BY YOUR PROGRAM

// SOME LIBRARY FUNCTIONALITY MAY BE RESTRICTED

// DEFINE ANY FUNCTION NEEDED

// FUNCTION SIGNATURE BEGINS, THIS FUNCTION IS REQUIRED

int grayCheck(char term1, char term2)

{

// WRITE YOUR CODE HERE

}

// FUNCTION SIGNATURE ENDS

// DO NOT IMPLEMENT THE main( ) METHOD

int main()

{

//DO NOT CHANGE ANY CODE IN THIS FUNCTION

int a;

char c1,c2;

//ASSUME INPUT HAVE ALREADY BEEN TAKEN

a=grayCheck(c1, c2);

return 0;

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Lda 8050h

cpi oah

jnc l1

adi 07h

adi 30h

sta 9000

hlt

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

just add 3 to the number which you want ti convert into gray code

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
4y ago

45

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Assembly language code for the Conversion of ascii to binary using 8085 microprocessor?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the two types of machine language?

1- Binary language 2- Assembly Language


What the two types of machine?

1- Binary language 2- Assembly Language


What are two types of machines?

1- Binary language 2- Assembly Language


Decimal to binary conversion in c language?

sscanf, atoi, strtol, ...


How do you convert binary to hexadecimal using assembly language?

In order to convert binary to hexadecimal using assembly language, the programmer must possess an understanding on boolean algebra or binary system in other words. A compiler is also needed to complete the program.


What is the language of 0s and 1S?

The language of 0s and 1s is called binary which is internally used by the computer system for performing different activities. The other levels of languages such as high level languages, assembly language are internally converted into binary language for the processing by the computers.


How assembly language communicate with the CPU of any computer devices?

Assembly language code is the lowest-level form of programming before Machine code (binary), and each command in Assembler code directly references binary commands which tell the CPU what to do.


What are the characteristics of assembly language?

Assembly language is a low level language that uses mnemonics to represent each operation. Instead of using pure binary, like machine language does, these mnemonics allow for greater readibility and ease of understanding that binary does not. Additionally, an assembly language will have a set of data definitions that dictates where and how variables and their assigned data are stored.


What digits do you use in assembly language?

Most assemblers support binary, decimal, hexadecimal and octal notations.


How does the microprocessor work?

Suppose we give a 8-bit instruction ADD B to the microprocessor then this instruction is not at all understood by microprocessor as it only accepts binary inputs so first of all it stores the instruction in the INSTRUCTION REGISTOR then it decodes this instruction ADD B to its suitable binary code 80H in the INSTRUCTION DECODER.. after converting to 80H then the microprocessor understands that .. yes i have to add the content of the resistor B with that of A(accumulator) and store the result in the accumulator A this is a small example how microprocessor operates facing the instructions


What is the first x86 Microprocessor?

"The x86 architecture first appeared as the Intel 8086 CPU released in 1978, a fully 16-bit design based on the earlier Intel 8085. Although not binary compatible, it was designed to allow assembly language programs written for the 8085 to be mechanically translated into the equivalent 8086 assembly. " Here's the entire Article: http://en.wikipedia.org/wiki/X86


What is binary language?

Binary is made up of 0's and 1's. Binary can also be called Machine Code. Binary is the 'language' that the computer understands.