Shop OBEX P1 Docs P2 Docs Learn Events
x86 asm to .bin compiler — Parallax Forums

x86 asm to .bin compiler

PashaPasha Posts: 56
edited 2008-11-23 11:48 in Propeller 1
would it be possible to create a x86 assembler that assembles to to a file that could be run by a pasm program that would act as a bios (giving keyboard, memory, ...) I really don't know a lot about this, but I would be interested in helping anyone who would like to work on such a project.

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2008-11-21 17:58
    Hello Pasha,

    I'm not familiar with x86. But I think x86-assembler is So different from prop-asm that this would be really hard to do
    It even might be that way that a x86bios is much bigger than 2K what you have as COG-RAM and even bigger than 32kB
    as this is the limit of HUB-RAM. There would be A LOT OF work to emulate x86-code in Prop-ASM.

    I think it will take only 20% of time to develop something like this NEW in Prop-ASM.

    What do you want to do in the end ?

    Maybe there is a much easier solution than going all the way of x86 assembling to Pprop-ASM

    best regards

    Stefan
  • AleAle Posts: 2,363
    edited 2008-11-21 18:18
    I think it was heater, but I could be mistaken, that made a 8080 emulator (to run CP/M) for the propeller. It works, you may want to have a look at it to see what means something like what you propose, but for a much smaller processor.

    The x86 ISA is vast (bloated), only supporting a subset like 8086 instructions means loads of them. You may want to have a look at the 8086 emulator inside the MAME (Multiple arcade machine emulator), an old version will do, I think they use jit nowadays.

    You have native C compilers, several languages... it may not be the best approach to just run some off the shelf code (the orignal IBM bios is 8K, the DOS 3.3 is something like 128K together...), though.
  • PashaPasha Posts: 56
    edited 2008-11-22 07:25
    WHat I was thinking would be that you could save time and make the end result faster by changing the code before it gets to the propeller, that way the prop doesn't have to emulate at run time. Just an idea, I really don't know X86 asm at all, anyway, so I was just wondering if such a thing could be done.

    The bios I was thinking of would have to be different than a pc bios because it would use things like the keyboard driver and vga driver. I think it could potentially be built out of Mike Green's os even.

    If anyone could tell me a good site to learn x86 asm that would be great.
  • AleAle Posts: 2,363
    edited 2008-11-22 07:52
    COuld you plase explain in a more detailed way exactly what you want to achieve ? I thought you wanted to run x86 code in the propeller.

    There are loads of tutorials around the web, programmersheaven.com may be of help. There are also many books from the 80s about that topic. I used one of these, I do not remember which one:

    www.amazon.de/Nortons-Assembly-Language-Utility-Software/dp/013662149X/ref=sr_1_1?ie=UTF8&s=books-intl-de&qid=1227340284&sr=1-1

    www.amazon.de/Assembly-Language-Primer-Personal-Computer/dp/0136619010/ref=sr_1_3?ie=UTF8&s=books-intl-de&qid=1227340284&sr=1-3

    www.amazon.de/Assembly-Language-Pc-Book-Disk/dp/1566860164/ref=sr_1_2?ie=UTF8&s=books-intl-de&qid=1227340284&sr=1-2

    I'm not affiliated with any of them.
  • PashaPasha Posts: 56
    edited 2008-11-22 08:23
    I want to make a .bin file out of free dos that could be run by a propeller bios program which would give things like keyboard, memory, and video access to that program.
    I was thinking that the bios might even be able to split up the tasks and use all available cogs to make it faster. this is what I wanted.
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-11-22 11:29
    Hello Pasha,

    aha NOW we REALLY KNOW what you want to do ! Somehow and somehow still NOT.

    If you try to run real MS-DOS software on a propeller - just forget it

    if you want the functionality of something like free-dos or ms-dos itself
    meaning list up files, copy files delete files etc. take one of the Propeller-DOS-versions that already exist

    f.e. superdos by tpw_man

    best regards

    Stefan
  • PashaPasha Posts: 56
    edited 2008-11-22 13:00
    I want an os. I just want to run qb45 and edit and a few other things
  • heaterheater Posts: 3,370
    edited 2008-11-22 13:08
    Yep, that was was me running CP/M in an 8080 emulator for the Prop.
    http://forums.parallax.com/showthread.php?p=711157.
    I'm still tinkering with it from time to time.

    The question of x86 emulation has come up a number of times. A quick look at the x86 instruction set will soon convince you that you really don't want to do that. It's big, complex and ugly. The resulting emulator is bound to be awful slow.

    Is there any pressing need to do so ? We already have the equivalent of a BIOS in the various existing keyboard, mouse, video, etc drivers. We already have a DOS in the form of the SD card file system.

    So why did I make my 8080 emulator? As a learning exercise, just for fun and my tribute to Gary Kildall.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • BradCBradC Posts: 2,601
    edited 2008-11-22 13:30
    Pasha said...
    I want an os. I just want to run qb45 and edit and a few other things

    You don't have hope I'm sorry. Oldbitcollector has written a text editor and Mike Green has several excellent basic interpreters, but that's about as close as you are going to get.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
  • JerryNJerryN Posts: 32
    edited 2008-11-22 17:18
    I think what you want is a cross-assembler - X86 source statements with prop machine code output. I haven't written X86 programs for several decades and am not all likely to do so again but I would think there would be major difficulties with X86 addressing modes, segment registers, interrupts, and return stacks. If I felt a need to tackle this (I don't!) I would probably try to cross assemble the X86 source statements to PASM source statements, embed them under DAT, and let the Propeller tool create the necessary machine codes. I am sure that it can be done but I am not sure it would be useful.

    Jerry
  • PashaPasha Posts: 56
    edited 2008-11-22 19:25
    Thanks everyone.
    Jerry that is exactly what I had meant. sorry I couldn't make myself clear. I will fool around with it, and see what I come up with. until then,
    best regards,
    Pasha
  • kwinnkwinn Posts: 8,697
    edited 2008-11-22 20:07
    Pasha, even writing a cross assembler to translate x86 assembler to pasm (running on a PC) would be a monumental (if not impossible) task. The architecture of the processors are totally different. Even if it were possible the result would be very slow and all but the simplest programs would take up more memory and resources than the prop has. If all you want to do is run FreeDos, Basic and a text editor take a look at the smaller format x86 boards. They come with a bios, keyboard and mouse input, video output, USB, parallel, and serial ports, as well as SD card slots and HDD interface. One of these boards would make an excellent development PC. There are several suppliers of these boards, and I have used some of the products from the two whose links are below. Take a look at them as a starting point, and check out Circuit Cellar magazine for more info.
  • PashaPasha Posts: 56
    edited 2008-11-23 11:48
    Thanks for all the information.
Sign In or Register to comment.