Skip to content

Instantly share code, notes, and snippets.

View chastitywhiterose's full-sized avatar
😀
Hoping to contribute to an open source project. I have never learned how yet.

Chastity White Rose chastitywhiterose

😀
Hoping to contribute to an open source project. I have never learned how yet.
View GitHub Profile
@chastitywhiterose
chastitywhiterose / chastelib-api.h
Created October 4, 2026 19:55
I am writing my own Arbitary Precision Integer library from scratch.
/*
This file is a C library of functions written by Chastity White Rose.
This library is an extension of the original chastelib library.
The purpose is to create and manage Arbitrary Precision Integers.
These integers should be represented as strings of digits using the current radix.
*/
/*
section zero
@chastitywhiterose
chastitywhiterose / main.s
Last active September 3, 2026 15:26
stdin extension test for chastelib in RISC-V Assembly in RARS simulator
# chastelib test suite for RISC-V Assembly in RARS simulator
# this program tests the stdin extension of chastelib
# The same library of functions I commonly use in my Intel Assembly code
# have now been translated to RISC-V.
# All assembly code seen here is for the RARS simulator written in Java.
.data
@chastitywhiterose
chastitywhiterose / chastelib-w32.asm
Last active August 23, 2026 09:17
test suite for 32 bit Windows Assembly version of chastelib
; chastelib assembly header file for 32 bit Windows
; This file is where I keep the source of my most important Assembly functions
; These are my string and integer output and conversion routines.
; To simplify documentation. The Accumulator/Arithmetic register
; (ax,eax,rax) depending on bit size shall be referred to as register A
; for the description of these core functions because the A register
; is treated special both by the Intel company and my code;
; putstring; Prints a zero terminated string from the address pointer to by A register.
@chastitywhiterose
chastitywhiterose / chastelib-w64.asm
Last active August 23, 2026 09:14
test suite for 64 bit Windows Assembly version of chastelib
; chastelib assembly header file for 64 bit Windows
; This file is where I keep the source of my most important Assembly functions
; These are my string and integer output and conversion routines.
; To simplify documentation. The Accumulator/Arithmetic register
; (ax,eax,rax) depending on bit size shall be referred to as register A
; for the description of these core functions because the A register
; is treated special both by the Intel company and my code;
; putstring; Prints a zero terminated string from the address pointer to by A register.
@chastitywhiterose
chastitywhiterose / main.bas
Created August 13, 2026 08:35
QBASIC chastelib example
DECLARE FUNCTION intstr$ (i AS INTEGER)
DECLARE FUNCTION strint (s AS STRING)
' global variables to define radix and formatting
' for the intstr function
DIM SHARED radix AS INTEGER
DIM SHARED intwidth AS INTEGER
radix = 2
/'
global variables to define radix and formatting
for the intstr function
'/
dim shared as integer radix=2
dim shared as integer int_width=1
/'
translation of intstr function for FreeBASIC
by original C programmer Chastity White Rose
@chastitywhiterose
chastitywhiterose / chastelib.bi
Created August 5, 2026 21:33
This program is my FreeBASIC test suite for my supreme functions intstr and strint These functions originally written in C have been translated into FreeBASIC syntax perfectly and naturally work with the built in print statement for output. This program marks the start of my project of relearning BASIC, which was my first programming language an…
/'
global variables to define radix and formatting
for the intstr function
'/
dim shared as integer radix=2
dim shared as integer int_width=1
/'
translation of intstr function for FreeBASIC
by original C programmer Chastity White Rose
@chastitywhiterose
chastitywhiterose / main.pas
Created July 16, 2026 14:35
Pascal Powers of 2
program pow2;
var
a,b,x,y:integer;
c:array[0..255] of integer;
length:integer=20; //minimum length for digits
begin;
a:=0;
b:=64; //highest exponent we want
@chastitywhiterose
chastitywhiterose / main.zig
Created July 2, 2026 17:24
chastelib functions for zig
const std = @import("std");
var a:usize=0;
var b:usize=0x100;
pub fn main() void
{
putstr("Official test suite for the Zig version of chastelib.\n");
a=0;
while(a<b)
@chastitywhiterose
chastitywhiterose / ELF-64-hello.asm
Created June 25, 2026 14:30
FASM 64-bit ELF Hello World
;Chastity's Source for ELF 64-bit executable creation
;
;All data as defined in this file is based off of the specification of the ELF file format.
;I first looked at the type of file created by FASM's "format ELF executable" directive.
;It is great that FASM can create an executable file automatically. (Thanks Tomasz Grysztar, you are a true warrior!)
;However, I wanted to understand the format for theoretical use in other assemblers like NASM.
;However, the syntax of FASM and NASM is still different enough that this will work only in FASM.
;I do have a NASM version in a separate file in my repository though.