flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2, 3, 4 Next |
Author |
|
Chewy509 06 Jun 2005, 05:52
The B0 language and compiler came about during an effort to create my own Operating System. The main problem faced, was the C was too high level, and coding in assembler was a pain (even though 80% of my code is pure asm, and the other 20% is PHP for work).
Being soley an assembler programmer for many years gave me a pure unrestricted environment to play in, rather than being locked down to a particular environment. Which always left a bad taste in my mouth, whenever I worked with many of the HLLs out there, (ever tried a rotate in C?). I wanted the freedom that assembler gave me, but have a HLL programming style. I looked Randall Hyde's HLA, and while the syntax is more HLL programmer friendly, it still didn't gel with me. Plus I was limited to a particular OS (Windows or Linux), becuase of the standard library it used. (Which by the way is a great library, just doesn't suit my needs as it stands). At first B0, may look like C, but once you get down and dirty, you quickly realise that it's not a bastardised C clone, but something else. The best way to think of B0 is a language between assembler, Terse, and C. A quick word on licensing: The B0 language and this implementation are released under a BSD license. B0 is still in alpaha/beta form, with features being added on a weekly basis... but still should be enough for people to play with. More info: http://chewy509.atspace.com/index.html , and follow the b0 links. PS. The B0 compiler generates FASM output, targeted at 64bit code generation. Last edited by Chewy509 on 06 Jun 2005, 06:32; edited 1 time in total |
|||
![]() |
|
Kain 06 Jun 2005, 06:18
broken link.
_________________ :sevag.k |
|||
![]() |
|
Chewy509 06 Jun 2005, 06:32
The link has been fixed. (comma added on to the end somehow?)
|
|||
![]() |
|
pierre 06 Jun 2005, 10:19
|
|||
![]() |
|
crc 06 Jun 2005, 23:59
When will you rewrite it in B0 or pure assembly?
![]() |
|||
![]() |
|
Chewy509 07 Jun 2005, 00:14
pierre wrote: Have you tried C-- ? I have in a limited way, many moons ago... |
|||
![]() |
|
Chewy509 09 Jun 2005, 04:37
Hi Everyone,
v0.0.9 has been released: http://chewy509.atspace.com/b0.html Changes include: * Added basic preparser for allow for basic definitions and conditional compilation. * Added ability to nest #ifdef and #ifndef blocks. * Fixed bug, which allowed sourcecode to be processed when not part of a function, under some circumstances. The next item on the TODO list is structures. |
|||
![]() |
|
THEWizardGenius 09 Jun 2005, 18:15
Interesting...
|
|||
![]() |
|
Chewy509 09 Jun 2005, 23:58
THEWizardGenius wrote: Interesting... Any suggestions on what you would like to make it better? (Besides Structures, Macros, and a complete standard library for your choice of OS). |
|||
![]() |
|
THEWizardGenius 17 Jun 2005, 17:28
Well for one thing, it would be nice if it had Structures, Macros, and a complete standard library for your choice of OS.
![]() Seriously though, I think it's great- very much like C except more low-level (maybe similar to C--? I've never used C-- before, but I hear it's good). However, you should probably allow inline ASM. This might seem strange, since it is basically ASM with some structure (like C) but it's nice to program directly in ASM too. Add inline ASM (and also add Structures, Macros, and a complete standard library for your choice of OS - lol) and it'll be great. Probably when my OS is completed (talk to me in a year or so) I'll think about writing an interpreter or compiler of B0, because it's a very good language and I can't do everything in assembly. Thanks! |
|||
![]() |
|
Chewy509 20 Jun 2005, 00:00
![]() The inline asm, is a direct pass through without modification, so you could implement macros and basic struc's (in FASM syntax) within the asm block. As for the standard library, I am working on it. But the standard library will take some time, (and will be cross-platform as possible). Quote: and I can't do everything in assembly. That's one of the reasons I'm developing the langauge. (Some over at news:alt.lang.asm where the language was first previewed, some even consider it be an assembler like language - thread called: fruits of my labour). |
|||
![]() |
|
adefeo 21 Jun 2005, 00:01
Any chance of a native IA-32 port?
|
|||
![]() |
|
Chewy509 21 Jun 2005, 03:28
adefeo wrote: Any chance of a native IA-32 port? Simple answer: From me, no. However, if someone wants to make a IA-32 native port, then I have absolutely no objections. PS. How's the 512byte OS coming along? |
|||
![]() |
|
decard 21 Jun 2005, 04:31
Chewy509 wrote: PS. How's the 512byte OS coming along? It'll start in September... ![]() |
|||
![]() |
|
THEWizardGenius 23 Jun 2005, 00:42
If I were to use B0 in my OS I would have to create an IA-32 version- I don't have a 64-bit processor, and I don't think I'll get one in the near future. But I'll first have to learn how how compilers work. I don't even know what the common terms such as parsing, tokenizing, and others mean! I should ask Privalov where he learned about such things.
|
|||
![]() |
|
Chewy509 23 Jun 2005, 03:01
THEWizardGenius wrote: If I were to use B0 in my OS I would have to create an IA-32 version- I don't have a 64-bit processor, and I don't think I'll get one in the near future. But I'll first have to learn how how compilers work. I don't even know what the common terms such as parsing, tokenizing, and others mean! I should ask Privalov where he learned about such things. I just downloaded a few tutorials from the net (google), and did some recommended reading as outlined in many of the posts and FAQ at news://comp.compilers ( http://groups-beta.google.com/group/comp.compilers?hl=en ). The thing is, writing an assembler is a little different from something like gcc, you can skip some of the more complex issues that are found in a compiler. Feel free to look through the B0 source, its just over 4100 lines of C. All that's really needed to know is the way compilers work in general. (The B0 site also contains a compiler internals document, which should give you a good start on understanding the source code). For an assembler, the general case is: -> take line of input and create tokens based on input -> parse through tokens, and for things like equates, etc substitute tokens as required. -> pass tokens to code generator, which then generates the binary code. -> repeat until no source left. |
|||
![]() |
|
THEWizardGenius 26 Jun 2005, 18:10
Where did you learn about these things? I'm very interested in this topic, as I will eventually have to write a compiler, interpreter, or something once I have completed the commandline interface. People will need to be able to develop for my OS, or nobody will use it! Of course, I haven't even gotten started yet, so that will be a ways off... Can you give me some links, or something? The newsgroups haven't been very useful, as almost everything is either an advertisement ("hiring people to write a compiler"), or something beyond my level of expertise ("writing a lexoparsical graph compiler"
![]() |
|||
![]() |
|
Chewy509 27 Jun 2005, 00:07
THEWizardGenius wrote: Where did you learn about these things? I'm very interested in this topic, as I will eventually have to write a compiler, interpreter, or something once I have completed the commandline interface. People will need to be able to develop for my OS, or nobody will use it! Of course, I haven't even gotten started yet, so that will be a ways off... Can you give me some links, or something? The newsgroups haven't been very useful, as almost everything is either an advertisement ("hiring people to write a compiler"), or something beyond my level of expertise ("writing a lexoparsical graph compiler" http://compilers.iecc.com/crenshaw/ <- Good start http://www.compilers.net/Dir/Free/Books/index.htm http://www.cs.ucr.edu/~phf/mir/wirth-compiler-1996.pdf <- Assumes that you have most of the basic concepts. http://www.bloodshed.net/compilers/ http://www.scifac.ru.ac.za/compilers/conts.htm A lot of the tutorials assume the use of bison/yacc/flex. While these are very good tools, I was better off without these tools, (from a learning perspective). |
|||
![]() |
|
THEWizardGenius 27 Jun 2005, 00:20
I have already begun studying the tutorial by Jack Crenshaw, but I wondered if there were any other things. I guess I'll finish the one by Crenshaw before I read any other ones...
I guess we OS developers have to study a wide range of topics, even topics that are not related to OS development... but it's all fun. ![]() _________________ FASM Rules! OS Dev is fun! Pepsi tastes nasty! Some ants toot! It's over! |
|||
![]() |
|
Goto page 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.