working on this repo again...
This commit is contained in:
		| @@ -25,7 +25,6 @@ indent_style = tab | ||||
| indent_size  = 2 | ||||
| charset = utf-8 | ||||
|  | ||||
|  | ||||
| [*.{natvis, natstepfilter}] | ||||
| indent_style = tab | ||||
| indent_size  = 4 | ||||
|   | ||||
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -1 +1,2 @@ | ||||
| build/** | ||||
| .vscode/settings.json | ||||
|   | ||||
							
								
								
									
										9
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							| @@ -1,9 +0,0 @@ | ||||
| { | ||||
| 	"files.associations": { | ||||
| 		"*.rmd": "markdown", | ||||
| 		"pop_ignores.inline.h": "c", | ||||
| 		"basic_types.h": "c", | ||||
| 		"push_ignores.inline.h": "c", | ||||
| 		"memory.h": "c" | ||||
| 	} | ||||
| } | ||||
| @@ -122,7 +122,4 @@ typedef s8  b8; | ||||
| typedef s16 b16; | ||||
| typedef s32 b32; | ||||
|  | ||||
| typedef void*       memptr; | ||||
| typedef void const* memptr_const; | ||||
|  | ||||
| #pragma endregion Basic Types | ||||
|   | ||||
| @@ -19,14 +19,14 @@ | ||||
|  | ||||
| #define ASSERT( cond ) ASSERT( cond, NULL ) | ||||
|  | ||||
| #define ASSERT_MSG( cond, msg, ... )                                                         \ | ||||
| 	do                                                                                       \ | ||||
| 	{                                                                                        \ | ||||
| 		if ( ! ( cond ) )                                                                    \ | ||||
| 		{                                                                                    \ | ||||
| 			assert_handler( #cond, __FILE__, scast( s64, __LINE__ ), msg, ##__VA_ARGS__ );   \ | ||||
| 			GEN_DEBUG_TRAP();                                                                \ | ||||
| 		}                                                                                    \ | ||||
| #define ASSERT_MSG( cond, msg, ... )                                                 \ | ||||
| 	do                                                                                 \ | ||||
| 	{                                                                                  \ | ||||
| 		if ( ! ( cond ) )                                                                \ | ||||
| 		{                                                                                \ | ||||
| 			assert_handler( #cond, __FILE__, scast( s64, __LINE__ ), msg, ##__VA_ARGS__ ); \ | ||||
| 			GEN_DEBUG_TRAP();                                                              \ | ||||
| 		}                                                                                \ | ||||
| 	} while ( 0 ) | ||||
|  | ||||
| #define ASSERT_NOT_NULL( ptr ) ASSERT_MSG( ( ptr ) != NULL, #ptr " must not be NULL" ) | ||||
| @@ -35,24 +35,24 @@ | ||||
| #define PANIC( msg, ... ) ASSERT_MSG( 0, msg, ##__VA_ARGS__ ) | ||||
|  | ||||
| #if Build_Debug | ||||
| 	#define FATAL( ... )                                   \ | ||||
| 	do                                                     \ | ||||
| 	{                                                      \ | ||||
| 		local_persist thread_local                         \ | ||||
| 		char buf[GEN_PRINTF_MAXLEN] = { 0 };               \ | ||||
| 		                                                   \ | ||||
| 		str_fmt(buf, PRINTF_MAXLEN, __VA_ARGS__);          \ | ||||
| 		PANIC(buf);                                        \ | ||||
| 	}                                                      \ | ||||
| 	#define FATAL( ... )                        \ | ||||
| 	do                                          \ | ||||
| 	{                                           \ | ||||
| 		local_persist thread_local                \ | ||||
| 		char buf[GEN_PRINTF_MAXLEN] = { 0 };      \ | ||||
| 		                                          \ | ||||
| 		str_fmt(buf, PRINTF_MAXLEN, __VA_ARGS__); \ | ||||
| 		PANIC(buf);                               \ | ||||
| 	}                                           \ | ||||
| 	while (0) | ||||
| #else | ||||
|  | ||||
| #	define FATAL( ... )                      \ | ||||
| 	do                                       \ | ||||
| 	{                                        \ | ||||
| 		str_fmt_out_err( __VA_ARGS__ );      \ | ||||
| 		process_exit(1);                     \ | ||||
| 	}                                        \ | ||||
| #	define FATAL( ... )               \ | ||||
| 	do                                \ | ||||
| 	{                                 \ | ||||
| 		str_fmt_out_err( __VA_ARGS__ ); \ | ||||
| 		process_exit(1);                \ | ||||
| 	}                                 \ | ||||
| 	while (0) | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -48,17 +48,17 @@ | ||||
| #ifndef do_once | ||||
| #define do_once( statement ) for ( local_persist b32 once = true; once; once = false, (statement) ) | ||||
|  | ||||
| #define do_once_start      \ | ||||
| 	do                     \ | ||||
| 	{                      \ | ||||
| #define do_once_start  \ | ||||
| 	do                   \ | ||||
| 	{                    \ | ||||
| 		local_persist      \ | ||||
| 		bool done = false; \ | ||||
| 		if ( done )        \ | ||||
| 			break;         \ | ||||
| 			break;           \ | ||||
| 		done = true; | ||||
|  | ||||
| #define do_once_end        \ | ||||
| 	}                      \ | ||||
| #define do_once_end    \ | ||||
| 	}                    \ | ||||
| 	while(0); | ||||
| #endif | ||||
|  | ||||
|   | ||||
| @@ -4,14 +4,14 @@ | ||||
| #	pragma clang diagnostic ignored "-Wunused-but-set-variable" | ||||
| #	pragma clang diagnostic ignored "-Wswitch" | ||||
| #	pragma clang diagnostic ignored "-Wunused-variable" | ||||
| #   pragma clang diagnostic ignored "-Wunknown-pragmas" | ||||
| #	pragma clang diagnostic ignored "-Wunknown-pragmas" | ||||
| #	pragma clang diagnostic ignored "-Wvarargs" | ||||
| #	pragma clang diagnostic ignored "-Wunused-function" | ||||
| #endif | ||||
|  | ||||
| #ifdef __GNUC__ | ||||
| #	pragma GCC diagnostic push | ||||
| #   pragma GCC diagnostic ignored "-Wunknown-pragmas" | ||||
| #	pragma GCC diagnostic ignored "-Wunknown-pragmas" | ||||
| #	pragma GCC diagnostic ignored "-Wcomment" | ||||
| #	pragma GCC diagnostic ignored "-Wswitch" | ||||
| #	pragma GCC diagnostic ignored "-Wunused-variable" | ||||
|   | ||||
| @@ -1,43 +1,42 @@ | ||||
| ; hello.asm - Hello World with debug symbols for NASM | ||||
| ; hello.asm - Hello World with debug symbols for YASM | ||||
| BITS 64                         ; Explicitly specify 64-bit mode | ||||
| DEFAULT REL                     ; Use RIP-relative addressing by default | ||||
|  | ||||
| ; Data section | ||||
| section .data | ||||
|     message db "Hello, World!", 13, 10, 0  ; String with CRLF and null terminator | ||||
|     message_len equ $ - message            ; Calculate string length | ||||
|     message db "Hello, x86-64 ASM!", 13, 10, 0  ; String with CRLF and null terminator | ||||
|     message_len equ $ - message                 ; Calculate string length | ||||
|  | ||||
| ; Code section | ||||
| section .text | ||||
| global main                    ; Export main symbol for linker | ||||
|  | ||||
| extern ExitProcess            ; Import Windows API functions | ||||
| extern GetStdHandle | ||||
| extern WriteConsoleA | ||||
|  | ||||
| main: | ||||
|     ; Function prologue | ||||
|     push    rbp | ||||
|     mov     rbp, rsp | ||||
|     sub     rsp, 32              ; Shadow space for Windows API calls | ||||
| 	; Function prologue | ||||
| 	push    rbp | ||||
| 	mov     rbp, rsp | ||||
| 	sub     rsp, 32              ; Shadow space for Windows API calls | ||||
|  | ||||
|     ; Get stdout handle | ||||
|     mov     ecx, -11            ; STD_OUTPUT_HANDLE | ||||
|     call    GetStdHandle | ||||
|     mov     rbx, rax            ; Save handle for WriteConsole | ||||
| 	; Get stdout handle | ||||
| 	mov     ecx, -11            ; STD_OUTPUT_HANDLE | ||||
| 	call    GetStdHandle | ||||
| 	mov     rbx, rax            ; Save handle for WriteConsole | ||||
|  | ||||
|     ; Write message | ||||
|     mov     rcx, rbx            ; Console handle | ||||
|     lea     rdx, [message]      ; Message buffer | ||||
|     mov     r8d, message_len    ; Message length | ||||
|     lea     r9, [rsp+28]        ; Written chars (unused) | ||||
|     mov     qword [rsp+20], 0   ; Reserved (must be 0) | ||||
|     call    WriteConsoleA | ||||
| 	; Write message | ||||
| 	mov     rcx,  rbx              ; Console handle | ||||
| 	lea     rdx,  [message]        ; Message buffer | ||||
| 	mov     r8d,  message_len      ; Message length | ||||
| 	lea     r9,   [rsp+28]         ; Written chars (unused) | ||||
| 	mov     qword [rsp+20],    0   ; Reserved (must be 0) | ||||
| 	call    WriteConsoleA | ||||
|  | ||||
|     ; Exit program | ||||
|     xor     ecx, ecx            ; Exit code 0 | ||||
|     call    ExitProcess | ||||
| 	; Exit program | ||||
| 	xor     ecx, ecx            ; Exit code 0 | ||||
| 	call    ExitProcess | ||||
|  | ||||
|     ; Function epilogue (not reached due to ExitProcess) | ||||
|     leave | ||||
|     ret | ||||
| 	; Function epilogue (not reached due to ExitProcess) | ||||
| 	leave | ||||
| 	ret | ||||
|   | ||||
							
								
								
									
										26283
									
								
								toolchain/gencpp/gen.hpp
									
									
									
									
									
								
							
							
						
						
									
										26283
									
								
								toolchain/gencpp/gen.hpp
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										29125
									
								
								toolchain/gencpp/gencpp_c11.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29125
									
								
								toolchain/gencpp/gencpp_c11.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user