This repository has been archived by the owner on Sep 18, 2022. It is now read-only.
forked from LucasCatchlove/Cmin_Cross_Assembler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.txt
102 lines (102 loc) · 3.41 KB
/
tests.txt
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Test generateToken
enter.u5 pop ".cstring" 1 ; hello
enter.u5 pop ".cstring" 1 ; hello
Test Lexical Analyser scan and getNextFin (1)
.cstring A23 ; directive
.cstring A23 ; directive
Test Lexical Analyser scan and getNextFin (2)
enter.u5 4 ; OK, number <u5> [0..31].
enter.u5 4 ; OK, number <u5> [0..31].
Test parseToken (1)
enter.u5 pop true
enter.u5 pop true
Test parseToken (2)
ldc.i3 true true
ldc.i3 true true
Test parse (1)
.cstring ; directive
.cstring ; directive
Test parse (2)
enter.u5 4 ; OK, number <u5> [0..31].
enter.u5 4 ; OK, number <u5> [0..31].
Test parse (3)
ldc.i3 3 ; OK, number <i3> [-4..3].
ldc.i3 3 ; OK, number <i3> [-4..3].
Test parse (4)
ldc.i3 -4 ; OK, number <i3> [-4..3].
ldc.i3 -4 ; OK, number <i3> [-4..3].
Test components.SymbolTable
Name: pop, Opcode: 01; Name: halt, Opcode: 00
Name: pop, Opcode: 01; Name: halt, Opcode: 00
Test components.Position getLineCounter
2 3 9
2 3 9
Test components.Position getColumnCounter
1 8 3
1 8 3
Test components.Mnemonic getMnemonicName
or enter.u5 tle
or enter.u5 tle
Test components.Mnemonic getOpCode
0E 1C 1E
0E 1C 1E
Test components.Mnemonic getType
Inherent Immediate Inherent
Inherent Immediate Inherent
Test components.Instruction getMnemonic
Name: teq, Opcode: 1A Name: add, Opcode: 0C Name: sub, Opcode: 0D
Name: teq, Opcode: 1A Name: add, Opcode: 0C Name: sub, Opcode: 0D
Test IR1
halt pop
halt pop
Test IR2
truetrue
truetrue
Test analysers.FileReader getFileName
TestLexicalAnalyser.txt
TestLexicalAnalyser.txt
Test writeListingFile & openOutputStream
true
true
Test header
Line Addr Machine Code Label Assembly Code Operand Comments
Line Addr Machine Code Label Assembly Code Operand Comments
Test Lineformatter(1)
3 0001 83 enter.u5 3 ; OK, number <u5> [0..31].
3 0001 83 enter.u5 3 ; OK, number <u5> [0..31].
Test Lineformatter(2)
37 0022 94 ldc.i3 -4 ; OK, number <i3> [-4..3].
37 0022 94 ldc.i3 -4 ; OK, number <i3> [-4..3].
Test Lineformatter(3)
2 0000 .cstring ; directive
2 0000 .cstring ; directive
Test Lineformatter(4)
2 0000 pop ; inherent instruction
2 0000 pop ; inherent instruction
Test separateLineStatement (1)
0000halt; a comment
0000halt; a comment
Test separateLineStatement (2)
0001pop; a comment
0001pop; a comment
Test separateLineStatement (3)
0002enter.u5; a comment
0002enter.u5; a comment
Test separateLineStatement (4)
0003ldc.i3; a comment
0003ldc.i3; a comment
Test Range getStart()
range1: start=0; range2: start=-4
range1: start=0; range2: start=-4
Test Range getEnd()
range1: end=31; range2: end=3
range1: end=31; range2: end=3
Test Range getMncSignStr()
range1: signStr=unsigned; range2: signStr=signed
range1: signStr=unsigned; range2: signStr=signed
Test ErrorReporter isEmpty
ErrorReporter Is Empty = true
ErrorReporter Is Empty = true
Test ErrorReporter isEmpty() and recordError()
[error test 1] [4,2]
[error test 1] [4,2]