microc: microc compiler

[ bsd3, compiler, library, program ] [ Propose Tags ]

microc compiler(stdin->stdout)


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 1.0.0.0, 1.0.0.1
Dependencies base (>=4.7 && <5), microc, parsec [details]
License BSD-3-Clause
Copyright 2017 Author name here
Author hurou927
Maintainer god.be.with.ye.fs@gmail.com
Category Web
Home page https://github.com/hurou927/microc-haskell#readme
Source repo head: git clone https://github.com/hurou927/microc-haskell
Uploaded by hurou927 at 2017-11-05T10:45:07Z
Distributions NixOS:1.0.0.1
Executables microc-exe
Downloads 2104 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-11-05 [all 1 reports]

Readme for microc-0.1.0.0

[back to package description]

MICROC compiler

input : stdin / output : stdout

./exe < count.c > count.asm

count.c

n=in;
L1:
    out(n);
    unless(n) goto L2;
    n=n-1;
    goto L1;
L2:
    halt;
    int n;

↓↓↓

count.asm

        IN
        POP n
L1:
        PUSH n
        OUT
        PUSH n
        JZ L2
        PUSH n
        PUSHI 1
        SUB
        POP n
        JMP L1
L2:
        HALT
n: 0