-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What assembler do you intend to target for 8086 code? #117
Comments
It does indeed build with nasm --- see src/build.lua, buildnasm(). I know it works because it generates binaries for the compiler tests! Might it be complaining (unhelpfully) about the segmentation instructions? The test build uses |
@davidgiven Yes, my mistake: Btw, while it's on my mind, how does the naming scheme of |
It needs an assembler for DOS. I can't find an open source one which supports segments and exes. (I have to target .exe in order to get small mode executables, where the code and data are in different segments. .com only works for tiny mode.) There is a nasm for dos but it's 386 or above only. Ideally I'd write my own but the 8086 instruction encoding is a nightmare... Re the naming scheme: it's |
Maybe it can be written in Cowgol :). Uhh, for prototyping any assembler/linker, I'd prob choose Rust or Zig. Then when that works, I can think about how to write it in Cowgol due to lack of recursion (and well, compiler algorithms love recursion). |
There's already a simple assembler framework in Cowgol --- look in src/cowasm. Currently it supports the TLCS90, PDP-11, 8080, and 6303. Half the instruction set is pretty orthogonal and wouldn't be too bad to implement, but there are lots of short form instructions that would have to be special cased somehow... |
I finally got around to compiling Cowgol. For starters, I was able to get 8086 codegen working from Linux using the following:
This gets me some shiny 8086 assembler, just how I like it :). However, this isn't quite enough to actually generate a working binary. Commit 18fc49f hints that you still need an assembler. Which assembler do you intend to target? I tried
nasm
and got the following error:I'm guessing the assembler has yet to be written :)?
The text was updated successfully, but these errors were encountered: