Hello everyone,
I have to write a code to creat a pseudo assembler..I have an input file from which i read the assembly instructions from there i get the register numbers ...i have to convert that into machine code..i.e binary form...
Now my problem is that i can find the register values convert them into integer.....i can convert the integer into binary using itoa.......
but if my register number is 5 i am getting the binary as 101....but i need the binary to be 00101....can anyone please explain how to get the zero padding done......