This file contains 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
#include "bool.h" | |
/* | |
Return the string representation of a signed or unsigned short. | |
Does not print leading zeroes. | |
@param | |
n - number to convert | |
s - true if n is signed, false if unsigned | |
buffer - seven character string buffer to write to, including null-terminator |
This file contains 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
// ===== IN MAIN.C ===== | |
// Test string matching | |
static char str1[] = "ABCD"; | |
static char str2[] = "ABCD"; | |
static char str3[] = "EFGH"; | |
static char match[] = "Match!"; | |
static char nomatch[] = "No match."; | |
if (stringMatch(&str1, &str2)) print(&match, 1, 1, 15); |
This file contains 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
MikeOS Mouse Library | |
Version 1.1.0 | |
API Document | |
Function: mouselib_install_driver | |
Input: Nothing | |
Output: Nothing | |
Description: Initialises the mouse device and installs the mouse driver that handles | |
the core library fuctionality. The driver will then continue to run in the background. | |
This must be run before calling any other mouse functions. |
This file contains 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
#ifndef _INPUT_H | |
#define _INPUT_H | |
#include "bool.h" | |
#define KEY_UP 72 | |
#define KEY_DOWN 80 | |
#define KEY_LEFT 75 | |
#define KEY_RIGHT 77 |
This file contains 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
_COLOR equ 0x0F | |
org 0x100 | |
start: | |
mov ax, 0x13 | |
int 0x10 | |
mov ax, 0xA000 |
This file contains 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
#include <stdio.h> | |
#include <stdbool.h> | |
void print(char* str); | |
bool isNumeric(char c); | |
bool isAlpha(char c); | |
bool stringMatch(char* str1, char* str2); | |
void main(void) { | |
char* welcome = "Hello 123 world!"; |
This file contains 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
org 0x100 | |
main: | |
mov si, hello_str | |
call printString | |
mov ax, 1 | |
mov bh, 3 | |
mov bl, 5 |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
void main(void) { | |
char blocks[] = "[][[][][[[]][]][]]"; | |
printf("_ | block: 0, depth: 0\n"); | |
This file contains 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
fpu_controlWord dw ? | |
macro nSaveControlWord { | |
mov ax, [fpu_controlWord] | |
} | |
macro nRestoreControlWord { | |
mov [fpu_controlWord], ax | |
fclex |
This file contains 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
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <string.h> | |
typedef char* String; | |
typedef struct { | |
bool valid; |