version for new assembler
This commit is contained in:
parent
d8e018a044
commit
345609b5ac
|
@ -1,25 +1,44 @@
|
|||
TAIL=tail.hermac
|
||||
TAIL=libhermac_o.a
|
||||
# Other possibilities are: tail.nascom and tail.cpm
|
||||
MACH=z80
|
||||
|
||||
all: tail.cpm tail.nascom tail.hermac
|
||||
all: head_em.o libhermac_o.a libnascom_o.a libcpm_o.a
|
||||
|
||||
install: $(TAIL)
|
||||
../../install head_em.s head_em
|
||||
../../install $(TAIL) tail_sys
|
||||
install: head_em.o $(TAIL)
|
||||
../../install head_em.o head_em
|
||||
../../install $(TAIL) tail_mon
|
||||
|
||||
cmp: $(TAIL)
|
||||
-../../compare head_em.s head_em
|
||||
-../../compare $(TAIL) tail_sys
|
||||
cmp: head_em.o $(TAIL)
|
||||
-../../compare head_em.o head_em
|
||||
-../../compare $(TAIL) tail_mon
|
||||
|
||||
tail.cpm: mon.cpm.s
|
||||
head_em.o: head_em.s
|
||||
$(MACH) -I../../../h -c head_em.s
|
||||
|
||||
libcpm_o.a: libcpm_s.a
|
||||
ASAR=aal ; export ASAR; march . libcpm_o.a
|
||||
|
||||
libnascom_o.a: libnascom_s.a
|
||||
ASAR=aal ; export ASAR; march . libnascom_o.a
|
||||
|
||||
libhermac_o.a: libhermac_s.a
|
||||
ASAR=aal ; export ASAR; march . libhermac_o.a
|
||||
|
||||
libcpm_s.a:
|
||||
@echo Warning: untested, this is an example
|
||||
arch cr tail.cpm mon.cpm.s
|
||||
arch cr libcpm_s.a mon.cpm.s
|
||||
echo libcpm_s.a > LIST
|
||||
arch t libcpm_s.a >> LIST
|
||||
|
||||
tail.nascom: mon.s char.nas.s
|
||||
arch cr tail.nascom mon.s char.nas.s
|
||||
libnascom_s.a:
|
||||
arch cr libnascom_s.a mon.s char.nas.s
|
||||
echo libnascom_s.a > LIST
|
||||
arch t libnascom_s.a >> LIST
|
||||
|
||||
tail.hermac: mon.s char.her.s
|
||||
arch cr tail.hermac mon.s char.her.s
|
||||
libhermac_s.a:
|
||||
arch cr libhermac_s.a mon.s char.her.s
|
||||
echo libhermac_s.a > LIST
|
||||
arch t libhermac_s.a >> LIST
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define getchar, putchar
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
|
||||
! These getchar and putchar routines can be used for HERMAC computer
|
||||
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
.define putchar,getchar
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
! output routine in monitor for the nascom
|
||||
CRT = 0x013B
|
||||
! output a charcter
|
||||
! entry: ascii character in a
|
||||
.text
|
||||
.sect .text
|
||||
putchar:
|
||||
push hl
|
||||
push bc
|
||||
|
@ -22,11 +27,11 @@ fetch: inc hl
|
|||
ld a,(hl)
|
||||
jr 2b
|
||||
! conversion table for nascom characters
|
||||
tab: .byte 0x0D,0x00
|
||||
.byte 0x1B,0x1E
|
||||
.byte 0x08,0x1D
|
||||
.byte 0x0A,0x1F
|
||||
.byte 0x7F,0x00
|
||||
tab: .data1 0x0D,0x00
|
||||
.data1 0x1B,0x1E
|
||||
.data1 0x08,0x1D
|
||||
.data1 0x0A,0x1F
|
||||
.data1 0x7F,0x00
|
||||
|
||||
KBD = 0x69
|
||||
get character from keyboard
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
.define EARRAY,ERANGE,EILLINS,EILLSIZE,ECASE,EMON,EHEAP
|
||||
.define hol0,trapproc,trpim,argv,hp,.reghp,envp,begbss,ignmask
|
||||
.define savebc,savede,savehl,saveix,saveaf,saveiy,ebadmon
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
EARRAY = 0
|
||||
ERANGE = 1
|
||||
EHEAP = 17
|
||||
|
@ -11,10 +16,9 @@
|
|||
ebadmon=25
|
||||
|
||||
|
||||
.base 0x1000
|
||||
.text
|
||||
.sect .text
|
||||
|
||||
! clear .bss
|
||||
! clear .sect .bss
|
||||
ld sp,0x7ffe !address of fbase
|
||||
ld de,endbss
|
||||
ld h,d
|
||||
|
@ -44,37 +48,37 @@
|
|||
|
||||
jp 0x20
|
||||
|
||||
.bss
|
||||
.sect .bss
|
||||
begbss:
|
||||
.data
|
||||
.sect .data
|
||||
hol0:
|
||||
.word 0,0
|
||||
.word 0,0
|
||||
.data2 0,0
|
||||
.data2 0,0
|
||||
saveaf:
|
||||
.word 0
|
||||
.data2 0
|
||||
savebc:
|
||||
.word 0
|
||||
.data2 0
|
||||
savede:
|
||||
.word 0
|
||||
.data2 0
|
||||
savehl:
|
||||
.word 0
|
||||
.data2 0
|
||||
saveix:
|
||||
.word 0
|
||||
.data2 0
|
||||
saveiy:
|
||||
.word 0
|
||||
.data2 0
|
||||
ignmask:
|
||||
.word 0
|
||||
.data2 0
|
||||
hp:
|
||||
.word 0
|
||||
.data2 0
|
||||
trapproc:
|
||||
.word 0
|
||||
.data2 0
|
||||
trpim:
|
||||
.word 0
|
||||
.data2 0
|
||||
argv:
|
||||
.word 3f
|
||||
.data2 3f
|
||||
envp:
|
||||
.word 0
|
||||
.data2 0
|
||||
3:
|
||||
.asciz 'PROGRAM'
|
||||
.reghp:
|
||||
.word endbss
|
||||
.data2 endbss
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
.define .mon
|
||||
.define uxfinish
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
|
||||
! monitor instruction
|
||||
! a small collection of UNIX system calls implemented under CP/M
|
||||
|
@ -98,21 +103,21 @@
|
|||
zcount=41
|
||||
zsave=42
|
||||
|
||||
.errnz filefcb
|
||||
.assert [ filefcb] <> 0
|
||||
|
||||
0: .space maxfiles*filesize
|
||||
filearea = 0b+128
|
||||
sibuf:
|
||||
.word 0
|
||||
.data2 0
|
||||
.space 82
|
||||
siptr: .space 2
|
||||
saveargs:
|
||||
.space 128
|
||||
argc: .space 2
|
||||
ttymode:.byte 9,9,8,21;.short 06310+RAW*040 ! raw = 040
|
||||
ttymode:.data1 9,9,8,21;.data2 06310+RAW*040 ! raw = 040
|
||||
|
||||
return:
|
||||
.word 0,0
|
||||
.data2 0,0
|
||||
uxinit:
|
||||
xor a
|
||||
ld c,maxfiles
|
||||
|
@ -155,70 +160,70 @@ uxfinish:
|
|||
jp (hl)
|
||||
|
||||
systab:
|
||||
.word e.mon ! ux_indir
|
||||
.word ux_exit
|
||||
.word e.mon ! ux_fork
|
||||
.word ux_read
|
||||
.word ux_write
|
||||
.word ux_open
|
||||
.word ux_close
|
||||
.word e.mon ! ux_wait
|
||||
.word ux_creat
|
||||
.word e.mon ! ux_link
|
||||
.word ux_unlink
|
||||
.word e.mon ! ux_exec
|
||||
.word e.mon ! ux_chdir
|
||||
.word ux_time
|
||||
.word e.mon ! ux_mknod
|
||||
.word e.mon ! ux_chmod
|
||||
.word e.mon ! ux_chown
|
||||
.word e.mon ! ux_break
|
||||
.word e.mon ! ux_stat
|
||||
.word e.mon ! ux_seek
|
||||
.word ux_getpid
|
||||
.word e.mon ! ux_mount
|
||||
.word e.mon ! ux_umount
|
||||
.word e.mon ! ux_setuid
|
||||
.word e.mon ! ux_getuid
|
||||
.word e.mon ! ux_stime
|
||||
.word e.mon ! ux_ptrace
|
||||
.word e.mon ! ux_alarm
|
||||
.word e.mon ! ux_fstat
|
||||
.word e.mon ! ux_pause
|
||||
.word e.mon ! ux_utime
|
||||
.word e.mon ! ux_stty
|
||||
.word e.mon ! ux_gtty
|
||||
.word e.mon ! ux_access
|
||||
.word e.mon ! ux_nice
|
||||
.word ux_ftime
|
||||
.word e.mon ! ux_sync
|
||||
.word e.mon ! ux_kill
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word e.mon ! ux_dup
|
||||
.word e.mon ! ux_pipe
|
||||
.word e.mon ! ux_times
|
||||
.word e.mon ! ux_prof
|
||||
.word e.mon ! ux_unused
|
||||
.word e.mon ! ux_setgid
|
||||
.word e.mon ! ux_getgid
|
||||
.word e.mon ! ux_sig
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word ux_ioctl
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld ! ux_exece
|
||||
.word e.mon ! ux_umask
|
||||
.word e.mon ! ux_chroot
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.data2 e.mon ! ux_indir
|
||||
.data2 ux_exit
|
||||
.data2 e.mon ! ux_fork
|
||||
.data2 ux_read
|
||||
.data2 ux_write
|
||||
.data2 ux_open
|
||||
.data2 ux_close
|
||||
.data2 e.mon ! ux_wait
|
||||
.data2 ux_creat
|
||||
.data2 e.mon ! ux_link
|
||||
.data2 ux_unlink
|
||||
.data2 e.mon ! ux_exec
|
||||
.data2 e.mon ! ux_chdir
|
||||
.data2 ux_time
|
||||
.data2 e.mon ! ux_mknod
|
||||
.data2 e.mon ! ux_chmod
|
||||
.data2 e.mon ! ux_chown
|
||||
.data2 e.mon ! ux_break
|
||||
.data2 e.mon ! ux_stat
|
||||
.data2 e.mon ! ux_seek
|
||||
.data2 ux_getpid
|
||||
.data2 e.mon ! ux_mount
|
||||
.data2 e.mon ! ux_umount
|
||||
.data2 e.mon ! ux_setuid
|
||||
.data2 e.mon ! ux_getuid
|
||||
.data2 e.mon ! ux_stime
|
||||
.data2 e.mon ! ux_ptrace
|
||||
.data2 e.mon ! ux_alarm
|
||||
.data2 e.mon ! ux_fstat
|
||||
.data2 e.mon ! ux_pause
|
||||
.data2 e.mon ! ux_utime
|
||||
.data2 e.mon ! ux_stty
|
||||
.data2 e.mon ! ux_gtty
|
||||
.data2 e.mon ! ux_access
|
||||
.data2 e.mon ! ux_nice
|
||||
.data2 ux_ftime
|
||||
.data2 e.mon ! ux_sync
|
||||
.data2 e.mon ! ux_kill
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 e.mon ! ux_dup
|
||||
.data2 e.mon ! ux_pipe
|
||||
.data2 e.mon ! ux_times
|
||||
.data2 e.mon ! ux_prof
|
||||
.data2 e.mon ! ux_unused
|
||||
.data2 e.mon ! ux_setgid
|
||||
.data2 e.mon ! ux_getgid
|
||||
.data2 e.mon ! ux_sig
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 ux_ioctl
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld ! ux_exece
|
||||
.data2 e.mon ! ux_umask
|
||||
.data2 e.mon ! ux_chroot
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
|
||||
emptyfile:
|
||||
! searches for a free filestructure
|
||||
|
@ -902,23 +907,23 @@ ux_getpid:
|
|||
|
||||
|
||||
|
||||
retarea: .word 0 ! base of buffer for result values (max 8 bytes)
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
retarea: .data2 0 ! base of buffer for result values (max 8 bytes)
|
||||
.data2 0
|
||||
.data2 0
|
||||
.data2 0
|
||||
|
||||
trapproc:
|
||||
.word 0
|
||||
.data2 0
|
||||
|
||||
nextp: .byte 0
|
||||
nextp: .data1 0
|
||||
|
||||
header:
|
||||
ntext: .word 0
|
||||
ndata: .word 0
|
||||
nproc: .word 0
|
||||
entry: .word 0
|
||||
nline: .word 0
|
||||
ntext: .data2 0
|
||||
ndata: .data2 0
|
||||
nproc: .data2 0
|
||||
entry: .data2 0
|
||||
nline: .data2 0
|
||||
|
||||
hp: .word 0
|
||||
pb: .word 0
|
||||
pd: .word 0
|
||||
hp: .data2 0
|
||||
pb: .data2 0
|
||||
pd: .data2 0
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define .mon
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
|
||||
! Monitor call
|
||||
! Expects on stack: monitor call number
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define putchr
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
! output routine in monitor
|
||||
CRT = 0x013B
|
||||
! output a charcter
|
||||
|
@ -21,8 +26,8 @@ fetch: inc hl
|
|||
ld a,(hl)
|
||||
jr 2b
|
||||
! conversion table for nascom characters
|
||||
tab: .byte 0x0D,0x00
|
||||
.byte 0x1B,0x1E
|
||||
.byte 0x08,0x1D
|
||||
.byte 0x0A,0x1F
|
||||
.byte 0x7F,0x00
|
||||
tab: .data1 0x0D,0x00
|
||||
.data1 0x1B,0x1E
|
||||
.data1 0x08,0x1D
|
||||
.data1 0x0A,0x1F
|
||||
.data1 0x7F,0x00
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define putchr
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
|
||||
putchr:
|
||||
push hl
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define _read,_write,_ioctl,_getpid,_open,_close,_exit,_errno
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
_read:
|
||||
ld (savebc),bc
|
||||
push af
|
||||
|
@ -149,14 +154,14 @@ _close:
|
|||
ret
|
||||
_exit:
|
||||
jp 0x38
|
||||
.data
|
||||
.sect .data
|
||||
_errno:
|
||||
.word 0
|
||||
.data2 0
|
||||
! output routine in monitor
|
||||
CRT = 0x013B
|
||||
! output a charcter
|
||||
! entry: ascii character in a
|
||||
.text
|
||||
.sect .text
|
||||
!putchr:
|
||||
! push hl
|
||||
! push bc
|
||||
|
@ -175,11 +180,11 @@ CRT = 0x013B
|
|||
! ld a,(hl)
|
||||
! jr 2b
|
||||
!! conversion table for nascom characters
|
||||
!tab: .byte 0x0D,0x00
|
||||
! .byte 0x1B,0x1E
|
||||
! .byte 0x08,0x1D
|
||||
! .byte 0x0A,0x1F
|
||||
! .byte 0x7F,0x00
|
||||
!tab: .data1 0x0D,0x00
|
||||
! .data1 0x1B,0x1E
|
||||
! .data1 0x08,0x1D
|
||||
! .data1 0x0A,0x1F
|
||||
! .data1 0x7F,0x00
|
||||
|
||||
KBD = 0x69
|
||||
! get character from keyboard
|
||||
|
|
|
@ -1,25 +1,44 @@
|
|||
TAIL=tail.hermac
|
||||
TAIL=libhermac_o.a
|
||||
# Other possibilities are: tail.nascom and tail.cpm
|
||||
MACH=z80
|
||||
|
||||
all: tail.cpm tail.nascom tail.hermac
|
||||
all: head_em.o libhermac_o.a libnascom_o.a libcpm_o.a
|
||||
|
||||
install: $(TAIL)
|
||||
../../install head_em.s head_em
|
||||
../../install $(TAIL) tail_sys
|
||||
install: head_em.o $(TAIL)
|
||||
../../install head_em.o head_em
|
||||
../../install $(TAIL) tail_mon
|
||||
|
||||
cmp: $(TAIL)
|
||||
-../../compare head_em.s head_em
|
||||
-../../compare $(TAIL) tail_sys
|
||||
cmp: head_em.o $(TAIL)
|
||||
-../../compare head_em.o head_em
|
||||
-../../compare $(TAIL) tail_mon
|
||||
|
||||
tail.cpm: mon.cpm.s
|
||||
head_em.o: head_em.s
|
||||
$(MACH) -I../../../h -c head_em.s
|
||||
|
||||
libcpm_o.a: libcpm_s.a
|
||||
ASAR=aal ; export ASAR; march . libcpm_o.a
|
||||
|
||||
libnascom_o.a: libnascom_s.a
|
||||
ASAR=aal ; export ASAR; march . libnascom_o.a
|
||||
|
||||
libhermac_o.a: libhermac_s.a
|
||||
ASAR=aal ; export ASAR; march . libhermac_o.a
|
||||
|
||||
libcpm_s.a:
|
||||
@echo Warning: untested, this is an example
|
||||
arch cr tail.cpm mon.cpm.s
|
||||
arch cr libcpm_s.a mon.cpm.s
|
||||
echo libcpm_s.a > LIST
|
||||
arch t libcpm_s.a >> LIST
|
||||
|
||||
tail.nascom: mon.s char.nas.s
|
||||
arch cr tail.nascom mon.s char.nas.s
|
||||
libnascom_s.a:
|
||||
arch cr libnascom_s.a mon.s char.nas.s
|
||||
echo libnascom_s.a > LIST
|
||||
arch t libnascom_s.a >> LIST
|
||||
|
||||
tail.hermac: mon.s char.her.s
|
||||
arch cr tail.hermac mon.s char.her.s
|
||||
libhermac_s.a:
|
||||
arch cr libhermac_s.a mon.s char.her.s
|
||||
echo libhermac_s.a > LIST
|
||||
arch t libhermac_s.a >> LIST
|
||||
|
||||
opr:
|
||||
make pr | opr
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define getchar, putchar
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
|
||||
! These getchar and putchar routines can be used for HERMAC computer
|
||||
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
.define putchar,getchar
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
! output routine in monitor for the nascom
|
||||
CRT = 0x013B
|
||||
! output a charcter
|
||||
! entry: ascii character in a
|
||||
.text
|
||||
.sect .text
|
||||
putchar:
|
||||
push hl
|
||||
push bc
|
||||
|
@ -22,11 +27,11 @@ fetch: inc hl
|
|||
ld a,(hl)
|
||||
jr 2b
|
||||
! conversion table for nascom characters
|
||||
tab: .byte 0x0D,0x00
|
||||
.byte 0x1B,0x1E
|
||||
.byte 0x08,0x1D
|
||||
.byte 0x0A,0x1F
|
||||
.byte 0x7F,0x00
|
||||
tab: .data1 0x0D,0x00
|
||||
.data1 0x1B,0x1E
|
||||
.data1 0x08,0x1D
|
||||
.data1 0x0A,0x1F
|
||||
.data1 0x7F,0x00
|
||||
|
||||
KBD = 0x69
|
||||
get character from keyboard
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
.define EARRAY,ERANGE,EILLINS,EILLSIZE,ECASE,EMON,EHEAP
|
||||
.define hol0,trapproc,trpim,argv,hp,.reghp,envp,begbss,ignmask
|
||||
.define savebc,savede,savehl,saveix,saveaf,saveiy,ebadmon
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
EARRAY = 0
|
||||
ERANGE = 1
|
||||
EHEAP = 17
|
||||
|
@ -11,10 +16,9 @@
|
|||
ebadmon=25
|
||||
|
||||
|
||||
.base 0x1000
|
||||
.text
|
||||
.sect .text
|
||||
|
||||
! clear .bss
|
||||
! clear .sect .bss
|
||||
ld sp,0x7ffe !address of fbase
|
||||
ld de,endbss
|
||||
ld h,d
|
||||
|
@ -44,37 +48,37 @@
|
|||
|
||||
jp 0x20
|
||||
|
||||
.bss
|
||||
.sect .bss
|
||||
begbss:
|
||||
.data
|
||||
.sect .data
|
||||
hol0:
|
||||
.word 0,0
|
||||
.word 0,0
|
||||
.data2 0,0
|
||||
.data2 0,0
|
||||
saveaf:
|
||||
.word 0
|
||||
.data2 0
|
||||
savebc:
|
||||
.word 0
|
||||
.data2 0
|
||||
savede:
|
||||
.word 0
|
||||
.data2 0
|
||||
savehl:
|
||||
.word 0
|
||||
.data2 0
|
||||
saveix:
|
||||
.word 0
|
||||
.data2 0
|
||||
saveiy:
|
||||
.word 0
|
||||
.data2 0
|
||||
ignmask:
|
||||
.word 0
|
||||
.data2 0
|
||||
hp:
|
||||
.word 0
|
||||
.data2 0
|
||||
trapproc:
|
||||
.word 0
|
||||
.data2 0
|
||||
trpim:
|
||||
.word 0
|
||||
.data2 0
|
||||
argv:
|
||||
.word 3f
|
||||
.data2 3f
|
||||
envp:
|
||||
.word 0
|
||||
.data2 0
|
||||
3:
|
||||
.asciz 'PROGRAM'
|
||||
.reghp:
|
||||
.word endbss
|
||||
.data2 endbss
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
.define .mon
|
||||
.define uxfinish
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
|
||||
! monitor instruction
|
||||
! a small collection of UNIX system calls implemented under CP/M
|
||||
|
@ -98,21 +103,21 @@
|
|||
zcount=41
|
||||
zsave=42
|
||||
|
||||
.errnz filefcb
|
||||
.assert [ filefcb] <> 0
|
||||
|
||||
0: .space maxfiles*filesize
|
||||
filearea = 0b+128
|
||||
sibuf:
|
||||
.word 0
|
||||
.data2 0
|
||||
.space 82
|
||||
siptr: .space 2
|
||||
saveargs:
|
||||
.space 128
|
||||
argc: .space 2
|
||||
ttymode:.byte 9,9,8,21;.short 06310+RAW*040 ! raw = 040
|
||||
ttymode:.data1 9,9,8,21;.data2 06310+RAW*040 ! raw = 040
|
||||
|
||||
return:
|
||||
.word 0,0
|
||||
.data2 0,0
|
||||
uxinit:
|
||||
xor a
|
||||
ld c,maxfiles
|
||||
|
@ -155,70 +160,70 @@ uxfinish:
|
|||
jp (hl)
|
||||
|
||||
systab:
|
||||
.word e.mon ! ux_indir
|
||||
.word ux_exit
|
||||
.word e.mon ! ux_fork
|
||||
.word ux_read
|
||||
.word ux_write
|
||||
.word ux_open
|
||||
.word ux_close
|
||||
.word e.mon ! ux_wait
|
||||
.word ux_creat
|
||||
.word e.mon ! ux_link
|
||||
.word ux_unlink
|
||||
.word e.mon ! ux_exec
|
||||
.word e.mon ! ux_chdir
|
||||
.word ux_time
|
||||
.word e.mon ! ux_mknod
|
||||
.word e.mon ! ux_chmod
|
||||
.word e.mon ! ux_chown
|
||||
.word e.mon ! ux_break
|
||||
.word e.mon ! ux_stat
|
||||
.word e.mon ! ux_seek
|
||||
.word ux_getpid
|
||||
.word e.mon ! ux_mount
|
||||
.word e.mon ! ux_umount
|
||||
.word e.mon ! ux_setuid
|
||||
.word e.mon ! ux_getuid
|
||||
.word e.mon ! ux_stime
|
||||
.word e.mon ! ux_ptrace
|
||||
.word e.mon ! ux_alarm
|
||||
.word e.mon ! ux_fstat
|
||||
.word e.mon ! ux_pause
|
||||
.word e.mon ! ux_utime
|
||||
.word e.mon ! ux_stty
|
||||
.word e.mon ! ux_gtty
|
||||
.word e.mon ! ux_access
|
||||
.word e.mon ! ux_nice
|
||||
.word ux_ftime
|
||||
.word e.mon ! ux_sync
|
||||
.word e.mon ! ux_kill
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word e.mon ! ux_dup
|
||||
.word e.mon ! ux_pipe
|
||||
.word e.mon ! ux_times
|
||||
.word e.mon ! ux_prof
|
||||
.word e.mon ! ux_unused
|
||||
.word e.mon ! ux_setgid
|
||||
.word e.mon ! ux_getgid
|
||||
.word e.mon ! ux_sig
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word ux_ioctl
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.word unimpld ! ux_exece
|
||||
.word e.mon ! ux_umask
|
||||
.word e.mon ! ux_chroot
|
||||
.word unimpld
|
||||
.word unimpld
|
||||
.data2 e.mon ! ux_indir
|
||||
.data2 ux_exit
|
||||
.data2 e.mon ! ux_fork
|
||||
.data2 ux_read
|
||||
.data2 ux_write
|
||||
.data2 ux_open
|
||||
.data2 ux_close
|
||||
.data2 e.mon ! ux_wait
|
||||
.data2 ux_creat
|
||||
.data2 e.mon ! ux_link
|
||||
.data2 ux_unlink
|
||||
.data2 e.mon ! ux_exec
|
||||
.data2 e.mon ! ux_chdir
|
||||
.data2 ux_time
|
||||
.data2 e.mon ! ux_mknod
|
||||
.data2 e.mon ! ux_chmod
|
||||
.data2 e.mon ! ux_chown
|
||||
.data2 e.mon ! ux_break
|
||||
.data2 e.mon ! ux_stat
|
||||
.data2 e.mon ! ux_seek
|
||||
.data2 ux_getpid
|
||||
.data2 e.mon ! ux_mount
|
||||
.data2 e.mon ! ux_umount
|
||||
.data2 e.mon ! ux_setuid
|
||||
.data2 e.mon ! ux_getuid
|
||||
.data2 e.mon ! ux_stime
|
||||
.data2 e.mon ! ux_ptrace
|
||||
.data2 e.mon ! ux_alarm
|
||||
.data2 e.mon ! ux_fstat
|
||||
.data2 e.mon ! ux_pause
|
||||
.data2 e.mon ! ux_utime
|
||||
.data2 e.mon ! ux_stty
|
||||
.data2 e.mon ! ux_gtty
|
||||
.data2 e.mon ! ux_access
|
||||
.data2 e.mon ! ux_nice
|
||||
.data2 ux_ftime
|
||||
.data2 e.mon ! ux_sync
|
||||
.data2 e.mon ! ux_kill
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 e.mon ! ux_dup
|
||||
.data2 e.mon ! ux_pipe
|
||||
.data2 e.mon ! ux_times
|
||||
.data2 e.mon ! ux_prof
|
||||
.data2 e.mon ! ux_unused
|
||||
.data2 e.mon ! ux_setgid
|
||||
.data2 e.mon ! ux_getgid
|
||||
.data2 e.mon ! ux_sig
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 ux_ioctl
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
.data2 unimpld ! ux_exece
|
||||
.data2 e.mon ! ux_umask
|
||||
.data2 e.mon ! ux_chroot
|
||||
.data2 unimpld
|
||||
.data2 unimpld
|
||||
|
||||
emptyfile:
|
||||
! searches for a free filestructure
|
||||
|
@ -902,23 +907,23 @@ ux_getpid:
|
|||
|
||||
|
||||
|
||||
retarea: .word 0 ! base of buffer for result values (max 8 bytes)
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
retarea: .data2 0 ! base of buffer for result values (max 8 bytes)
|
||||
.data2 0
|
||||
.data2 0
|
||||
.data2 0
|
||||
|
||||
trapproc:
|
||||
.word 0
|
||||
.data2 0
|
||||
|
||||
nextp: .byte 0
|
||||
nextp: .data1 0
|
||||
|
||||
header:
|
||||
ntext: .word 0
|
||||
ndata: .word 0
|
||||
nproc: .word 0
|
||||
entry: .word 0
|
||||
nline: .word 0
|
||||
ntext: .data2 0
|
||||
ndata: .data2 0
|
||||
nproc: .data2 0
|
||||
entry: .data2 0
|
||||
nline: .data2 0
|
||||
|
||||
hp: .word 0
|
||||
pb: .word 0
|
||||
pd: .word 0
|
||||
hp: .data2 0
|
||||
pb: .data2 0
|
||||
pd: .data2 0
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define .mon
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
|
||||
! Monitor call
|
||||
! Expects on stack: monitor call number
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define putchr
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
! output routine in monitor
|
||||
CRT = 0x013B
|
||||
! output a charcter
|
||||
|
@ -21,8 +26,8 @@ fetch: inc hl
|
|||
ld a,(hl)
|
||||
jr 2b
|
||||
! conversion table for nascom characters
|
||||
tab: .byte 0x0D,0x00
|
||||
.byte 0x1B,0x1E
|
||||
.byte 0x08,0x1D
|
||||
.byte 0x0A,0x1F
|
||||
.byte 0x7F,0x00
|
||||
tab: .data1 0x0D,0x00
|
||||
.data1 0x1B,0x1E
|
||||
.data1 0x08,0x1D
|
||||
.data1 0x0A,0x1F
|
||||
.data1 0x7F,0x00
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define putchr
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
|
||||
putchr:
|
||||
push hl
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
.define _read,_write,_ioctl,_getpid,_open,_close,_exit,_errno
|
||||
.sect .text
|
||||
.sect .rom
|
||||
.sect .data
|
||||
.sect .bss
|
||||
.sect .text
|
||||
_read:
|
||||
ld (savebc),bc
|
||||
push af
|
||||
|
@ -149,14 +154,14 @@ _close:
|
|||
ret
|
||||
_exit:
|
||||
jp 0x38
|
||||
.data
|
||||
.sect .data
|
||||
_errno:
|
||||
.word 0
|
||||
.data2 0
|
||||
! output routine in monitor
|
||||
CRT = 0x013B
|
||||
! output a charcter
|
||||
! entry: ascii character in a
|
||||
.text
|
||||
.sect .text
|
||||
!putchr:
|
||||
! push hl
|
||||
! push bc
|
||||
|
@ -175,11 +180,11 @@ CRT = 0x013B
|
|||
! ld a,(hl)
|
||||
! jr 2b
|
||||
!! conversion table for nascom characters
|
||||
!tab: .byte 0x0D,0x00
|
||||
! .byte 0x1B,0x1E
|
||||
! .byte 0x08,0x1D
|
||||
! .byte 0x0A,0x1F
|
||||
! .byte 0x7F,0x00
|
||||
!tab: .data1 0x0D,0x00
|
||||
! .data1 0x1B,0x1E
|
||||
! .data1 0x08,0x1D
|
||||
! .data1 0x0A,0x1F
|
||||
! .data1 0x7F,0x00
|
||||
|
||||
KBD = 0x69
|
||||
! get character from keyboard
|
||||
|
|
Loading…
Reference in a new issue