Skip to content

Instantly share code, notes, and snippets.

View lucansky's full-sized avatar

Adam Lučanský lucansky

  • Martin, Slovakia
View GitHub Profile
@lucansky
lucansky / gist:8210218
Last active January 1, 2016 22:29
Cvicenie 4 asembler
;**************************************************************
;
; Program HelloWorld - IAS
; FIT VUT v Brne
;
;**************************************************************
; Preklad programu lze provest nasledovne:
; nasm -fobj helloworld.asm
; alink -oPE -subsys console helloworld.obj
; nebo pomoci davky run.bat:
@lucansky
lucansky / gist:8356312
Last active January 2, 2016 20:19
Clock 595 shift registers
require "wiringpi"
#GC.disable
io = WiringPi::GPIO.new
digits = [
[1,1,0,0,0,0,0,0], #0
[1,1,1,1,1,0,0,1], #1
[1,0,1,0,0,1,0,0], #2
[1,0,1,1,0,0,0,0], #3
[1,0,0,1,1,0,0,1], #4
@lucansky
lucansky / cvicenie7.asm
Created January 18, 2014 22:41
Assembly exercise 7 - FPU x86
;**************************************************************
;
; Program HelloWorld - IAS
; FIT VUT v Brne
;
;**************************************************************
; Preklad programu lze provest nasledovne:
; nasm -fobj helloworld.asm
; alink -oPE -subsys console helloworld.obj
; nebo pomoci davky run.bat:
@lucansky
lucansky / copy.asm
Last active August 29, 2015 13:55
ASM: Kopirovanie z arrayu do arrayu, zaporne cisla nahradene nulou
%include 'rw32.inc' ; nacteni knihovny rw32.inc
[segment .data use32] ; definice zacatku datoveho segmentu
; testovaci retezec
sArray1 dd 9000001,50000,-20432,98765
length dd 4
sArray2 times 100 dd 0
[segment .code use32] ; definice zacatku kodoveho segementu
@lucansky
lucansky / trans.rb
Created February 27, 2014 19:28
Transliterate all files in current directory
require "find"
require "i18n"
I18n.enforce_available_locales = false
Find.find(".").each do |f|
if FileTest.directory?(f)
next
else
puts "#{f} -> #{I18n.transliterate(f)}"
@lucansky
lucansky / gist:9299488
Created March 1, 2014 23:45
IOS proj1 pt2
adam@adam-nb:~/Dropbox/school/ios/proj1$ for f in `ls *.o`; do echo "---${f}";objdump -d -j .text ${f} | grep -E "(<.*>:)|(callq)"; done
---print_recursive.o
0000000000000000 <print_fib_upto>:
15: e8 00 00 00 00 callq 1a <print_fib_upto+0x1a>
28: e8 00 00 00 00 callq 2d <print_fib_upto+0x2d>
3f: e8 00 00 00 00 callq 44 <print_fib_upto+0x44>
55: e8 00 00 00 00 callq 5a <print_fib_upto+0x5a>
64: e8 00 00 00 00 callq 69 <print_fib_upto+0x69>
7a: e8 00 00 00 00 callq 7f <print_fib_upto+0x7f>
0000000000000081 <print_ackermann>:
#include <msp430.h>
#include <stdbool.h>
#include <stdint.h>
#include "74HC595.h"
// Ticks for second, DO NOT CHANGE
#define SEC_CLOCK 512
//#define DATA_PIN BIT5
//#define CLOCK_PIN BIT3
@lucansky
lucansky / Makefile
Created August 5, 2014 22:49
Generic Makefile
CC=gcc
CXX=clang++
RM=rm -f
CPPFLAGS=-ffast-math -Ofast -std=c++11 -pedantic -Wall
#LDFLAGS=-Bstatic
#LDLIBS=-Lboost_random -lpthread
BIN=binarka
SRCS=zdrojak1.cc zdrojak2.cc system.cc binarka.cc
OBJS=$(subst .cc,.o,$(SRCS))
@lucansky
lucansky / rw32_clib.inc
Created December 26, 2014 13:38
RW32 Clib assembly (IAS)
;
; Podpurna knihovna funkci rw32_clib.inc pro predmet IAS.
; Pro svou cinnost vyuziva standardni knihovny jazyka C.
; Lze ji pouzit v OS Windows nebo Linux.
; Pro preklad je potreba program NASM.
; Pro sestaveni ve Windows je potreba napriklad ALINK, v Linuxu GCC
;
; Verze: 2012.11.09
; Autor: Filip Orsag (orsag@fit.vutbr.cz)
;
@lucansky
lucansky / comparsion_10000
Created March 10, 2015 12:56
Classbench errors
----------------------------------
protocol: 0
PPC class : WC/WC, self count: 118, other count 101
PPC class : WC/HI, self count: 0, other count 0
PPC class : HI/WC, self count: 0, other count 0
PPC class : HI/HI, self count: 0, other count 0
PPC class : WC/LO, self count: 0, other count 0
PPC class : LO/WC, self count: 0, other count 0
PPC class : HI/LO, self count: 0, other count 0
PPC class : LO/HI, self count: 0, other count 0