mirror of
https://github.com/Ed94/perfaware.git
synced 2026-08-14 11:28:08 +00:00
Some more prep
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
build
|
build
|
||||||
|
course_content
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Computer Enhance: Performance Aware Programming Course
|
||||||
|
|
||||||
|
```
|
||||||
|
git -C . config --local diff.ignoreSubmodules all
|
||||||
|
git -C . config --local status.submoduleSummary false
|
||||||
|
git -C . config --local submodule.recurse false
|
||||||
|
```
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
# pragma once
|
# pragma once
|
||||||
# include "dsl.h"
|
# include "dsl.h"
|
||||||
# include "memory.h"
|
# include "memory.h"
|
||||||
|
# include "analysis.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma region Hashing
|
#pragma region Hashing
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
# include "dsl.h"
|
# include "dsl.h"
|
||||||
# include "memory.h"
|
# include "memory.h"
|
||||||
# include "hashing.h"
|
# include "hashing.h"
|
||||||
|
# include "analysis.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#pragma region Key Table Linear (KTL)
|
#pragma region Key Table Linear (KTL)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# include "memory.h"
|
# include "memory.h"
|
||||||
# include "hashing.h"
|
# include "hashing.h"
|
||||||
# include "tables.h"
|
# include "tables.h"
|
||||||
|
# include "analysis.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NOTE(rjf): Includes reverses for uppercase and lowercase hex.
|
// NOTE(rjf): Includes reverses for uppercase and lowercase hex.
|
||||||
|
|||||||
+24
-13
@@ -52,6 +52,10 @@ WinAPI B4 ms_write_console(
|
|||||||
U4_V chars_written,
|
U4_V chars_written,
|
||||||
U8 reserved
|
U8 reserved
|
||||||
) asm("WriteConsoleA");
|
) asm("WriteConsoleA");
|
||||||
|
WinAPI void* ms_create_file_a(char const* lpFileName, U4 dwDesiredAccess, U4 dwShareMode, void* lpSecurityAttributes, U4 dwCreationDisposition, U4 dwFlagsAndAttributes, void* hTemplateFile) asm("CreateFileA");
|
||||||
|
WinAPI B4 ms_write_file(void* hFile, void const* lpBuffer, U4 nNumberOfBytesToWrite, U4* lpNumberOfBytesWritten, void* lpOverlapped) asm("WriteFile");
|
||||||
|
WinAPI B4 ms_read_file(void* hFile, void* lpBuffer, U4 nNumberOfBytesToRead, U4* lpNumberOfBytesRead, void* lpOverlapped) asm("ReadFile");
|
||||||
|
WinAPI B4 ms_close_handle(void* hObject) asm("CloseHandle");
|
||||||
|
|
||||||
// --- User32 ---
|
// --- User32 ---
|
||||||
WinAPI U2 ms_register_class_a(MS_WNDCLASSA const* lpWndClass) asm("RegisterClassA");
|
WinAPI U2 ms_register_class_a(MS_WNDCLASSA const* lpWndClass) asm("RegisterClassA");
|
||||||
@@ -113,10 +117,17 @@ WinAPI void* ms_create_solid_brush(U4 color) asm("
|
|||||||
WinAPI S4 ms_delete_object(void* ho) asm("DeleteObject");
|
WinAPI S4 ms_delete_object(void* ho) asm("DeleteObject");
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
MS_GENERIC_READ = 0x80000000,
|
||||||
|
MS_GENERIC_WRITE = 0x40000000,
|
||||||
|
MS_CREATE_ALWAYS = 2,
|
||||||
|
MS_OPEN_EXISTING = 3,
|
||||||
|
MS_FILE_ATTRIBUTE_NORMAL = 0x80,
|
||||||
|
|
||||||
MS_MEM_COMMIT = 0x00001000,
|
MS_MEM_COMMIT = 0x00001000,
|
||||||
MS_MEM_RESERVE = 0x00002000,
|
MS_MEM_RESERVE = 0x00002000,
|
||||||
MS_PAGE_READWRITE = 0x04,
|
MS_PAGE_READWRITE = 0x04,
|
||||||
MS_SRCCOPY = 0x00CC0020,
|
MS_SRCCOPY = 0x00CC0020,
|
||||||
|
|
||||||
MS_WM_DESTROY = 0x0002,
|
MS_WM_DESTROY = 0x0002,
|
||||||
MS_WM_SIZE = 0x0005,
|
MS_WM_SIZE = 0x0005,
|
||||||
MS_WM_PAINT = 0x000F,
|
MS_WM_PAINT = 0x000F,
|
||||||
@@ -133,26 +144,26 @@ enum {
|
|||||||
MS_WM_MOUSEWHEEL = 0x020A,
|
MS_WM_MOUSEWHEEL = 0x020A,
|
||||||
MS_WS_OVERLAPPEDWINDOW = 0x00CF0000,
|
MS_WS_OVERLAPPEDWINDOW = 0x00CF0000,
|
||||||
MS_WS_VISIBLE = 0x10000000,
|
MS_WS_VISIBLE = 0x10000000,
|
||||||
|
|
||||||
|
MS_PAGE_EXECUTE_READWRITE = 0x40,
|
||||||
|
|
||||||
|
MS_VK_BACK = 0x08,
|
||||||
|
MS_VK_TAB = 0x09,
|
||||||
|
MS_VK_RETURN = 0x0D,
|
||||||
|
MS_VK_SHIFT =0x10,
|
||||||
|
MS_VK_SPACE = 0x20,
|
||||||
|
MS_VK_PRIOR = 0x21,
|
||||||
|
MS_VK_NEXT = 0x22,
|
||||||
MS_VK_LEFT = 0x25,
|
MS_VK_LEFT = 0x25,
|
||||||
MS_VK_UP = 0x26,
|
MS_VK_UP = 0x26,
|
||||||
MS_VK_RIGHT = 0x27,
|
MS_VK_RIGHT = 0x27,
|
||||||
MS_VK_DOWN = 0x28,
|
MS_VK_DOWN = 0x28,
|
||||||
|
MS_VK_F1 = 0x70,
|
||||||
MS_PAGE_EXECUTE_READWRITE = 0x40,
|
MS_VK_F2 = 0x71,
|
||||||
|
|
||||||
MS_WM_CHAR = 0x0102,
|
|
||||||
MS_VK_RETURN = 0x0D,
|
|
||||||
MS_VK_BACK = 0x08,
|
|
||||||
MS_VK_TAB = 0x09,
|
|
||||||
MS_VK_SPACE = 0x20,
|
|
||||||
MS_VK_F5 = 0x74,
|
MS_VK_F5 = 0x74,
|
||||||
MS_VK_PRIOR = 0x21,
|
MS_WM_CHAR = 0x0102,
|
||||||
MS_VK_NEXT = 0x22,
|
|
||||||
|
|
||||||
MS_VK_SHIFT =0x10,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#if BUILD_DEBUG
|
#if BUILD_DEBUG
|
||||||
FI_ void assert(U8 cond) { if(cond){return;} else{debug_trap(); ms_exit_process(1);} }
|
FI_ void assert(U8 cond) { if(cond){return;} else{debug_trap(); ms_exit_process(1);} }
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -3,8 +3,12 @@
|
|||||||
#include "duffle/memory.h"
|
#include "duffle/memory.h"
|
||||||
#include "duffle/win32.h"
|
#include "duffle/win32.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
ms_exit_process(0);
|
ms_exit_process(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// raddbg 0.9.28 project file
|
||||||
|
|
||||||
|
target:
|
||||||
|
{
|
||||||
|
executable: "build/sim_8086.exe"
|
||||||
|
working_directory: "build/"
|
||||||
|
enabled: 1
|
||||||
|
label: "Sim 8086"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user