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. |
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 32-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. |
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 Linux | |
| ; 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 Linux | |
| ; 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,ebx,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 test suite for RISC-V Assembly in riscemu simulator | |
| # The same library of functions I commonly use in my Intel Assembly code | |
| # have now been translated to RISC-V. | |
| .data | |
| # These variables are used by the intstr function to convert an integer to a string | |
| # and what radix should be used as well as the width (how many leading zeros) |
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 putstring function for RISC-V Assembly in riscemu | |
| .data | |
| string0: .asciiz "I am Chastity White Rose\n" | |
| .text | |
| addi s0, zero, string0 | |
| jal putstring |
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. | |
| ;Therefore, what you see here is a complete Hello World program that should work within NASM | |
| ;to create an executable file without using a linker. It worked perfectly on my machine running Debian Linux and NASM version 2.16.01. |
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 32-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. | |
| ;Therefore, what you see here is a complete Hello World program that should work within NASM | |
| ;to create an executable file without using a linker. It worked perfectly on my machine running Debian Linux and NASM version 2.16.01. |
NewerOlder