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
// Import standard library | |
#import std; | |
// Make current unit importable | |
#export as hs_test | |
// Define "entry point" - function main (it's not an entry point because we exported current unit, it's just an example) | |
func main(argc is int, argv is char**) returns int { | |
// Example functionality - let's convert argv[1] to a number | |
var int result = call std:str_to_int(argv.at(1)); |
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
use std::io::Write; | |
fn main() { | |
let mut num1: i64 = 0; | |
let mut num2: i64 = 0; | |
let mut result: i64 = 0; | |
let mut buffer = std::string::String::new(); | |
print!("Enter the first number: "); | |
let _ = std::io::stdout().flush(); |
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 strcmpeq | |
strcmpeq: | |
xor rax, rax | |
xor rdx, rdx | |
.loop: | |
movdqu xmm1, [rdi + rdx] | |
pcmpistri xmm1, [rsi + rdx], 0x18 ; EQUAL_EACH | NEGATIVE_POLARITY | |
jc .diff | |
jz .equal |