mcc
mcc is a machine code compiler.
Log | Files | << Repositories
tree 18007b7116d899ba5a03792a34d4e2b75502c013 parent 5bc078e6dc2616fbaa1bcd2a7f7bb013d30d6b4d author esote <esote.net@gmail.com> 1575913255 -0600 committer esote <esote.net@gmail.com> 1575913255 -0600 gpgsig -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQTXAxYDuIzimYoNSPuhTmRAjzzC8gUCXe6HNAAKCRChTmRAjzzC 8hmGAP0aD1Y2OXZLq7aZKWTjM/nOQxOc2IxWaDZmNmSYMO+MqgD/fom4kTeorMSh qVgad0UiN5xng7fLyzwhZ3FgQYIwMgI= =IG7B -----END PGP SIGNATURE----- Update manual formatting
Makefile | 2 +- mcc.1 | 37 +++++++++++++++++++++++++------------ mcc.c | 2 +- 3 files changed, 27 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile index 7d5d981..4195ee7 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ $(PROG): $(SRCS) $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG).out $(SRCS) debug: $(SRCS) - $(CC) -g -Wall -Wextra -Wconversion -o $(PROG).out $(SRCS) + $(CC) -g -Wall -Wextra -Wconversion -Wundef -o $(PROG).out $(SRCS) clean: rm -f $(PROG).out diff --git a/mcc.1 b/mcc.1 index 751b45c..3a2c216 100644 --- a/mcc.1 +++ b/mcc.1 @@ -14,7 +14,7 @@ .\" You should have received a copy of the GNU Affero General Public License .\" along with this program. If not, see <https://www.gnu.org/licenses/>. .\" -.Dd $Mdocdate: July 13 2019 $ +.Dd $Mdocdate: December 9 2019 $ .Dt MCC 1 .Os .Sh NAME @@ -31,9 +31,16 @@ file .Sh DESCRIPTION .Nm mcc is a machine code compiler. -It reads binary ASCII text '0' and '1' mapping to machine code instructions. -All other characters are ignored except the comment token ';'. -Comments begin with ';' and continue until EOL. +It reads binary ASCII text +.Sq 0 +and +.Sq 1 +mapping to machine code instructions. +All other characters are ignored except the comment token +.Sq \&; . +Comments begin with +.Sq \&; +and continue until EOL. The .Fl h option enables parsing hexadecimal rather than binary text. @@ -41,7 +48,8 @@ option enables parsing hexadecimal rather than binary text. Use the .Fl o option to specify the output filename. -The default is to put the executable in \fIa.out\fR. +The default is to put the executable in +.Pa a.out . .Pp Supports little-endian x86-64 and i386 execution environments using the System V application binary interface. 64-bit is the default mode, @@ -53,8 +61,9 @@ When writing to the .bss section, specify the size of memory reserved using the .Fl m option. -If the size is zero (default), no .bss section will be written for the -executable. +If the size is zero +.Pq default , +no .bss section will be written for the executable. .Pp In 64-bit mode the .bss and .text sections start at 0x402000 and 0x401000 respectively, and in 32-bit mode 0x804a000 and 0x8049000 @@ -65,8 +74,8 @@ and .Fl t options to specify custom addresses. .Pp -Program header segment alignment is set to 0x1000 (the page size on most -systems). +Program header segment alignment is set to 0x1000 +.Pq the page size on most systems . .Pp .bss is aligned to a 16-byte constraint and .text to an 8-byte constraint. @@ -77,10 +86,14 @@ option to mark the .text section as writable, allowing self-modifying code. .Sh AUTHORS .Nm mcc was written by -.An Esote +.An Esote . .Sh COPYRIGHT -Copyright (c) 2019 Esote. +Copyright +.Pq c +2019 Esote. There is NO warranty. You may redistribute this software under the terms of the GNU Affero General Public License. -For more information, see the LICENSE file. +For more information, see the +.Pa LICENSE +file. diff --git a/mcc.c b/mcc.c index b17eae8..45f84a5 100644 --- a/mcc.c +++ b/mcc.c @@ -75,7 +75,7 @@ main(int argc, char *argv[]) if (errno == EINVAL || errno == ERANGE) { err(1, "bss address invalid"); } else if (optarg == end) { - err(1, "no bss address read"); + errx(1, "no bss address read"); } use_bss_addr = 1;