SearchWiki:

CC Course 2005

PmWiki

Recent Changes Printable View Page History Edit Page

DC - Deutsch Compiler


Team-members

  • Sabine Hoesch shoesch@cosy...
  • Gerwin Fleischmann gfleisch@cosy...

Description

Project status:

  • self-compiling in <4 seconds
  • consumed time up to now (implementation): 300 man-hours
  • no more development - project finished

Target architecture: AMD64? (aka x86_64)

The compiler was developed on this system:

  • AMD64? Athlon 3000+ Newcastle (Socket 754)
  • Asus K8VSE? Deluxe
  • 2x512MB PC3200? Infineon DDR-SDRAM
  • 2x200GB Seagate SATA - RAID 0
  • Sapphire Radeon 9250 256MB
  • OS: Mandrake Linux 10.1 Community Edition x86_64

Compiler details:

  • Language grammar: Deutsch_Grammar
  • Intermediate code: fasm assembler
  • Output file format: ELF64? object
  • Compiler is runnable on DOS/Linux/Windows (however - the output is an ELF64? object)

Download

Deutsch.tar.gz

Links

AMD64? Programmers Manual: http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_11395_11428,00.html

Really short introduction to x86_64 assembly http://www.amd64.org/documentation/assembly

flat assembler http://flatassembler.net/

about the ELF binary format (german) http://www.linux-kernel.de/appendix/ap05.pd

about the ELF64? object file format http://devresource.hp.com/drc/STK/docs/refs/elf-64-hp.pdf

AMD64? ABI draft (Deutsch is not compliant with this, but it is a useful source if you want to link with code written in C) http://www.x86-64.org/documentation/abi-0.95.pdf

For example: a mathematic library implemented in Deutsch

  
modul Math.

definiere prozedur Id, zahl x liefert zahl z.
definiere prozedur Ink, zahl x liefert zahl z.
definiere prozedur Dek, zahl x liefert zahl z.
definiere prozedur Add, zahl x, zahl y liefert zahl z.
definiere prozedur Sub, zahl x, zahl y liefert zahl z.
definiere prozedur Mult, zahl x, zahl y liefert zahl z.
definiere prozedur Div, zahl x, zahl y liefert zahl z.
definiere prozedur Mod, zahl x, zahl y liefert zahl z.


{Identitaetsfunktion}
prozedur Id, zahl x
liefert zahl z.
 z = x.
ende

{Inkrementierungsfunktion}
prozedur Ink, zahl x
liefert zahl z.
 z = x + 1.
ende 

{Dekrementierungsfunktion}
prozedur Dek, zahl x
liefert zahl z.
 z = x - 1.
ende 

{Additionsfunktion}
prozedur Add, zahl x, zahl y
liefert zahl z.
 z = x + y.
ende

{Subtraktionsfunktion}
prozedur Sub, zahl x, zahl y
liefert zahl z.
 z = x - y.
ende

{Multiplikationsfunktion}
prozedur Mult, zahl x, zahl y
liefert zahl z.
 z = 0.
 solange y groesser 0 mache
  z = z + x.
  y = y - 1.
 ende
ende

{Divisionsfunktion}
prozedur Div, zahl x, zahl y
liefert zahl z.

 z = 0. 
   solange x groesser y oder x gleich y mache
    x = x - y.
    z = z + 1.
  ende
ende	    

{Modulofunktion}
prozedur Mod, zahl x, zahl y
liefert zahl z.

 z = 0.
 solange x groesser y oder x gleich y mache
  x = x - y.
 ende
z = x.
ende

ende {Modul Math}
 

---

Comments:

 * Habt ihr Macros, Labels und Structures benutzt oder habt ihr es auf die harte Tour gemacht?

Wir haben eine kleine Sammlung von Macros fuer Speicherallokation, String-Operationen und System-Calls. Diese sind sehr einfach gehalten, verwenden keine komplexeren Instruktionen und sind auch nicht 64bit optimiert. Labels haben wir auch benutzt, Strukturen sind dafuer selbst gemacht. Im nachhinein gesehen haben wir uns die Arbeit erspart einen Linker und eine VM zu schreiben, dafuer hatten wir eine Menge anderer Probleme.

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on July 05, 2005, at 06:55 PM