Message board for the users of flat assembler.
> DOS > Porting Tandy&Soundblaster emulation code from TASM to FASM
Hello everyone! This is my first post in this forum.
Some months ago, I decided to take up the task of porting the source code of two useful DOS tools from TASM to FASM syntax. The main reasons being that I wanted to liberate the source code from their dependency on proprietary build tools, because I wanted to start dabbling with assembly programming in my spare time and because I was hoping it could provide a nice basis for a possible future Sound Blaster (and Tandy) emulator for computers with more modern audio devices, such as AC'97 and/or Intel HD Audio. I know you can pretty much emulate entire systems with DOSBox these days, but where's the fun in that?
First a little background on my assembly skills: I've played with it in my late teens, and learned and practiced some assembly language at college, which is quite some time ago. I am an experienced Java developer by trade, but lately I've been drawn more to some wholesome old-fashioned low-level software engineering. Ah, the rose-tinted glasses of nostalgia.
The source code in question was released by the author and with his permission, I published them on GitHub: https://github.com/volkertb/temu-vsb
My first priority seemed getting rid of the dependency on TASM, which meant porting over the code from one assembly dialect to another. FASM appeared to be the obvious choice, considering its DOS support, its developer community and the available documentation. This porting step seemed a fun and interesting step to ease into assembly language at first, but quickly proved much more complicated than I had expected. Eventually, I started to realize that I may have bitten off more than I can chew.
So far, I've only tried porting TEMU (the Tandy Emulator), since it appeared to be the simplest of the two.
The first steps weren't too hard to figure out, thanks to some Googling:
At this point, I hit my first snag:
..\386pdef.asm 7 locals @@ error illegal instruction.
It took me quite a bit of Googling to figure this one out and I could hardly find any info on this, but I believe this directive meant something like "treat all labels prefixed with @@ as local labels". It would appear to be a redundant declaration, since "@@" is apparently the default prefix for local labels already. Please correct me if these assumptions are wrong! Anyway, assuming this, I removed this directive, although it left me worried about how different the default behavior with regards to local and non-local labels would be in FASM. Does FASM also automatically treat labels prefixed with "@@" as locals, and if not, how can I tell it to do so? Anyway, I decided to just try to continue fixing each error as I encountered it.
The next issue I came up with was that struc blocks apparently have a different syntax in FASM than in TASM. The first struc the assembler encountered and choked on:
Desc386 struc SegLimit dw ? ; limit bits