1
0
Fork 0

Added: codebase constructs, types and keywords

Browse Source
This commit is contained in:
rhjr 2024-11-25 21:44:29 +01:00
parent fc6a5eaac6
commit d8c55982a7
9 changed files with 111 additions and 7 deletions

View File

@ -6,6 +6,8 @@ if not exist ".\build" mkdir ".\build"
pushd .\build
cl ..\src\main.c /Feapp.exe /nologo
set links= kernel32.lib
cl ..\src\eightysix.c /Feeightysix.exe /nologo /link %links%
popd .\build

14
docs/tasks Normal file
View File

@ -0,0 +1,14 @@
Tasks
- [ ] finish the 'simple' arena implementation.
- [ ] arena_alloc
- [ ] arena_release
- [ ] String8 implementation
- [ ] String8Node and String8List.
- [ ] push node
- [ ] list join
- [ ] Convert cstring to String8.
- [ ] Convert String8 to cstring.
- [ ] Read/Write to file.
- [ ] Create CLI output.
- [ ] Testcases?

23
src/eightysix.c Normal file
View File

@ -0,0 +1,23 @@
j
//= rhjr: [h]
#include "eightysix.h"
#include "win32_platform.h"
//= rhjr: [c]
#include "win32_platform.c"
u8 backing_buffer[2048];
int
main(void)
{
Arena arena = {0};
arena.backing_buffer = &backing_buffer[0];
arena.offset = 0;
arena.size = 2048;
return 0;
}

53
src/eightysix.h Normal file
View File

@ -0,0 +1,53 @@
#ifndef EIGHTYSIX_CORE_H
#define EIGHTYSIX_CORE_H
#include <stdio.h>
#include <stdint.h>
//= rhjr: types
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t i8;
typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;
typedef uint8_t b8;
typedef uint16_t b16;
typedef uint32_t b32;
typedef uint64_t b64;
#define internal static
#define global static
typedef struct String8
{
u8* contents;
i32 length;
}
String8;
//= rhjr: allocator
typedef struct Arena
{
u8 *backing_buffer;
i32 offset;
i32 size;
}
Arena;
//= rhjr: instructions.
// Intel 8086 manual, pg. 4-22
typedef enum InstrOpcode
{
InstrOpcode_MOV = 0x22 // 0010 0010
}
InstrOpcode;
#endif // EIGHTYSIX_CORE_H

View File

@ -1,5 +0,0 @@
int
main(void)
{
return 0;
}

8
src/win32_platform.c Normal file
View File

@ -0,0 +1,8 @@
String8 *
platform_write_file()
{
String8 *result;
return result;
}

9
src/win32_platform.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef WIN32_PLATFORM_H
#define WIN32_PLATFORM_H
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
internal String8 * platform_write_file(Arena *arena);
#endif // WIN32_PLATFORM_H

View File

@ -4,6 +4,6 @@ pushd "%~dp0"
pushd build
.\app.exe
.\eightysix.exe
popd