Skipperdoo32: Well if you want to write it in assembly, then you simply enter the instructions (with syntax following a convention) in some plain-text file (as with most programming language) and then give the file to assembler, which will produce appropriate machine code. That of course depends on what processor architecture you want to program, because they differ. There are several assemblers for x86 (what PC's usually use), for example MASM32 or NASM. You need to check their documentation for syntax details.
If you don't want to use even assembler, then you'll have to get instruction table for given processor and find the opcodes yourself, although this is very tedious and usually pointless. You can use some hex-editor (HxD for example) to write raw binary data into some file, than you can then load in the memory and let the processor execute it, that of course depends on architecture you want to program - in some (usually MCU's) you usually just flash the machine code into ROM, but on Windows for example, you would have to add header and other additional info to form a PE executable (tautology I know).
However! To make it somewhat simple, you can actually write assembly code in C/C++ using the asm statement. It's quite advanced feature, since it requires a knowledge of what's going on in the language and processor. However, you still don't need to handle other needed stuff, because C/C++ compiler sets up the wrapping code and data for you. You can do it like this:
Code:
// C/C++ code
asm
{
// assembly code here
}
// C/C++ code
If this doesn't work with some compilers, add double underscores before the asm keyword:
Code:
// C/C++ code
__asm
{
// assembly code here
}
// C/C++ code