mirror of
https://github.com/italicsjenga/gba.git
synced 2024-12-23 19:01:30 +11:00
instruction inline example.
This commit is contained in:
parent
adc69ff6dc
commit
d412ee7779
1
dump.bat
1
dump.bat
|
@ -1,2 +1,3 @@
|
|||
cargo build --examples
|
||||
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/hello >target/dump-hello.txt
|
||||
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/instruction_inline >target/dump-instruction_inline.txt
|
||||
|
|
1
dump.sh
1
dump.sh
|
@ -1,3 +1,4 @@
|
|||
#!/bin/sh
|
||||
cargo build --examples
|
||||
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/hello >target/dump-hello.txt
|
||||
arm-none-eabi-objdump --headers --disassemble --demangle --architecture=armv4t --no-show-raw-insn -Mreg-names-std target/thumbv4t-none-eabi/debug/examples/instruction_inline >target/dump-instruction_inline.txt
|
||||
|
|
21
examples/instruction_inline.rs
Normal file
21
examples/instruction_inline.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(isa_attribute)]
|
||||
|
||||
use gba::prelude::*;
|
||||
|
||||
#[panic_handler]
|
||||
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[instruction_set(arm::a32)]
|
||||
fn make_3rd_bg_pal_entry_black() {
|
||||
BG_PALETTE.index(3).write(Color::new());
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn main() -> ! {
|
||||
make_3rd_bg_pal_entry_black();
|
||||
loop {}
|
||||
}
|
Loading…
Reference in a new issue