home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
DRIVERS
/
SRC
/
ptys.lzh
/
miscasm.a
< prev
next >
Wrap
Text File
|
1990-03-08
|
4KB
|
172 lines
* This software is copyright (C) 1989 by Reimer Mellin *
* *
* Permission is granted to reproduce and distribute *
* this package by any means so long as no fee is charged *
* above a nominal handling fee and so long as this *
* notice is always included in the copies. *
* Commerical use or incorporation into commercial software *
* is prohibited without the written permission of the *
* author. *
* *
* Other rights are reserved except as explicitly granted *
* by written permission of the author. *
* Reimer Mellin *
* *
* Sulenstr.8 *
* D-8000 Muenchen 71 (Federal Republic of Germany) *
* *
* EMAIL: *
* mellin@lan.informatik.tu-muenchen.dbp.de *
* ram@altger.UUCP *
* ....!pyramid!tmpmbx!doitcr!ramsys!ram (home) *
* *
*
* $Id: miscasm.a_v 1.2.1.1 89/09/04 13:13:33 ram Exp $
*
* $Log: miscasm.a_v $
* Revision 1.2.1.1 89/09/04 13:13:33 ram
* added some comments
*
* Revision 1.2 89/08/31 12:32:39 ram
* copyright message added
*
*
use <iodev.a>
use ptydev.a
use defsfile
psect miscasm,0,0,0,0,0
* Hilfs-Funktionen fuer Ptyman, da malloc() nicht verwendet werden kann
*
* _srqmem( size )
_srqmem:
move.l a2,-(sp)
OS9 F$SRqMem
bcc.s _srqmem90
move.l d1,errno(a6)
move.l (sp)+,a2
moveq.l #0,d0
rts
_srqmem90
move.l a2,d0
move.l (sp)+,a2
rts
* _srtmem(addr, size)
_srtmem:
move.l a2,-(sp)
move.l d0,a2
move.l d1,d0
OS9 F$SRtMem
bcc.s _srtmem90
move.l d1,errno(a6)
move.l (sp)+,a2
moveq.l #-1,d0
rts
_srtmem90
move.l (sp)+,a2
moveq.l #0,d0
rts
* wait for pid to finish I/O ( 0 --> free )
iowait:
tst.w d0
beq.s io1
clr.l d1
os9 F$IOQu
move.l d1,d0
io1
rts
* getctrlchar(ch) -- return control-char-index in d0
getctrlchar:
tst.b d0
beq.s g1
cmp.b #32,d0
bge.s g1
lea PD_BSP(a6),a0 * start of ctl-char array
moveq.l #8,d1 * length
g2
cmp.b (a0)+,d0
beq.s g3
dbra d1,g2
g1
clr.l d0
rts
g3
neg d1 * compute index
add.w #9,d1
move.w d1,d0
rts
strcmp:
movea.l d0,a1 * simple strcmp
movea.l d1,a0
moveq.l #0,d0 :2
move.l d0,d1
bra.s _6
_4 tst.b (a1) :2
beq.s _3
_9
_7
_6 cmpm.b (a0)+,(a1)+ :2
beq.s _4
_5
subq.l #1,a0
subq.l #1,a1
move.b (a0),d0 :2
move.b (a1),d1 :2
sub.l d0,d1 :2
move.l d1,d0 :2
_3 rts :2
memcpy:
move.l d0,a1 * simple memcpy
move.l d1,a0
move.l 4(a7),d0
m1
move.b (a0)+,(a1)+
dbra d0,m1
rts
* initbuf
initbuf:
move.l d0,a0 * dont change this Function !!!!!
lea in2(pc),a1
in1
move.b (a1)+,d0
not.b d0
cmpi.b #$d,d0
beq.s in3
move.b d0,(a0)+
dbra d1,in1
in3
move.b d0,(a0)+
dbra d1,in3
rts
in2
dc.b ^' ',^'b',^'y',^' ',^'R',^'e',^'i',^'m' * dont change !!
dc.b ^'e',^'r',^' ',^'A',^'.',^' ',^'M',^'e'
dc.b ^'l',^'l',^'i',^'n',^$d
align
kill:
tst.w d0
beq.s k1
os9 F$Send
k1
rts
ends