Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flat Assembler
#1
Flat Assembler is a free open source assembler that uses Intel syntax, like MASM and DEBUG. It also supports mmx, sse, etc.

But unlike MASM, no red tape like ".code" is required. Try this:
test.asm:
Code:
mov  ax, 0013h
int  10h
retn
Then assemble it:
Quote:fasm test.asm test.bin
Then you can load the file into a string or array and CALL ABSOLUTE it:
Code:
' Comment out for qbasic:
'$INCLUDE: 'qb.bi'

' Load the machine code:
OPEN "test.bin" FOR BINARY AS #1
buffer$ = INPUT$(1000, #1)
CLOSE #1

' Run it:
'DEF SEG = SSEG(buffer$)  ' uncomment for QB 7.x and VBDOS far strings
CALL ABSOLUTE(SADD(buffer$))
The default output format is a plain dump of the machine code (like a .com file - this makes it a great replacement for DEBUG), but it can also assemble to DOS, Windows, and Linux executables.

The down side:
It doesn't seem to be able to create obj files, and although the syntax is Intel-ish there are some differences from MASM - it's actually a lot like Turbo Assembler's Ideal mode. It didn't take me long to get used to.

The documentation it comes with, "fasm.txt", is good, easy to understand, and includes examples. It's got a fairly active forum here, where people discuss fasm programming on dos, Windows, and Linux and using fasm to write your own OS.

I'm currently using it to write a toy operating system that boots up on a floppy. So far it switches to protected mode and responds to the keyboard.

You can see a working graphical operating system written entirely in FASM that fits on a floppy here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)