Skip to content

Latest commit

 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler of integer arithmetic expressions into assembler code of AT&T syntax

Get started

  1. To make AST:
./cari -i example.cari -ast
start
   ├─ *
   │  ├─ +
   │  │  ├─ *
   │  │  │  ├─ -25
   │  │  │  └─ 10
   │  │  └─ *
   │  │     ├─ -1
   │  │     └─ -7
   │  └─ -100
   ├─ -
   │  ├─ 10
   │  └─ 7
   └─ +
      ├─ /
      │  ├─ -
      │  │  ├─ +
      │  │  │  ├─ 512
      │  │  │  └─ 421
      │  │  └─ +
      │  │     ├─ 3321
      │  │     └─ 70
      │  └─ -
      │     ├─ 900
      │     └─ +
      │        ├─ 30
      │        └─ 78
      └─ -
         ├─ +
         │  ├─ 32
         │  └─ 7
         └─ 90
  1. To compile to the assembler code:
./cari -i example.cari -o example.s
  1. Now you can build your program:
as example.s -o example.o
ld example.o -o example
  1. Run the program.
./example
24300
3
-54

Build

From cmd folder:

go build -o cari main.go

Limits

The minimum number: -9223372036854775808
The maximum number: 9223372036854775807

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages