Skip to content

Instantly share code, notes, and snippets.

@kenedii
kenedii / XtotheN.asm
Last active May 18, 2024 17:45
Procedure to calculate x^n [pow(x,n)] in MASM32 x86 Assembly using a simple multiplication loop
include \masm32\include\masm32rt.inc
; This file contains a procedure to calculate x^n in MASM32 x86 Assembly.
.data
base DW 5
exponent DW 6
result Dd ?
asciinumbuffer db 256 dup(?)
consolemsg db "x to the n is: ",0
@kenedii
kenedii / MASM32 Palindrome string.asm
Last active May 15, 2024 19:31
Given an ascii string/number x, return true if x is a palindrome, and false otherwise. MASM32 x86 assembly
include \masm32\include\masm32rt.inc
; LeetCode Problem #9
; Given an integer x, return true if x is a palindrome, and false otherwise.
; Decimal numbers passed through this procedure will have to be converted to ascii first.
.data
prompt DB "Enter a number: ",0
palindromeTN DB "The number ",0
palindromeT DB " is a palindrome.",13,10,0
@kenedii
kenedii / password_protected_screen.asm
Last active May 14, 2024 02:09
Password screen where user enters a password and it grants/denies the user access. MASM32 x86 Assembly code
include \masm32\include\masm32rt.inc
; password is: masm32
;________________________________________
; Note: This code is not safe for prod. |
; as password is in plaintext when exe |
; is examined by a hex viewer. |
;________________________________________
.data
hex_pw db 6Dh,61h,73h,6Dh,33h,32h,00h ; password stored as hex, ending with 00h
@kenedii
kenedii / elevator-TEJ3M.ino
Last active May 7, 2024 01:00
An Arduino elevator system that will service 3 floors, using the servo motor to represent the elevator being at various floors, and LED’s to indicate which floor you are on.
#include <Servo.h>
// Made for final TEJ3M Culminating April 2021
Servo myservo; // create servo object to control a servo
int pos = 0; //makes a position variable to easily write code for it
int green = 10; //sets the green LED on pin 10
int yellow = 9; //sets the yellow LED on pin 9
int red = 8; //sets the red LED on pin 8
void setup() {
@kenedii
kenedii / square_a_number.asm
Last active May 7, 2024 01:45
takes user input for a number and squares it. Written in MASM32 x86 assembly
include \masm32\include\masm32rt.inc
.data
prompt db "input a number to square here: ", 0
prntNumBuffer dw ?
prntSqrBuffer dw ?
prompt2 db "your number was: ", 0
prompt3 db "the square is: ", 0
square dw ?
@kenedii
kenedii / osuaudiodevice.reg
Created December 12, 2020 10:42
Change Registry Editor to play osu! without an audio device plugged in.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e96c-e325-11ce-bfc1-08002be10318}\0000\GlobalSettings]
"CenterLfeSwap"=hex:00,00,00,00
"CreateRearMaxOutChannels"=hex:00,00,00,00
"DcOffsetWorkaround"=hex:01,00,00,00
"DisableTimerResolution"=hex:01
"EnableDynamicDevices"=""
"EnableWaveRT"=hex:01,00,00,00
"FirstDrvLoad"=hex:00
@kenedii
kenedii / RemoveButtons.theme.css
Last active July 1, 2021 14:07 — forked from cheesits456/RemoveButtons.theme.css
Custom CSS for Discord to remove the GIF picker and Nitro Gift buttons from the message bar
/* ==========
RemoveButtons.theme.css by cheesits456 (https://cheesits456.dev)
For CSS compatible with browser extensions, see
https://gist.github.com/cheesits456/0d5bede837f022e443e9a5fc4aa386cb#file-discordbrowserstyles-css-L1
========== */
/* Hide Nitro gift button */
button[aria-label="Send a gift"] {
display: none;
: none;