fn gen_input(platform: Platform) -> Chunk {
    let mut code = Emitter::new_simple("input", platform);
    match platform {
        Platform::Windows => {
            // mov rcx,rbp
            code.emit(&[0x48, 0x89, 0xE9]);
            // mov rdx,rsp
            code.emit(&[0x48, 0x89, 0xE2]);
        }
        Platform::Linux | Platform::Macos => {
            // mov rdi,rbp
            code.emit(&[0x48, 0x89, 0xEF]);
            // mov rsi,rsp
            code.emit(&[0x48, 0x89, 0xE6]);
        }
    }
    code.prepare_call(platform.stack_reserve());
    code.call(BUILTIN_INPUT);
    code.emit_ref_map();
    code.end_proc();
    code.finalize(ProcedureDebug {
        decl_line: 0,
        artificial: true,
        parent: None,
        return_type: TypeDebug::class_type("str"),
        params: vec![],
        lines: vec![],
        locals: vec![],
        frame_size: 0,
    })
}
// Generate machine code for `input`
Generate machine code for `input`
Generate machine code for ` input `
fn gen_input(platform: Platform) -> Chunk {
    let mut code = Emitter::new_simple("input", platform);
    match platform {
        Platform::Windows => {
            // mov rcx,rbp
            code.emit(&[0x48, 0x89, 0xE9]);
            // mov rdx,rsp
            code.emit(&[0x48, 0x89, 0xE2]);
        }
        Platform::Linux | Platform::Macos => {
            // mov rdi,rbp
            code.emit(&[0x48, 0x89, 0xEF]);
            // mov rsi,rsp
            code.emit(&[0x48, 0x89, 0xE6]);
        }
    }
    code.prepare_call(platform.stack_reserve());
    code.call(BUILTIN_INPUT);
    code.emit_ref_map();
    code.end_proc();
    code.finalize(ProcedureDebug {
        decl_line: 0,
        artificial: true,
        parent: None,
        return_type: TypeDebug::class_type("str"),
        params: vec![],
        lines: vec![],
        locals: vec![],
        frame_size: 0,
    })
}
fn gen_input ( platform : Platform ) -> Chunk { let mut code = Emitter :: new_simple ( " " , platform ) ; match platform { Platform :: Windows => { // mov rcx,rbp code . emit ( & [ 0x48 , 0x89 , 0xE9 ] ) ; // mov rdx,rsp code . emit ( & [ 0x48 , 0x89 , 0xE2 ] ) ; } Platform :: Linux | Platform :: Macos => { // mov rdi,rbp code . emit ( & [ 0x48 , 0x89 , 0xEF ] ) ; // mov rsi,rsp code . emit ( & [ 0x48 , 0x89 , 0xE6 ] ) ; } } code . prepare_call ( platform . stack_reserve ( ) ) ; code . call ( BUILTIN_INPUT ) ; code . emit_ref_map ( ) ; code . end_proc ( ) ; code . finalize ( ProcedureDebug { decl_line : 0 , artificial : true , parent : None , return_type : TypeDebug :: class_type ( " " ) , params : vec ! [ ] , lines : vec ! [ ] , locals : vec ! [ ] , frame_size : 0 , } ) }
Generate machine code for `input`
Generate machine code for ` input `
platform
Platform