Skip to content

Instantly share code, notes, and snippets.

View RIscRIpt's full-sized avatar

Richard Dzenis RIscRIpt

View GitHub Profile
@RIscRIpt
RIscRIpt / vcruntime_new.h
Created July 19, 2023 06:48
MSVC\14.36.32532\include\vcruntime_new.h
//
// vcruntime_new.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Declarations and definitions of memory management functions in the VCRuntime.
//
#pragma once
#include <vcruntime.h>
@RIscRIpt
RIscRIpt / missing_number.S
Created December 6, 2020 16:29
Missing byte solution written in ARM64
.text
.type main %function
.global main
main:
mov w0, wzr
mov w16, 7
mov w13, 0xFFFFFF00
mov w12, 0x80
@RIscRIpt
RIscRIpt / threads_test.cpp
Created October 17, 2020 14:56
Threading example with blocking queue
#include <iostream>
#include <deque>
#include <vector>
#include <optional>
#include <random>
#include <algorithm>
#include <chrono>
#include <thread>
#include <condition_variable>
#include <mutex>
@RIscRIpt
RIscRIpt / main-62a13d.cpp
Created September 24, 2020 11:28
Clang + asio bug report
This file has been truncated, but you can view the full file.
# 1 "<built-in>"
# 1 "main.cpp"
//
// daytime_client.cpp
// ~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@RIscRIpt
RIscRIpt / main-62a13d.cpp
Created September 24, 2020 11:28
Clang + asio bug report
This file has been truncated, but you can view the full file.
# 1 "<built-in>"
# 1 "main.cpp"
//
// daytime_client.cpp
// ~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@RIscRIpt
RIscRIpt / .gitconfig
Created February 21, 2020 12:03
git aliases
[alias]
lg = log --graph --pretty=format:'%C(red)%h%C(reset) %C(green)%<(14)%cr / %cd %C(reset)%C(bold blue)%<(24)%an%C(reset) %C(auto)%d%C(reset) %s' --date=format:'%Y-%b-%d %a %H:%M:%S %z'
rl = reflog --pretty=format:'%C(red)%h%C(reset) %C(green)%<(14)%cr / %cd %C(reset)%C(bold blue)%<(24)%an%C(reset) %C(auto)%gd%C(reset) %C(auto)%d%C(reset) %gs'
amend = commit --amend --no-edit
proc asm_itoa
test ebx, ebx
jz .zero
mov ecx, divTable
.skip_loop:
xor edx, edx
mov eax, ebx
div dword[ecx]
add ecx, 4
test eax, eax
proc asm_itoa
test ebx, ebx
jz .zero
mov ecx, divTable
.skip_loop:
xor edx, edx
mov eax, ebx
div dword[ecx]
add ecx, 4
test eax, eax
@RIscRIpt
RIscRIpt / test.asm
Created July 8, 2019 06:29
Comparing size of a binary file before and after
format binary as ''
include 'print.inc'
virtual at 0
file 'test'
old_size=$
end virtual
db 512 dup 0
cmp word [ball_x], 0
jle .neg_ball_dx
cmp word [ball_x], WIDTH - BALL_WIDTH
jnge .ball_x_col
.neg_ball_dx:
neg word [ball_dx]
.ball_x_col: