how to assemble and link:
nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o
template code (hello world):
section .text
global _start
# Thanks to @danger89 and @Ilothar for updating the gist. | |
# Set the name and the supported language of the project | |
project(hello-world C CXX) | |
# Set the minimum version of cmake required to build this project | |
cmake_minimum_required(VERSION 3.10) | |
# Use the package PkgConfig to detect GTK+ headers/library files | |
find_package(PkgConfig REQUIRED) | |
pkg_check_modules(GTK REQUIRED gtkmm-3.0) |
#include <SDL.h> | |
SDL_Window* window; | |
SDL_Renderer* renderer; | |
void drawCircle(int xc, int yc, int x, int y) { | |
SDL_RenderDrawPoint(renderer, xc + x, yc + y); | |
SDL_RenderDrawPoint(renderer, xc - x, yc + y); | |
SDL_RenderDrawPoint(renderer, xc + x, yc - y); |
from qiskit import qiskit, QuantumCircuit | |
def execute(func): | |
print('0 0: {}'.format(func(0, 0))) | |
print('0 1: {}'.format(func(0, 1))) | |
print('1 0: {}'.format(func(1, 0))) | |
print('1 1: {}'.format(func(1, 1))) | |
def xor(a, b): | |
""" |
# sudo /sbin/rcvboxdrv -h | |
# Unloading modules: | |
# Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.4.3-1-ARCH | |
# modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.4.3-1-ARCH | |
# modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.4.3-1-ARCH | |
# modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.3-1-ARCH | |
# Solution | |
# from https://forum.antergos.com/topic/818/can-t-run-my-vitualbox/4 |