-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
101 lines (76 loc) · 3.15 KB
/
README
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
SAS is a DCPU-16 assembler.
sas stands for simple assembler. It outputs object files which then
are fed into the linker to then generate binary files. Why can't it
generate binary files directly? this is because I needed tools that
would work the way I wanted for systems/kernel development.
The assembler is written entirely in C with yacc and lex for parsing.
Released under the the GPL v2.
To build it simply type "make".
Tested on Linux kernel and Solaris (SunOS). Should compile on all UNIX
operating systems and and on Windows with Mingw/Cygwin (look below for
testings and help on building). If you have problems building just
submit an issue with specific details and I'll try to help.
It supports multiple assembly files, and always generates 1 object
file. Here are some directives it supports:
DIRECTIVES:
==========
NOTICE:
- 16 bit strings store the character in the least significant byte of
a word, this is to remain compatible with the LEM line of monitors
which use the most significant byte for colors
- NULL termination for 16 bit strings means a NULL word is appended
at the end of the 16 bit string
- NULL termination for 8 bit strings means either:
- a NULL word is appended at the end of the string if the length of
the string is even e.g "aa" = 0x6161 0x0000
- a NULL 8 bit byte is present in the least significant byte of the
word if the length of the string is odd e.g "aaa" = 0x6161 0x6100
DAT <value>/"<string>", ... outputs values and _non_ NULL terminated
16 bits per ASCII character strings
.asciz "<string>" outputs NULL terminated 16 bits per ASCII
character strings
.ascii8 "<string>" outputs NULL terminated 8 bits per ASCII
character strings (2 characters packed in a word)
.ascizlen "<string>" outputs prefixed CHARACTER COUNT word, then
16 bits per ASCII character strings
.ascii8len "<string>" outputs prefixed CHARACTER COUNT, then
8 bits per ASCII character strings
.noasciz "<string>" outputs 16 bits per ASCII character strings
.noascii8 "<string>" outputs 8 bits per ASCII character strings
.fill <value> <length> fills binary with <value> for <length> words
.align <value> pads with NULL until address % value = 0
.data or
.rodata or
.text or
.bss
(ignore)
special command line options:
--sof-lib symbol only object file generation (SOF)
--org <address> all symbols are offset <address> IMPORTANT:
do not specify this later into the linker,
else double the address will be the expected
origin of the binary
TODO:
.org <address> set instruction origin to <address>
.define or
.set or
.equ or
.def
<symbol> <value> set <symbol> to <value> (is global)
If you want to contact me, my email is [email protected]
bugs, issues, requests send them through Github.
Testing
-------
It should compile with gcc (or mingw), bison (with Cygwin on Windows,
flex (with Cygwin too on Windows) and make (I think Cygwin has make,
but otherwise just compile manually for Windows).
Tested on Linux kernel 3.16.0-4-amd64:
- gcc 4.9.2
- bison 3.0.2
- flex 2.5.39
- make 4.0
Tested on Oracle Solaris (SunOS 5.11) 11.2 i86pc i386:
- gcc 4.8.2
- bison 2.3
- flex 2.5.35
- make sysV-make