Author Topic: Assemble 8088 program  (Read 18847 times)

nobody

  • Guest
Assemble 8088 program
« on: July 05, 2007, 06:19:27 PM »
Hi *, i'm beginner assembly programmer and i have to write a software project for my University course exam.
It will be an 8088 16-bit assembly software (I know...but i'm in Italy) and i don't know if can i use nasm to do this job.
Can i assemble my 8088 program in my Gnu/Linux 32-bit box and run o trace it in some ways?

thank you, and sorry for my bad english
regards Enrico.

nobody

  • Guest
Re: Assemble 8088 program
« Reply #1 on: July 05, 2007, 07:28:47 PM »
Hi Enrico,

Yes, Nasm should do fine assembling a program for 8088/8086 (not much difference from a programmer's viewpoint). If you add "cpu 8086" at the top of your source, Nasm will complain if you try to use an instruction not available on that CPU. You'll probably want to add "bits 16", just for clarity - Nasm will default to 16 bits in "-f bin" or "-f obj" anyway. Obviously, the "-f elf" or "-f win32" output formats wouldn't be suitable for 8088!

To *run* such a beast under Linux (or link it, if you need a linker, or trace it), you'll need to do it in an emulator, I think. Dosemu provides a pretty good, but imperfect, emulation of a 16-bit machine. If you're doing graphics, dosemu is not-so-good. Other emulators *may* do better (I doubt it)...

There's a guy who posts to news:comp.lang.asm.x86 who writes stuff for a real 8086 still, as a hobby. (we have "fun" in different ways!) Maybe get some advice there - maybe he'd even test your masterpiece on real hardware for you.

Don't worry about English - the CPU doesn't speak English! :)

Best,
Frank

nobody

  • Guest
Re: Assemble 8088 program
« Reply #2 on: July 06, 2007, 10:46:00 AM »
First of all thank you Frank.
I've read the nasm docs and found them very usefull and i want to ask you if is there a place (on www) where I can found more examples?
They will be very important for newbie like me to make some pratice.

cheers Enrico.

nobody

  • Guest
Re: Assemble 8088 program
« Reply #3 on: July 07, 2007, 08:08:18 PM »
> It will be an 8088 16-bit assembly software (I know...but i'm in
> Italy) and i don't know if can i use nasm to do this job.
> Can i assemble my 8088 program in my Gnu/Linux 32-bit box

As Frank wrote, NASM can target to 8086/8088 ;-)

Do you develop for "raw" or DOS ?

> and run o trace it in some ways?

NO. 2 options:

1. Use an emulator, like BOCHS or QEMU ;-)

2. Install FreeDOS besides GUN/LINUX (possible, potential troubles will origin rather from Linux than DOS) ;-)

> where I can found more examples

There is a HUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUGE
amount - with minor catch: 99.99% use MA$M syntax :-(

Check FASM forum: there are some interesting FASM 16-bit RM examples,
and FASM and NASM syntax are very similar ;-) Also, you can check
complete FASM: any host version supports ALL targets ;-)