- All tests passing

- Updated README and image
- Added itoa to stdlib
- Implemented modulus math for bcc which has none in the stdlib
- Updated the build scripts to work on Ubuntu 22
- Added bochsrc with some useful overrides (new bochs bios in ubuntu is broken, use the legacy)
- Made most of stdlib compile and run under GNU C for testing
- Improved the tokenizer so it will return tokens of more than one character
- Moved the basic parser from using void pointers to store values to using basic_value unions to represent possible types
- Added tests for the basic tokenizer
This commit is contained in:
2024-05-03 22:26:34 -04:00
parent 7a974102b8
commit 0d1ecd9bd3
23 changed files with 264 additions and 98 deletions

16
tests/stdlib_itoa.c Normal file
View File

@@ -0,0 +1,16 @@
#include "types.h"
#include "stdlib.h"
#include "string.h"
#include <stdio.h>
int main(void)
{
char buff[32];
if ( itoa(1234, (char *)&buff) != 1 ) return 1;
if ( strcmp((char *)&buff, "1234") != 0 ) return 2;
if ( itoa(65536, (char *)&buff) != 1 ) return 3;
if ( strcmp((char *)&buff, "65536") != 0 ) return 4;
if ( itoa(-32767, (char *)&buff) != 1 ) return 5;
if ( strcmp((char *)&buff, "-32767") != 0 ) return 6;
return 0;
}