Hey im new in this forum but really need help with making program on assembly 8086 that will take a string of 4 characters , then check if they are right and after that convert them to binary and decimal, then again hexadecimal, and in the end print something like this :

ADRESS: BINARY: DECIMAL: HEXADECIMAL:

FF00 1111111100000000 65280 16500

D3C2 1101001100101100 54060 1614

3344 0011001101000100 13124 3344

Im actually very bad in assembly , but im good in C , so i wrote it and tried to convert it to assembly, it didn't work :( , so it took 3 days just to understand how to make scanf function in assembler , and in two days i must finish this program, please help me !!!!!

Here is a clue/key to what you can do.
I compiled this with the a86 compiler and watched the execution with (DOS) Debug.

Look what happens to the result in the output based on the setting of the first byte.

setBinary:
	mov si, strInput
	mov di, strOutput
doTest:
	test byte ptr[si], 8
	jz test4
	mov byte ptr[di+0], '1'
	
test4:
	test byte ptr[si], 4
	jz test2
	mov byte ptr[di+1], '1'
	
test2:
	test byte ptr[si], 2
	jz test1
	mov byte ptr[di+2], '1'
	
test1:
	test byte ptr[si], 1
	jz quit
	mov byte ptr[di+3], '1'
quit:
	int 20h
strInput:	db 'EF00$'
strOutput:	db '0000$'

Do you still need this?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.