I am trying to make a program that can convert decimals to binary. But there's no standard out that prints in binary. Can some one explain how I can do this. Any help will be appreciated. thanks.

program DecimalToBinary;
#include( "stdlib.hhf" );
static
 iNumber: int8 := 8;
begin DecimalToBinary; 
 stdout.put( "Give me a decimal value please: " );
 stdin.get( iNumber );
 mov( iNumber, AH );
 stdout.put( "The number ",iNumber, "in binary is %", AH, nl );
end DecimalToBinary;

There might be something built-in, but I'm not familiar enough to give a definitive answer. You might like to look at having a crack at writing your own function to convert an integer into a binary number, stored as a string so you can print it. Wikipedia sums it up nicely https://en.wikipedia.org/wiki/Binary_number#Decimal

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.