A C style compiler.

Matthew Webb <Matthew.Webb@net1.demon.co.uk>
29 Apr 1998 22:33:18 -0400

          From comp.compilers

Related articles
A C style compiler. Matthew.Webb@net1.demon.co.uk (Matthew Webb) (1998-04-29)
Re: A C style compiler. derekn@aimnet.com (1998-05-04)
Re: A C style compiler. rideau@ens.fr (Francois-Rene Rideau) (1998-05-04)
| List of all articles for this month |
From: Matthew Webb <Matthew.Webb@net1.demon.co.uk>
Newsgroups: comp.compilers
Date: 29 Apr 1998 22:33:18 -0400
Organization: none
Keywords: question, comment

Hi,
        I am writting a OS in assembly language but to speed up the main
development of it I would like to create assembly 'macro'
assembly/compiler. Basically I would like to go half way from assembly
to C. I need to create my own format as it is a new OS and does not
have a platform executable yet.


I would be very create full if I could be written a example of a
compiler as such. I have read 'the dragon book' but lack the skill to
start writting my own compiler. If anyone has the time I would like
for them to create a simple compiler that only understands 2
functions. 1. gotoxy and 2. getch. This will give me a base to
exspand on to add further instructions. I would like to have a code
like


--
#inlcude <include/stdio.h>


void main(void)
{
      gotoxy(10,10);
      getch();
}
--


I would like to be able to make libraries of functions like these
below. so that I could write them and compile them to a format
understandable to the compiler. basically the program above will 'plug
in' the values to the functions below. For loops I will run loops
calling these functions and pushing/poping the values to a from the a
stack, or into a internal loop stack. Remeber that I woukld liekto be
more assembly than any other form. keep it as basic as I can, I would
like total contol, a inline assembly is VERY important. I think you
can understand what my aims are here. thank you.


void gotoxy(int x, int y)
{
      char x,y;


      _asm mov ah,02h
      _asm mov bh,_screenpage
      _asm mov dh,x
      _asm mov dl,y
      _asm int 10h
      return(0);
}


int getch(void)
{
      _asm mov ah,00h
      _asm int 16h


      return(REG_AX);
}




Maybe someone would like to develop a project on the internet that
could run side by side this to work with MS-DOS or UNIX etc. A
assembly macro compiler/C style compiler. I know this sounds a lot but
from what I have read I guess for a exspecienced uni-going person it
should be fairly simple to add in a 2 or so pass compiler which does
the lexing and pharsing. I hope this is not too much to ask. It is
realyt quite essential to me to do this. If no one can help could you
give me pointers and references to getting this projects achieved
myself.


Thanks very much.
--
Matthew Webb - London - Creator of alt.os.assembly & alt.os.develpoment
[My advice is "don't do that", since it's entirely possible to write
a small, tight OS predominantly in C, e.g. QNX. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.