Popularity
1.4
Declining
Activity
0.0
Stable
2
1
0

Monthly Downloads: 12
Programming language: Emacs Lisp
License: BSD 3-clause "New" or "Revised" License
Tags: Web     Compiler    

microc alternatives and similar packages

Based on the "Web" category.
Alternatively, view microc alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of microc or a related project?

Add another 'Web' Package

README

MICROC compiler

microcCompilerLine :: String -> String

Convert a line of microc code to asm

microcCompilerStr :: String -> String

Convert microc code to asm

microcCompiler::IO()

Input:Stdin / Output:Stdout

microcCompilerFromFile:: String -> IO()

Input:Filename / Output:Stdout

Example1

module Main where

import ParseMicroc

main::IO()
main = microcCompiler

./microc < count.c > count.asm

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


↓↓↓

count.asm
``` assembly: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

Example2

module Main where

import ParseMicroc

main::IO()
main = do
    args <- getArgs
    microcCompilerFromFile $ head args

./microc count.c > count.asm

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


↓↓↓

count.asm
``` assembly: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

Hiroshima Univ. / Embedded Software

https://momiji.hiroshima-u.ac.jp/syllabusHtml/2017_58_U4090201.html