; Architecture file for the FEMTO-8 ; default output format is a memory initialization file .outfmt mif ; mif file is this big .mifwords 256 .mifwidth 16 ; Opcodes for core instruction set .define r0 0 .define r1 1 .define r2 2 .define r3 3 .define r4 4 .define r5 5 .define r6 6 .define r7 7 .define ip 7 .define LOAD_A 0 .define LOAD_B 1 .define INC 2 .define DEC 3 .define ASL 4 .define LSR 5 .define ROL 6 .define ROR 7 .define OR 8 .define AND 9 .define XOR 10 .define ZERO 11 .define ADD 12 .define SUB 13 .define ADC 14 .define SBB 15 ; reg-reg op reg 4 3 3 { 00000 (1) 0 (0) (2) } mem 4 3 3 { 00001 (1) 0 (0) (2) } imm 3 3 8 { 11 (0) (1) (2) } mov 3 3 { 00000 (0) 00001 (1) } or 3 3 { 00000 (0) 01000 (1) } and 3 3 { 00000 (0) 01001 (1) } xor 3 3 { 00000 (0) 01010 (1) } add 3 3 { 00000 (0) 01100 (1) } sub 3 3 { 00000 (0) 01101 (1) } adc 3 3 { 00000 (0) 01110 (1) } sbb 3 3 { 00000 (0) 01111 (1) } inc 3 { 00000 (0) 00010 (0) } dec 3 { 00000 (0) 00011 (0) } asl 3 { 00000 (0) 00100 (0) } lsr 3 { 00000 (0) 00101 (0) } rol 3 { 00000 (0) 00110 (0) } ror 3 { 00000 (0) 00111 (0) } zero 3 { 00000 (0) 01011 (0) } load 3 3 { 00001 (0) 00001 (1) } lor 3 3 { 00001 (0) 01000 (1) } land 3 3 { 00001 (0) 01001 (1) } lxor 3 3 { 00001 (0) 01010 (1) } ladd 3 3 { 00001 (0) 01100 (1) } lsub 3 3 { 00001 (0) 01101 (1) } ladc 3 3 { 00001 (0) 01110 (1) } lsbb 3 3 { 00001 (0) 01111 (1) } ior 3 8 { 11 000 (0) (1) } iand 3 8 { 11 001 (0) (1) } ixor 3 8 { 11 010 (0) (1) } iadd 3 8 { 11 100 (0) (1) } isub 3 8 { 11 101 (0) (1) } iadc 3 8 { 11 110 (0) (1) } isbb 3 8 { 11 111 (0) (1) } constb 3 8 { 00100 (0) (1) } loadz 3 8 { 00101 (0) (1) } storez 3 8 { 00110 (0) (1) } branch 3 8 { 10 (0) 111 (1) } bcc 8 { 10 001 111 (0) } bcs 8 { 10 101 111 (0) } bnz 8 { 10 010 111 (0) } bz 8 { 10 110 111 (0) } reset { 1011100011111111 } ; allow raw byte positioning byte 8 { (0) } ; One byte constant