Initial commit

This commit is contained in:
Alexander Rosenberg 2022-09-17 18:09:28 -07:00
parent a8bf8841c2
commit 6c6bed6c7e
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
3 changed files with 220 additions and 239 deletions

11
cat.s
View File

@ -1,8 +1,13 @@
;; -*- mode: nasm -*- ;; -*- mode: nasm -*-
;; Select the one that matches your os %define SYS_open 0x2
%include "linux.s" %define SYS_close 0x3
;%include "freebsd.s" %define SYS_write 0x1
%define SYS_read 0x0
%define SYS_lseek 0x8
%define SYS_exit 0x3c
%define O_RDONLY 0x0
%define SEEK_SET 0x0
%define FD_stderr 2 %define FD_stderr 2
%define FD_stdout 1 %define FD_stdout 1
%define FD_stdin 0 %define FD_stdin 0

View File

@ -1,12 +0,0 @@
;; -*- mode: nasm -*-
;; FreeBSD system calls
%define SYS_open 0x5
%define SYS_close 0x6
%define SYS_write 0x4
%define SYS_read 0x3
%define SYS_lseek 0x1de
%define SYS_exit 0x1
;; FreeBSD constants
%define O_RDONLY 0x0
%define SEEK_SET 0x0

12
linux.s
View File

@ -1,12 +0,0 @@
;; -*- mode: nasm -*-
;; Linux system calls
%define SYS_open 0x2
%define SYS_close 0x3
%define SYS_write 0x1
%define SYS_read 0x0
%define SYS_lseek 0x8
%define SYS_exit 0x3c
;; Linux constants
%define O_RDONLY 0x0
%define SEEK_SET 0x0