|
||||||
| General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hi.
I am (for learning reasons) trying to develop a very small programming language. My language compiler works by compiling the code written, to x86 assembly, and then "compiling" the assembly to machine code. The problem is that I don't know how to do the last step. I have heard that each assembly instruction must be compiled to 8-bits that the CPU can understand. So compiling the following assembly code, would generate 2X8bits, like seen below. mov ax, 1234h 00101000 //these 8bit strings are just guesses mov bx, ax 10011010 Is my theory correct that all assembly instructions must be compiled to an 8bit code that the CPU can understand? If yes, does anyone know where to get a list of these 8bit codes for each x86 assembly instruction? If I am completely wrong about everything, please write how assembly is really converted into machine code. Thanks. |
| Sponsored Links |
|
|
|
|||||
|
Usually, you would use an appropriate assembly compiler for your last step. I know Intel provides one.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
sorry, no links alowed, first post
avr and microchip (2 brands of IC's often used by hobbyists) also use ic architectures based on intel's cpu's. And the communities around it might proof useful for getting technical information about it. |
|
|||
|
Basically you usually use the assembler, linker and loader provided by the platform. Assemblers are quite simple, there are basically direct translations between mnemonics and binary opcodes, just pick up the Intel developers manual from their site (they will probably send you a hard copy for free if you ask) and then write something that translates between them. You have to pick a binary output format (elf, coff, etc) as a target. Naturally pick a binary format that can be linked by your linker.
__________________
Currently bemused by: LLVM. |
|
|||
|
The Intel manuals have the opcodes and the mnemonics.
__________________
Currently bemused by: LLVM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Basic Calculator | AfTriX | VB Tutorials | 3 | 02-29-2008 08:53 AM |
| assembly code help | emaney | General Programming | 0 | 06-16-2007 04:27 AM |
| Please Help With A C Program!! | siren | C and C++ | 7 | 04-17-2007 08:45 AM |
| Where to Put PHP Code | clookid | PHP Tutorials | 1 | 01-11-2007 08:44 PM |