8bitworkshop/presets/verilog/femto8.cfg

101 lines
2.0 KiB
INI

; Architecture file for the FEMTO-8
; default output format is a memory initialization file
.outfmt mif
; mif file is this big
.mifwords 256
.mifwidth 8
; Opcodes for core instruction set
.define A 0
.define B 1
.define IP 2
.define NOP 3
.define LOAD_A 0000
.define LOAD_B 0001
.define INC 0010
.define DEC 0011
.define ASL 0100
.define LSR 0101
.define ROL 0110
.define ROR 0111
.define OR 1000
.define AND 1001
.define XOR 1010
.define ZERO 1011
.define ADD 1100
.define SUB 1101
.define ADC 1110
.define SBB 1111
; ALU A + B -> dest
mova 2 { 00 (0) 0000 }
movb 2 { 00 (0) 0001 }
inc 2 { 00 (0) 0010 }
dec 2 { 00 (0) 0011 }
asl 2 { 00 (0) 0100 }
lsr 2 { 00 (0) 0101 }
rol 2 { 00 (0) 0110 }
ror 2 { 00 (0) 0111 }
or 2 { 00 (0) 1000 }
and 2 { 00 (0) 1001 }
xor 2 { 00 (0) 1010 }
zero 2 { 00 (0) 1011 }
add 2 { 00 (0) 1100 }
sub 2 { 00 (0) 1101 }
adc 2 { 00 (0) 1110 }
sbb 2 { 00 (0) 1111 }
; ALU A + immediate -> dest
movi 2 8 { 01 (0) 0001 (1) }
asli 2 8 { 01 (0) 0100 (1) }
lsri 2 8 { 01 (0) 0101 (1) }
roli 2 8 { 01 (0) 0110 (1) }
rori 2 8 { 01 (0) 0111 (1) }
ori 2 8 { 01 (0) 1000 (1) }
andi 2 8 { 01 (0) 1001 (1) }
xori 2 8 { 01 (0) 1010 (1) }
addi 2 8 { 01 (0) 1100 (1) }
subi 2 8 { 01 (0) 1101 (1) }
adci 2 8 { 01 (0) 1110 (1) }
sbbi 2 8 { 01 (0) 1111 (1) }
; ALU A + read [B] -> dest
movrb 2 { 11 (0) 0001 }
aslrb 2 { 11 (0) 0100 }
lsrrb 2 { 11 (0) 0101 }
rolrb 2 { 11 (0) 0110 }
rorrb 2 { 11 (0) 0111 }
orrb 2 { 11 (0) 1000 }
andrb 2 { 11 (0) 1001 }
xorrb 2 { 11 (0) 1010 }
addrb 2 { 11 (0) 1100 }
subrb 2 { 11 (0) 1101 }
adcrb 2 { 11 (0) 1110 }
sbbrb 2 { 11 (0) 1111 }
; A -> write [nnnn]
sta 4 { 1001 (0) }
; other insns
clc { 10001000 }
swapab { 10000001 }
reset { 10001111 }
lia 8 { 01 00 0001 (0) }
lib 8 { 01 01 0001 (0) }
jmp 8 { 01 10 0001 (0) }
; conditional branch
bcc 8 { 1010 0001 (0) }
bcs 8 { 1010 0011 (0) }
bz 8 { 1010 1100 (0) }
bnz 8 { 1010 0100 (0) }
; allow raw byte positioning
byte 8 { (0) } ; One byte constant