progress on serial and added editor
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
use strum::{Display, EnumString};
|
||||
|
||||
use crate::prelude::Register;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Location {
|
||||
offset: u16,
|
||||
register: Option<Register>,
|
||||
@@ -20,13 +23,95 @@ impl Location {
|
||||
// if a register is being used already we have to add the offset to that.
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum ImmConst {
|
||||
Label(String),
|
||||
Imm16(u16),
|
||||
Imm32(u32),
|
||||
}
|
||||
|
||||
pub enum PseudoInstruction {
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumString, Display)]
|
||||
#[strum(ascii_case_insensitive)]
|
||||
pub enum AsmOpcode {
|
||||
Nop,
|
||||
|
||||
Mov,
|
||||
CMov,
|
||||
|
||||
Ldb,
|
||||
Ldbs,
|
||||
Ldh,
|
||||
Ldhs,
|
||||
Ldw,
|
||||
|
||||
Stb,
|
||||
Sth,
|
||||
Stw,
|
||||
|
||||
Lli,
|
||||
Lui,
|
||||
Lwi,
|
||||
|
||||
Jmp,
|
||||
Jez,
|
||||
Jnz,
|
||||
Jic,
|
||||
Jnc,
|
||||
|
||||
Ieq,
|
||||
Ine,
|
||||
Igt,
|
||||
Ige,
|
||||
Ilt,
|
||||
Ile,
|
||||
|
||||
Shl,
|
||||
Shr,
|
||||
Add,
|
||||
Sub,
|
||||
AddI,
|
||||
SubI,
|
||||
|
||||
And,
|
||||
Or,
|
||||
Not,
|
||||
Xor,
|
||||
Nand,
|
||||
Nor,
|
||||
Xnor,
|
||||
|
||||
Int,
|
||||
IRet,
|
||||
Hlt,
|
||||
|
||||
// Function instructions
|
||||
Call,
|
||||
Ret,
|
||||
|
||||
// Stack ops
|
||||
Push,
|
||||
Pop,
|
||||
|
||||
// data directives
|
||||
Db,
|
||||
Dh,
|
||||
Dw,
|
||||
|
||||
// data reservations
|
||||
Resb,
|
||||
Resh,
|
||||
Resw,
|
||||
|
||||
// Function pseudo-instructions
|
||||
Func,
|
||||
Return,
|
||||
|
||||
// include directive
|
||||
Include,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum AsmInstruction {
|
||||
Nop,
|
||||
|
||||
// move
|
||||
|
||||
Reference in New Issue
Block a user