Repository for Architecture of computers and parallel systems course on VŠB
GNU General Public License v3.0
Petr Olivka's web page about course
Course syllabus
Petr Olivka's youtube channel (Assembly language tutorials)
Assembly language example files and references
Assembly language textbook
CUDA programming
CUDA tutorial
- Assembly language part 0
- Assembly language part 1
Implementation of programs for leds on K64F-KIT. First part of course. Individual programs are in APPS-2.0/LEDs/PWM-BINARY/
$ minicom -D /dev/ttyACM0
More information about how this works is in ledsPWM.cpp
class PwmLed{
private:
DigitalOut *led;
float brightness;
static const int timeUnit = 15;
int timeFrame;
public:
PwmLed(PinName pin, int brightness)
{
this->led = new DigitalOut(pin);
this->setBrightness(brightness);
this->timeFrame = 0;
}
void setBrightness(int brightness){
this->brightness = (float)brightness/100;
}
void update()
{
if(this->timeFrame == timeUnit){
this->timeFrame = 0;
}
if (this->timeFrame < (this->timeUnit * this->brightness))
{
this->led->write(1);
}
else
{
this->led->write(0);
}
this->timeFrame++;
}
int getTimeUnit(){
return this->timeUnit;
}
int getBrightness(){
return (int)(this->brightness*100);
}
};
Program which displays binary value which is selected with buttons
Program implements PwmLed class. This class represents pulse wide modulation on led to create illusion of brightness. There are also three simulations:
- policie
- Function which simulates police beacon.
- colourPicker
- Function which lets you select led with button and increase/decrease its brightness with buttons.
- singal
- Function which calculates and sets brightness of top red leds based on brighntess of rgb led.
Program also implements PwmLed class. This program implements function which represent snake, which goes throught leds. You can stop him, increase or decrease his speed.
Implementation of programs for LCD on K64F-KIT. Second part of course. Individual programs are in APPS-2.0/LCD
Program implements multiple classes which represents shapes (triangle, circle...) and classes for displaying text on the LCD
// Draw function implementation using for cycles to iterate over values in fonts
void draw()
{
// Iterating over rows
for(int y = 0; y < HEIGHT; y++)
{
// Selecting one specific position in fonts file
int radek_fontu = font[character][y];
// Iterating over characters until we reach the width of character (last value of character)
for(int x = 0; x < WIDTH; x++)
{
//if(radek_fontu & (HEIGHT-WIDTH << x)) drawPixel(pos.x + x, pos.y + y); //LSB
if(radek_fontu & (HEIGHT-WIDTH << x)) drawPixel(pos.x - x + WIDTH, pos.y + y); //MSB
}
}
}
Third part of the course focused on programming in C and working with Radio kit. Individual programs can be found in APPS-2.0/RDS
THis folder contains program which takes example data from live broadcasting and works with them.
Fourth part of the course focused on programming in Assembler&C languages. Individual programs can be found in APPS-2.0/Assembler
In this file you can find various useful functions in Assembler, basicaly all other files in this repo will somehow be subsets of this file.
Extended Cheatsheet 1
In this file you can find very basic function in assembler which will set value of variable to 'System funguje.' and print it to console.
In this file you can find first assigment from Assembler language. All functions are using only MOV/MOVSX instructions. There are multiple functions, some of them are using functions in C to take a use of cycles. Some of them are totaly bruteforce and wont work on different values or different array lengths.
This file contains only bruteforce subset of functions from Basic_MOV_functions.
This file contains functions based around taking function parameters from C to assembler and returning values using RAX register.
This file contains other functions based around taking function parameters from C to assembler and returng values using RAX register. This functions were in realtime test.
This file contains functions based around division, multiplication, using stack and conditional movement
This file contains functions based around division, multiplication, using stack and conditional movement. This functions were in realtime test