Skip to content

Instantly share code, notes, and snippets.

View uchan-nos's full-sized avatar

Kota UCHIDA uchan-nos

View GitHub Profile
@uchan-nos
uchan-nos / pot-select.ino
Created April 17, 2024 06:05
可変抵抗器でLEDの点滅パターンを選択するArduinoスケッチ
// for Raspberry Pi Pico
void setup() {
}
int tick = 0;
const unsigned char pattern3[8] = {255, 0, 255, 0, 255, 127, 63, 31};
void loop() {
int v = analogRead(A0);

Keybase proof

I hereby claim:

  • I am uchan-nos on github.
  • I am uchan_nos (https://keybase.io/uchan_nos) on keybase.
  • I have a public key ASAFX23-ZUcg4dQSwoncWZNOEPdQb5Uv8jqzlLJLR0bjJgo

To claim this, I am signing this object:

-nostdlibinc
-I/home/uchan/osbook/devenv/x86_64-elf/include
-I/home/uchan/osbook/devenv/x86_64-elf/include/c++/v1
-I.
-D__ELF__
-D_LIBCPP_HAS_NO_THREADS
-O2
-Wall
-g
--target=x86_64-elf
@uchan-nos
uchan-nos / ring.c
Last active March 27, 2022 13:20
整数を要素とする固定長リングバッファの実装とテストケースのひな形
/*
セキュリティ・キャンプ 2022「OS 自作ゼミ」
応募課題 C のひな形ファイル
コンパイル&実行方法
$ gcc -Wall -Wextra ring.c
$ ./a.out
NG: want 2, got 0
NG: want 3, got 0
FAILED: 2/2 tests failed
@uchan-nos
uchan-nos / mycoroutine.cpp
Last active September 6, 2021 17:54
C++とアセンブラによるコルーチンの試験的実装
#include <array>
#include <chrono>
#include <cstring>
#include <iostream>
#include <thread>
using namespace std;
struct CoroContext {
uint64_t rip, rsp, rbp, rbx, r12, r13, r14, r15;
@uchan-nos
uchan-nos / comment_single-quote.s
Created September 3, 2021 09:33
strange behavior of 'as command' on M1 Mac
mov x0, #1
LABEL1: # f
mov x0, #2
LABEL2: # '
mov x0, #3
LABEL3: # 'f
mov x0, #4
LABEL4: # 'fo
mov x0, #5
LABEL5: # 'foo
@uchan-nos
uchan-nos / brew_doctor_warnings.txt
Created August 24, 2021 09:27
brew doctor on My Mac mini (M1, 2020)
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: gettext files detected at a system prefix.
These files can cause compilation and link failures, especially if they
are compiled with improper architectures. Consider removing these files:
/usr/local/lib/libgettextlib.dylib
/usr/local/lib/libintl.dylib
@uchan-nos
uchan-nos / v1-nested-for_bench.s
Last active June 1, 2021 05:15
Output of OpeLa Compiler Ver.1 and Ver.2
.intel_syntax noprefix
.code64
.section .text
.global main
main:
push rbp
mov rbp, rsp
sub rsp, 32
xor rax, rax
lea rax, [rbp-24]
@uchan-nos
uchan-nos / gpd-micropc-acpidump.txt
Created April 22, 2021 05:18
GPD MicroPC ACPI Dump(APCI PM Timerが無い機種)
DBGP @ 0x008144010118FBE8
0000: 44 42 47 50 34 00 00 00 01 A9 49 4E 54 45 4C 20 DBGP4.....INTEL
0010: 47 4C 4B 2D 53 4F 43 20 03 00 00 00 42 52 58 54 GLK-SOC ....BRXT
0020: 0D 00 00 01 00 00 00 00 00 08 00 00 00 00 00 00 ................
0030: 00 00 00 00 ....
MCFG @ 0x008144010118FBE8
0000: 4D 43 46 47 3C 00 00 00 01 01 41 4C 41 53 4B 41 MCFG<.....ALASKA
0010: 41 20 4D 20 49 00 00 00 09 20 07 01 4D 53 46 54 A M I.... ..MSFT
0020: 97 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E0 ................
@uchan-nos
uchan-nos / review-ext.rb
Created December 1, 2020 05:06
Re:VIEWでPDF生成時にだけダブルクオートを``と''に変換するインラインタグを定義する
module ReVIEW
module LATEXBuilderOverride
Compiler.definline :dquote
def inline_dquote(s)
"``" + s + "''"
end
end
class LATEXBuilder