Skip to content

Instantly share code, notes, and snippets.

@bencz
bencz / main.d
Last active August 29, 2015 14:03
ExeMaker_DLanguae
// A big special thanks to 'bearophile' ( from dlang forum! )
import std.c.windows.windows: WORD, LONG, DWORD, BYTE, UCHAR, ULONG;
struct IMAGE_DOS_HEADER
{
WORD e_magic,
e_cblp,
e_cp,
e_crlc,
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <stdlib.h>
using namespace std;
typedef struct _SIZE_
{
#define system.
#define extensions.
#class MyNumber
{
#field theValue.
#constructor new : aValue
[
theValue := aValue.
@bencz
bencz / main.cs
Created June 5, 2015 20:12
bmp generator ( test )
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace bmpGenerator
{
public class ColorX
{
@bencz
bencz / gist:4115521
Created November 20, 2012 02:18
A HIPER basic compiler
/*
INPUT SAMPLE:
VAR TESTE = 25
PRINT "ALEXANDRE"
PRINT TESTE
GETCHAR
*/
@bencz
bencz / pi.c
Created August 25, 2015 16:17
A memory method to calculate pi
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ARRAY_SIZE 128000
int main(int argc, char **argv)
{
int casas = argc == 2 ? atoi(argv[1]) : 1000;
int x[ARRAY_SIZE];
@bencz
bencz / float_to_ieee754.c
Last active November 30, 2015 18:09
Programa para converter float para o padrão ieee754 (binario)
#include <stdio.h>
#include <malloc.h>
#include <string.h>
#if __USE_SSE__
void reverse(char *begin, char *end)
{
_asm
{
mov edx, DWORD PTR[begin]
@bencz
bencz / main.cs
Last active December 10, 2015 07:09
Extreme basic hiper basic master hiper mega basic test to include system
/*
Sample:
file: main.in
// Start with defines
@define basic = std'basic
@define type = sys'types
@bencz
bencz / main.cpp
Last active December 14, 2015 03:59
Hiper ultra mega tiny x86 JIT
#include <cstdio>
#include <vector>
#include <windows.h>
using namespace std;
class Buffer: public vector<unsigned char>
{
public:
void push_dword(DWORD dw)
@bencz
bencz / main.c
Last active December 14, 2015 08:38
metodo via assembly para negativar um numero...
#include <stdio.h>
int main(int argc, char **argv)
{
int numero = 0;
int retorno = 0;
printf("Entre com um numero: ");
scanf("%d", &numero);
#if defined(__GCC__)