NASM to FASM
This commit is contained in:
parent
76ac2daa98
commit
b7031863c2
18
build.rs
18
build.rs
@ -1,5 +1,19 @@
|
||||
use std::{process::Command, env};
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=src/syscalls.S");
|
||||
nasm_rs::compile_library_args("libsyscalls.a", &["src/syscalls.S"], &["-f elf32"])
|
||||
.expect("failed to compile assembly");
|
||||
|
||||
let out_dir = env::var("OUT_DIR").unwrap();
|
||||
|
||||
Command::new("fasm")
|
||||
.arg("src/syscalls.S")
|
||||
.arg(&format!("{}/libsyscalls.a", out_dir))
|
||||
.status().unwrap();
|
||||
Command::new("ar")
|
||||
.arg("crus")
|
||||
.arg(&format!("{}/libsyscalls.a", out_dir))
|
||||
.arg(&format!("{}/libsyscalls.o", out_dir))
|
||||
.status().unwrap();
|
||||
|
||||
println!("cargo:rustc-link-search={}", out_dir)
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
BITS 32
|
||||
format ELF
|
||||
|
||||
section .text
|
||||
global _exit
|
||||
global _start_window_draw
|
||||
global _end_window_draw
|
||||
global _define_window
|
||||
global _display_message
|
||||
global _wait_event
|
||||
global _pressed_key
|
||||
section '.text'
|
||||
public _exit
|
||||
public _start_window_draw
|
||||
public _end_window_draw
|
||||
public _define_window
|
||||
public _display_message
|
||||
public _wait_event
|
||||
public _pressed_key
|
||||
|
||||
_exit:
|
||||
mov eax, -1
|
||||
|
Loading…
Reference in New Issue
Block a user