#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    13
    Rep Power
    0

    ASM and HEX conversion table x86


    Hey.. I was searching around for an ASM forum here to ask this and there wasn't one, but someone said to post here on another thread. Anyway, I can't learn ASM cuz I can never find the combination of a tutorial, assembler, and syntax that'll work together right. I've been frustrated over and over, and am just sick of it. I have therefore decided to write my OWN assembly language, by learning machine language hex (and then making an assembler that makes sense to me).

    Anyway in order to do this I need only one tool: a conversion table of hex codes and the commands they mean. I will then make a program that copies the file, and replaces the mnemonics with their hex counterparts. Sounds quite simple to me, and I get to be the one who designs the assembler, so I can't complain about it ^-^.

    BTW: I googled for this for like an hour and a half, found nothing but 68k motorola conversion tables... Am rather confused as to why I couldn't find it, seems like ASM is a big secret on the 'net, lol...
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2004
    Posts
    1,676
    Rep Power
    133
    Originally Posted by Yushatak
    Anyway, I can't learn ASM cuz I can never find the combination of a tutorial, assembler, and syntax that'll work together right. I've been frustrated over and over, and am just sick of it.
    You can't understand assembly...

    Originally Posted by Yushatak
    I have therefore decided to write my OWN assembly language, by learning machine language hex (and then making an assembler that makes sense to me).
    So you're going to write your own assembler?

    Isn't that like saying you can't read well, so you're going to rewrite Shakespeare?

    Originally Posted by Yushatak
    Anyway in order to do this I need only one tool: a conversion table of hex codes and the commands they mean. I will then make a program that copies the file, and replaces the mnemonics with their hex counterparts. Sounds quite simple to me, and I get to be the one who designs the assembler, so I can't complain about it ^-^.
    How much of this do you really think you know?

    Originally Posted by Yushatak
    BTW: I googled for this for like an hour and a half, found nothing but 68k motorola conversion tables... Am rather confused as to why I couldn't find it, seems like ASM is a big secret on the 'net, lol...
    Maybe try "instruction set".

    Comments on this post

    • °Oblivion°King° agrees : you're really good...
    • peenie agrees : <3
    Any advertisement triggered by IntelliTxt in this post is not endorsed by the author of this post.
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    611
    Rep Power
    65
    Intel has a website with most of its documentation:
    http://www.x86.org/intel.doc/inteldocs.htm

    You can not simply translate hexnumbers to assembly code, much of the code are combinations of hexnumbers, or just data streams. So you have to look ahead to make sense.

    My advice, learn C!
    It is a low level language close to ASM.
    Last edited by Dietrich; August 2nd, 2006 at 07:50 AM.
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    13
    Rep Power
    0
    @first poster
    I tried instruction set, googled for 8086 instruction set, x86 instruction set, intel instruction set and a bunch of others. As I said I searched for quite a while. And yes I am up for writing the assembler, thats the easy part. I am going to do it in a language I am familiar with (very high level) because the assembler itself doesn't have to be low-level.

    @second poster
    I've tried C, but it seems that every win32 compiler has some sort of quirk that makes it hard to learn with (digital mars is missing standard libraries and won't work with downloaded ones, for example).. if you could point me toward one that's straight forward and not missing components I will indeed go off and try C again ^^. It seems to me that *nix is much better for C dev, and I know a decent amount of *nix, but that still won't help me make windows programs V-V (which is one of the things I'd like to do if I learn C, make DX9 games).

    I will again google for the instruction set, but I doubt I will find it. I will post it here if I do, so that ppl who search may find it.

    Edit: Oh and reading back I'm trying that site that poster #2 suggested, found a pdf but i've gotta install reader to chek it out. Also, I do KNOW asm, at least a bunch of basics, such as labeling, jmp, jnz, mov, etc. and I am well versed in the workings of the processor (except flags, not too big on them). This is why I think I can do it, I understand the underlying concepts..

    Edit2: Yeah this document I found seems to be exactly what I was looking for, it has big (though a bit confusing, I'll have to read up to understand a bit of it) tables of opcodes and prefixes and the like for assembling a complete instruction.

    The doc I am now using is the "80186 Instruction Set" at the link mentioned above.. took a while to find it with all of the other technical docs about, but its under the 80186 section, which'll help anyone else looking.

    K I'm off to google machine language prefixes :D
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    123
    Rep Power
    18
    I can't learn ASM
    I do KNOW asm
    Ok... well, ASM isn't that hard to learn the basics. Mastering it is where it gets difficult. Writing your *own* assembler, however, requires an intimate knowledge of assembly and the target platform... which, if you don't know assembly all that well, you probably don't have.

    Like asm, C is easy to learn the basics. If you're looking for a good compiler, try Dev-C++ (it does straight C too). It should have all the necessary libraries, etc .

    As a general warning though, writing an assembler is *not* the way to learn asm... no more than writing a C compiler is the way to learn C. You need to know the language first, and maybe (*maybe*) one day you'll want to try writing an assembler. After all, what language were you going to write the assembler in?! :)

    Hope that provides some insight.

    - Nate

    edit: I don't think digital mars is missing anything. You can always come back and post again if you can't get the compiler up and running! :)
  10. #6
  11. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    611
    Rep Power
    65
    Dev-Cpp is an Integrated Development Environment (IDE) that allows you to develop C and C++ projects. The C compiler is GCC, a very complete public domain C compiler.

    As expected, some learning is to be done. There is a helpful forum, if you have problems.

    Dev-Cpp is free at:
    http://sourceforge.net/projects/dev-cpp/

    Dev-Cpp forum:
    http://sourceforge.net/forum/forum.php?forum_id=48211

    Comments on this post

    • intx13 agrees
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    13
    Rep Power
    0
    Ill chek some of those compilers out when I get a chance, but for now I'm done for today, and I'm actually making good progress on redocumenting the instruction set. Regardless of whether or not I end up trying to make this assembler-esque language, it will still be useful to have a little bit shorter documentation, as I am transcribing it leaving out unnecessary things (words, parts of docs that have nothing to do with my project). I am also turning their big confusing tables for opcodes and stuff into a simpler list. I'll finish that stuff to release, but I will indeed try C again sometime soon.

    Ty.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2006
    Posts
    110
    Rep Power
    25
    What are you looking for exactly? Writing your own assembler is a little over the top, no? In what language are you going to write it?

    If you want a tutorial, I'll write you one. I'm a HUGE fan of assembly. x86, SSE, MMX, m68k whatever. Nasm is free and works fairly well. I have my own modified version that makes function writing a lot easier. But it's not necessary.

    What do you want to use? Do you have any preference?

    Here's my first tutorial. You need to know this stuff before you program in anything.
    bits and bytes
    Go over it and tell me if it suits your style. Although you may know this stuff already, there may be stuff about terms and operations that will refresh your memory. Realise these things take time to write. But I would really like to write this kind of tutorial specific to assembly.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2006
    Posts
    2,270
    Rep Power
    1737
    I think this thread made my day...

    Anyway, Yushatak, if you aren't getting the hints we give you, well, you'll eventually realise it.

    Actually, it may be worth mentioning this. Consider writing a metalanguage and then using a script to convert to regular ASM, if that's really all you care about.

    Comments on this post

    • peenie agrees : wasn't there a thread recently: "opengl is too hard to learn; so how do i write my own graphics card drivers?"

IMN logo majestic logo threadwatch logo seochat tools logo