mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-30 23:23:07 +00:00 
			
		
		
		
	Work on windows.
This commit is contained in:
		
							
								
								
									
										4
									
								
								examples/sysir/run_samples.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								examples/sysir/run_samples.bat
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| janet.exe examples/sysir/samples.janet > temp.nasm | ||||
| nasm -fwin64 temp.nasm -l temp.lst -o temp.o | ||||
| link temp.o legacy_stdio_definitions.lib msvcrt.lib /out:temp.exe | ||||
| temp.exe | ||||
| @@ -32,8 +32,8 @@ | ||||
|      (return x))) | ||||
|  | ||||
| (def main-fn | ||||
|   '(defn _start:void [] | ||||
|      (syscall 1 1 "Hello, world!\n" 14) | ||||
|   '(defn WinMain:void [] | ||||
|      #(syscall 1 1 "Hello, world!\n" 14) | ||||
|      (doloop 10 20) | ||||
|      (exit (the int 0)) | ||||
|      (return))) | ||||
|   | ||||
| @@ -287,7 +287,7 @@ static uint32_t instr_read_type_operand(Janet x, JanetSysIR *ir, ReadOpMode rmod | ||||
|             return (uint32_t) n; | ||||
|         } else if (rmode == READ_TYPE_FORWARD_REF) { | ||||
|             uint32_t operand = linkage->type_def_count++; | ||||
|             janet_table_put(linkage->type_name_lookup, x, janet_wrap_number(-operand - 1)); | ||||
|             janet_table_put(linkage->type_name_lookup, x, janet_wrap_number(-(int64_t)operand - 1)); | ||||
|             return operand; | ||||
|         } else if (rmode == READ_TYPE_DEFINITION) { | ||||
|             uint32_t operand = linkage->type_def_count++; | ||||
| @@ -1600,7 +1600,7 @@ void janet_sys_ir_lower_to_ir(JanetSysIRLinkage *linkage, JanetArray *into) { | ||||
|                     build_tuple[0] = janet_csymbolv("type-array"); | ||||
|                     build_tuple[1] = janet_sys_get_desttype(linkage, instruction.array.dest_type); | ||||
|                     build_tuple[2] = janet_sys_get_desttype(linkage, instruction.array.type); | ||||
|                     build_tuple[4] = janet_wrap_number(instruction.array.fixed_count); | ||||
|                     build_tuple[4] = janet_wrap_number((double) instruction.array.fixed_count); | ||||
|                     break; | ||||
|             } | ||||
|             const Janet *tuple = janet_tuple_end(build_tuple); | ||||
|   | ||||
| @@ -586,7 +586,7 @@ void janet_sys_ir_lower_to_x64(JanetSysIRLinkage *linkage, JanetBuffer *buffer) | ||||
|                     janet_formatb(buffer, | ||||
|                                   "%s label_%d_%u\n", | ||||
|                                   instruction.opcode == JANET_SYSOP_BRANCH ? "jnz" : "jz", | ||||
|                                   i, instruction.branch.to); | ||||
|                                   i, (uint64_t) instruction.branch.to); | ||||
|                     break; | ||||
|                 case JANET_SYSOP_JUMP: | ||||
|                     janet_formatb(buffer, "jmp label_%d_%u\n", i, instruction.jump.to); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose