This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /' | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /' | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;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. |
NewerOlder