*** empty log message ***
This commit is contained in:
parent
80e349860b
commit
c5508c7c0b
1 changed files with 32 additions and 1 deletions
|
@ -7,6 +7,9 @@
|
||||||
! number 1: exit
|
! number 1: exit
|
||||||
! number 3: read
|
! number 3: read
|
||||||
! number 4: write
|
! number 4: write
|
||||||
|
! number 5: open
|
||||||
|
! number 6: close
|
||||||
|
! number 54: ioctl
|
||||||
! If called with a number of a call that is not implemented,
|
! If called with a number of a call that is not implemented,
|
||||||
! a trap is generated.
|
! a trap is generated.
|
||||||
|
|
||||||
|
@ -24,10 +27,16 @@
|
||||||
jz monread ! is it a read?
|
jz monread ! is it a read?
|
||||||
cpi 4
|
cpi 4
|
||||||
jz monwrite ! is it a write?
|
jz monwrite ! is it a write?
|
||||||
|
cpi 5
|
||||||
|
jz monopen ! is it an open?
|
||||||
|
cpi 6
|
||||||
|
jz monclose ! is it a close?
|
||||||
|
cpi 54
|
||||||
|
jz monioctl
|
||||||
jmp ebadmon ! trap
|
jmp ebadmon ! trap
|
||||||
|
|
||||||
monexit:
|
monexit:
|
||||||
rst 4
|
jmp .stop
|
||||||
|
|
||||||
monread:
|
monread:
|
||||||
pop h ! file-descriptor, not used
|
pop h ! file-descriptor, not used
|
||||||
|
@ -69,6 +78,28 @@ monwrite:
|
||||||
2: push d ! no error
|
2: push d ! no error
|
||||||
jmp monret
|
jmp monret
|
||||||
|
|
||||||
|
|
||||||
|
monopen:
|
||||||
|
pop h ! pointer to string
|
||||||
|
pop h ! flag
|
||||||
|
lxi h,-1
|
||||||
|
push h ! push file descriptor
|
||||||
|
push h ! push error code twice
|
||||||
|
push h
|
||||||
|
jmp monret
|
||||||
|
|
||||||
|
monclose:
|
||||||
|
lxi h,0
|
||||||
|
xthl ! remove file descriptor and push error code
|
||||||
|
jmp monret
|
||||||
|
|
||||||
|
monioctl:
|
||||||
|
pop h ! file descriptor
|
||||||
|
pop h ! request
|
||||||
|
lxi h,0
|
||||||
|
xthl ! remove argp and push error code
|
||||||
|
jmp monret
|
||||||
|
|
||||||
monret:
|
monret:
|
||||||
lhld .bcreg
|
lhld .bcreg
|
||||||
mov b,h
|
mov b,h
|
||||||
|
|
Loading…
Add table
Reference in a new issue