All Projects → vorotynsky → Kroha

vorotynsky / Kroha

Licence: GPL-3.0 license
A small language makes assembly less painful.

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Kroha

asm tutorial
Code samples for the Understanding Windows x64 Assembly tutorial.
Stars: ✭ 131 (+336.67%)
Mutual labels:  nasm
pidi-os
A minimalistic operating system
Stars: ✭ 35 (+16.67%)
Mutual labels:  nasm
Sasm
SASM - simple crossplatform IDE for NASM, MASM, GAS and FASM assembly languages
Stars: ✭ 5,557 (+18423.33%)
Mutual labels:  nasm
Asm Dude
Visual Studio extension for assembly syntax highlighting and code completion in assembly files and the disassembly window
Stars: ✭ 3,898 (+12893.33%)
Mutual labels:  nasm
LudOS
A toy monolithic kernel written in C++
Stars: ✭ 38 (+26.67%)
Mutual labels:  nasm
Assembly-x64
My Collection of x64 Assembly programs with NASM
Stars: ✭ 17 (-43.33%)
Mutual labels:  nasm
Ninja
Patching extension for the video games Gothic and Gothic 2.
Stars: ✭ 17 (-43.33%)
Mutual labels:  nasm
ts-c99-compiler
ANSI C 16bit Compiler + NASM Assembler + Intel 8086 / 80186 + X87 emulator written entirely in TypeScript
Stars: ✭ 78 (+160%)
Mutual labels:  nasm
V8Power
Putting the power of an 8-cylinder engine under the hood of DOS batch files.
Stars: ✭ 30 (+0%)
Mutual labels:  nasm
snax86
A snake game written in x86 Assembly language for windows console
Stars: ✭ 21 (-30%)
Mutual labels:  nasm
mbr-boot-manager
💾 Master Boot Record with a boot menu written in Assembly
Stars: ✭ 57 (+90%)
Mutual labels:  nasm
fastoverflowtk
This Buffer Overflow Toolkit works through FTP, SMTP, POP, HTTP protocols as well file outputs for playlists exploiting customized variables/commands. Payloads can be generated through MSFVENOM or you can use your own ASM files.
Stars: ✭ 16 (-46.67%)
Mutual labels:  nasm
reverse shell nasm
No description or website provided.
Stars: ✭ 15 (-50%)
Mutual labels:  nasm
cmake-nasm-test
Building a nasm hello world app with cmake
Stars: ✭ 18 (-40%)
Mutual labels:  nasm
vscode cobol
Visual Studio Code Extension for COBOL, JCL and MF Directive Files
Stars: ✭ 17 (-43.33%)
Mutual labels:  hlasm

Kroha

Improve your assembly experience with Kroha! This language is more comfortable than a pure assembly.

Examples

Instead of documentation

You can find more examples here.

Frames

program {
  manual frame act {
    mov ax, [bp-4]
    inc ax
    leave
    ret
  }

  frame main {
    reg a : ax
    a = 5
    call <act> (a)
  }
}

Compiled

section .text
act:
  mov ax, [bp-4]
  inc ax
  leave
  ret

section .text
main:
enter 0, 0
  mov ax, 5
  push ax
  call act
  add sp, 2
leave
ret

Variables

program {
  var a : int16 = 32
  var b : int8 = 1
  const c : int16 = 32
  const d : int8 = 1

  manual var arr : &int8 {
    times 64 db 0
  }

  frame main {
    reg ra : ax
    reg rb : bl
    var sb : int16
    ra = 5
    sb = 6
    rb = b
  }
}

Compiled

section .data
a: dw 32

section .data
b: db 1

section .rodata
c: dw 32

section .rodata
d: db 1

section .data
arr:
  times 64 db 0
    

section .text
main:
enter 2, 0
  mov ax, 5
  mov word [bp - 2], 6
  mov bl, [b]
leave
ret

Conditions and loops

program {
  frame main {
    reg val : ax
    val = 0

    loop (LOOP) {
      if (val > 5, CMP) {
        break (LOOP)
      }
      else {
        !dec bx
      }
      !inc ax
    }
  }
}

Compiled

section .text
main:
enter 0, 0
  mov ax, 0
  LOOP_begin:
    cmp ax, 5
    jg CMP_begin
      dec bx
    jmp CMP_end
    CMP_begin:
      jmp LOOP_end
    CMP_end:
    inc ax
  jmp LOOP_begin
  LOOP_end:
leave
ret

Check more examples.

Build and install

Build using stack.

stack build

Install using stack.

stack install

Run Kroha

It compiles each file individually and prints nasm to the terminal.

Kroha ./file1 ./file2 ./file3
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].