소스 검색

Removed examples...

master
부모
커밋
ab42f181f7
5개의 변경된 파일0개의 추가작업 그리고 132개의 파일을 삭제
  1. +0
    -44
      example/example_ada.adb
  2. +0
    -28
      example/example_c.c
  3. +0
    -1
      example/example_cpp.cpp
  4. +0
    -49
      example/example_flat_assembly.fasm
  5. +0
    -10
      example/testing.sh

+ 0
- 44
example/example_ada.adb 파일 보기

@@ -1,45 +0,0 @@

with ada.text_io, ada.command_line;
use ada.text_io, ada.command_line;

procedure example_ada is

type colours is (RED, GREEN, YELLOW);

type structure is record
x : integer := -1;
y : natural := 1;
end record;

escape : constant character := character'val (27);

procedure put_colour (colour : colours) is
code : integer := colours'pos (colour) + 49;
begin
put (escape & "[0;3" & character'val (code) & "m");
end put_colour;

procedure put_cancel is
begin
put (escape & "[0m");
end put_cancel;

heyo : structure := (-103, 107);

begin

for colour in colours
loop
put_colour (colour);

put_line ("x = " & integer'image (heyo.x));
put_line ("y = " & natural'image (heyo.y));

heyo.x := heyo.x - 1;
heyo.y := heyo.y + 1;

put_cancel;
end loop;

end example_ada;

+ 0
- 28
example/example_c.c 파일 보기

@@ -1,28 +0,0 @@
/* gcc -o example_c example_c.c */

#include <stdio.h>

static struct {
char * x;
int y;
int z;
} const data [3] = {
{ "-- 1", 2, 3 },
{ "-- 4", 5, 6 },
{ "-- 7", 8, 9 }
};

int main (void) {
int i;

for (i = 0; i != 3; ++i) {
printf ("\033[%c;3%cm%s%i%i\033[0m\n",
i + '1',
i + '1',
data [i]. x,
data [i]. y,
data [i]. z);
}

return (0);
}

+ 0
- 1
example/example_cpp.cpp 파일 보기

@@ -1 +0,0 @@
// I hate this language so much it's unreal...

+ 0
- 49
example/example_flat_assembly.fasm 파일 보기

@@ -1,49 +0,0 @@
; fasm example_flat_assembly.fasm example_flat_assembly && chmod +x example_flat_assembly

format ELF64 executable 3

entry main

TERMINAL_INPUT = 0
TERMINAL_OUTPUT = 1

EXIT_SUCCESS = 0
EXIT_FAILURE = 1

macro write file, data, size {
mov rax, 1
mov rdi, file
mov rsi, data
mov rdx, size
syscall
}

macro exit code {
mov rax, 60
mov rdi, code
syscall
}

segment readable executable

colour:
write TERMINAL_OUTPUT, colour_red, 7
ret

cancel:
write TERMINAL_OUTPUT, colour_end, 4
ret

main:
call colour
write TERMINAL_OUTPUT, string, length
call cancel
exit EXIT_SUCCESS

segment readable writable

colour_red db 27, "[1;31m"
colour_end db 27, "[0m"

string db "Heyo world!", 10, 0
length dq $ - string

+ 0
- 10
example/testing.sh 파일 보기

@@ -1,10 +0,0 @@
#!/bin/bash

set -xe

xighlight -a -i ./example/example_ada.adb
xighlight -c -i ./example/example_c.c
xighlight -C -i ./example/example_cpp.cpp
xighlight -F -i ./example/example_flat_assembly.fasm

exit

불러오는 중...
취소
저장