-
Notifications
You must be signed in to change notification settings - Fork 0
/
scasm.cfg
81 lines (65 loc) · 1.92 KB
/
scasm.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
; ECE2031, Simple Computer configuration file
; 2014
;;; Assembler Directives
#EXTENSION MIF ;Extension to give assembled files
#ADDRBITS 11 ;Number of bits in the program address
#WORDBITS 16 ;Number of bits in the program word
;;; Program / Data file layout
;HEAD defines the heading to include at the top of the assembled file
#HEAD -- Altera Memory Initialization File (MIF)
#HEAD
#HEAD DEPTH = 2048;
#HEAD WIDTH = 16;
#HEAD
#HEAD ADDRESS_RADIX = HEX;
#HEAD DATA_RADIX = HEX;
#HEAD
#HEAD CONTENT
#HEAD BEGIN
#HEAD [000..7FF] : 0000; -- Default to NOP
#HEAD
;LINE dictates how the assembled data should appear in the resulting file
; %ADDR is the location of the address
; %WORD is the location of the data / instruction word
; %SOURCE is the location of the original line of code
#LINE %ADDR : %WORD; -- %SOURCE
;TAIL defines the trailer appended to the end of the assembled file
#TAIL END;
;;; Mnemonics Definitions
;Mnemonic %field1, %field2, %field3, ...
;
; %# Defines the number of bits, #, in a given field.
; A number before the % indicates a constant field, such as an opcode.
; The letter 's' immediately following the % indicates sign magnitude
; representation instead of two's complement.
;
; Example:
; LFSR &H08%8, %6, %2
;
; The LFSR mnemonic has one 8-bit constant field of value 0x08 and
; 2 user fields of bit lengths 6 and 2.
DW %16 ;Allows manual word definition, useful for initializing RAM
NOP &H00%16
LOAD &H01%5, %11
STORE &H02%5, %11
ADD &H03%5, %11
SUB &H04%5, %11
JUMP &H05%5, %11
JNEG &H06%5, %11
JPOS &H07%5, %11
JZERO &H08%5, %11
AND &H09%5, %11
OR &H0A%5, %11
XOR &H0B%5, %11
SHIFT &H0C%5, 0%6, %s5
ADDI &H0D%5, %11
ILOAD &H0E%5, %11
ISTORE &H0F%5, %11
CALL &H10%5, %11
RETURN &H11%5, 0%11
IN &H12%5, %11
OUT &H13%5, %11
CLI &H14%5, 0%7, %4
SEI &H15%5, 0%7, %4
RETI &H16%5, 0%11
LOADI &H17%5, %11