Jasmin Examples

This archive contains five samples of operations with doubles, input and output in jasmin.

2013-02-03 · tswr

C- in ANTLR

This is a sample of a small language with global variables, assignments, arithmetic expressions, input, output, if and while, which compiles into java assembler (can’t say that i excell in jasmin, but this one works in most cases). (source code)

2013-02-03 · tswr

Calc in ANTLR

This is a sequence of calculators which can be used to dive into ANTLR. calc Write down the grammar. (source code) ...

2013-02-03 · tswr

Students' Theses

Development of General Purpose Object Oriented Language Compiler (Egor Kolmogortsev) This course work is devoted to development of an OO language compiler on the basis of flex, bison and llvm tools. Thesis Presentation Sources Graph_Viz (Maxim Pomazuev) This is an introductory work into the field of vizualization of big graphs. Archive (Ru) ASMPY (Aleksandr Krasnorutskiy) ASMPY is an assembler of python compiled files compatible with unpyc disassembly output. The structure of python compiled files is considered. The purpose of the work is to create a low-level language for *. pyc files and to develop an assembler for this language. The paper contains specification on the assembly language for CPython, lexical and syntactic analyzers. Thesis (Ru) ...

2013-02-03 · tswr

My Project List

Team RuCTF is the annual open CTF challenge in information security among teams from russian universities. RuCTF started out in 2008 and was the first challange of such kind in Russia. Now it consists of two phases: quals and finals. Quals are remote, finals are local (USU, Ekaterinburg). My roles: task/service developer. RuCTFE is RuCTF Extended to the edge of the world. Teams from universities of all countries are welcome. My role: devteam leader. ...

2013-02-02 · tswr

Select

my $paddr = inet_aton($addr); croak "Cannot resolve '$addr'" if (!defined $paddr); socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or croak 'Cannot create socket'; connect SOCK, sockaddr_in($port, $paddr) or croak "Cannot connect to server '$server'"; send SOCK, "$query\r\n", 0; vec($rin, fileno(SOCK), 1) = 1; do { ($nfound) = select($rout = $rin, '', '', $timeout); croak 'Select() error' if ($nfound == -1); croak 'Timeout' if ($nfound == 0); croak 'Recv() error' if (!defined(recv SOCK, $buf, 512, 0)); $answer .= $buf; } while $buf ne ''; shutdown SOCK, 2;

2013-02-02 · tswr

Raw Sockets

sub sendRaw($$$) { use constant IPPROTO_RAW => 255; my ($destination, $dport, $packet) = @_; eval { socket(SOCKET, PF_INET, SOCK_RAW, IPPROTO_RAW); my $paddr = sockaddr_in($dport, inet_aton($destination)); send(SOCKET, $packet, 0, $paddr); }; if ($@) { print "Error occured: $@"; } } sub assembleRawUdp($$$$$) { my ($destination, $dport, $source, $sport, $data) = @_; ...

2013-02-02 · tswr

Tk

#!/usr/bin/perl use Tk; sub Exit { exit(0); } sub showHelp { $tl = $root->Toplevel; $tl->title("Help"); $tl->Label(-text => '(c) tswr')->pack(); } ...

2013-02-02 · tswr

Hamming Code

Source <html> <head> <title>Snippet for "Hamming code"</title> <style> body { padding: 5px; background-color: lightgoldenrodyellow } </style> <script type="text/javascript"> function copy() { var input = document.getElementById('input'); var output = document.getElementById('output'); output.value = input.value; } </script> </head> <body> <h4>Snippet for "Hamming code"</h4> <input type='text' id='input'></input> <input type='button' onclick='copy()' value='copy'></input><br> <input type='text' id='output'></input> </body> </html> Demo

2013-02-02 · tswr

IPC

alarm use Socket; eval { local $SIG{ALRM} = sub { die "time is out" }; alarm 3; socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp'); connect SOCK, sockaddr_in(81, inet_aton("microsoft.com")) or die "connect failed"; alarm 0; send SOCK, "GET / HTTP/1.0\n\n", 0; print while <SOCK>; shutdown SOCK, 2; }; print "$@\n" if $@; die $warnings = 0; $SIG{__WARN__} = sub { print @_ if $warnings }; $SIG{__DIE__} = sub { print "Goodbye, my darling!\n" }; warn "i'm only warning..."; die "i'm dying..."; ...

2013-02-02 · tswr