Skip to content

Commit

Permalink
The xina version compiles again with nasm.
Browse files Browse the repository at this point in the history
  • Loading branch information
albert committed Feb 10, 2014
1 parent 3632b18 commit df57699
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 40 deletions.
23 changes: 17 additions & 6 deletions ci86.gnr
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@ _LINUX_C_({Called from c. Remainder c-routines to be called from here.
extern c_rslw, c_block_exit, c_block_init, c_debug
GLOBAL ciforth})
})_C{}_END_({ _HOSTED_LINUX_})
_HOSTED_OSX_({include(constant_osx.m4) })
_HOSTED_OSX_({
include(constant_osx.m4)
RAWIO EQU (ECHO _OR_ ICANON)
})_C{}_END_({ _HOSTED_OSX_})
_PC_({
create EQU 0x3C00
open EQU 0x3D00
Expand Down Expand Up @@ -2461,9 +2464,7 @@ CODE_HEADER({DSP!},{SPSTO})
MOV SPO,AX _C{RESET PARAM STACK POINTER}
_NEXT
_C
dnl Note that this is now in the .lab .
dnl If there are more, this documentation should be in the a lab.mi file.
worddoc( {STACKS},{DEPTH},,{--- n1},{ISO,WANT},
worddoc( {STACKS},{DEPTH},{depth},{--- n1},{ISO},
{Leave into forthvar({n1}) the number of items on the data stack,
before forthvar({n1}) was pushed.},
{{DSP@@}},
Expand All @@ -2477,6 +2478,16 @@ _HEADER({DEPTH},{DEPTH},{DOCOL})
DC ONEM
DC SEMIS
_C
worddoc( {STACKS},{CLS},{c_l_s},{ i*x -- },{},
{Clear the data stack},
{{DSP@@}},
{{ 1 2 3 CLS DEPTH .},{0} },
enddoc)
_HEADER({CLS},{CLS},{DOCOL})
DC SZERO, FETCH
DC SPSTO
DC SEMIS
_C
dnl was the end of a LOADable option.
worddocsafe( {STACKS},{RSP@@},{r_s_p_fetch},{--- addr},{},
{Return the address forthvar({addr}) of the current return
Expand Down Expand Up @@ -7973,7 +7984,7 @@ _HOSTED_OSX_({
_HEADER({REPOSITION-FILE},{PFILE},{DOCOL})
DC ROT, ROT
DC LIT, SEEK_SET, X
DC LIT, _osx_lseek, XOS5
DC LIT, lseek, XOS5
DC ZERO, MIN
DC SEMIS
})_C{}_END_({_HOSTED_OSX_})
Expand Down Expand Up @@ -9324,7 +9335,7 @@ _C{ Get environment vector}
DD LIT, SYSARGS
DD SHELL, CELLP
DD LIT, 3
DD LIT, _osx_execve, XOSV
DD LIT, execve, XOSV
DC LIT, 49, LERROR, BYE _C{ Returned, this is always wrong.}
SYSTEM1:
DC LDUP
Expand Down
70 changes: 36 additions & 34 deletions constant_osx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,47 @@ _C{ ------------------------------------------------------------ }
_C{ Start of constants stolen from C. }
_C{ ------------------------------------------------------------ }

SEEK_SET EQU 0x0
TCGETS EQU 0x5401
TCSETS EQU 0x5402
ECHO EQU 0x8
EAGAIN EQU 0xb
EINTR EQU 0x4
EPIPE EQU 0x20
VMIN EQU 0x6
VTIME EQU 0x5
ICANON EQU 0x2
O_RDWR EQU 0x2
O_RDONLY EQU 0x0
O_WRONLY EQU 0x1
O_CREAT EQU 0x40
O_NONBLOCK EQU 0x800
SIZE_TERMIO EQU 0x3c
SEEK_SET EQU 0x0
TCGETS EQU 0x5401
TCSETS EQU 0x5402
ECHO EQU 0x8
EAGAIN EQU 0xb
EINTR EQU 0x4
EPIPE EQU 0x20
VMIN EQU 0x6
VTIME EQU 0x5
ICANON EQU 0x2
O_RDWR EQU 0x2
O_RDONLY EQU 0x0
O_WRONLY EQU 0x1
O_CREAT EQU 0x40
O_NONBLOCK EQU 0x800
SIZE_TERMIO EQU 0x3c

_C{ Numbers of system calls. See "Linux kernel Internals" Appendix A. }
_C{ By M.Beck, H. Boehme e.a. Addison Wesley. }
_C{ The system calls themselves are extensively documented in chapter }
_C{ 2 of the man pages, e.g. "man 2 exit"}
exit EQU 0x1
open EQU 0x5
close EQU 0x6
creat EQU 0x8
unlink EQU 0xa
chdir EQU 0xc
read EQU 0x3
select EQU 0x52
_newselect EQU 0x8e
write EQU 0x4
ioctl EQU 0x36
ioperm EQU 0x65
iopl EQU 0x6e
lseek EQU 0x13
execve EQU 0xb
fork EQU 0x2
waitpid EQU 0x7
pipe EQU 0x2a
exit EQU 0x1
open EQU 0x5
close EQU 0x6
creat EQU 0x8
unlink EQU 0xa
chdir EQU 0xc
read EQU 0x3
select EQU 0x52
_newselect EQU 0x8e
write EQU 0x4
ioctl EQU 0x36
ioperm EQU 0x65
iopl EQU 0x6e
lseek EQU 0xc7
_C{_osx_lseek EQU 0xc7}
execve EQU 0x3B
_C{_osx_execve EQU 59}
fork EQU 0x2
waitpid EQU 0x7
pipe EQU 0x2a
_C{ ------------------------------------------------------------ }
_C{ End of constants stolen from C. }
_C{ ------------------------------------------------------------ }

0 comments on commit df57699

Please sign in to comment.