C言語でスーパーバイザCALL 全リスト(Z-80 Assembler & BDS-C)
|
|
by OOI(大井 暢浩)
|
|
|
|
|
|
|
********* SVCREF.SCM ********* |
|
|
;-------------------------------------------------
; call by reference
; for bds c by (c)OOI 1986.11.01
;-------------------------------------------------
|
FUNCTION SVCREF |
|
|
|
|
LABEL1:
LABEL2:
SVC:
SVCNO:
ENDFUNC
|
PUSH
LD
ADD
LD
LD
LD
LD
LD
LD
LD
LD
LD
INC
LD
LD
LD
LD
INC
LD
EX
LD
LD
LD
INC
LD
LD
EXX
LD
LD
LD
CP
JR
SCF
JR
OR
EXX
EX
DB
DB
DB
DB
LD
ADD
PUSH
EXX
LD
LD
PUSH
POP
LD
EXX
LD
LD
LD
LD
LD
LD
INC
LD
LD
LD
LD
INC
LD
LD
LD
POP
LD
INC
LD
POP
RET
|
BC
IX,0
IX,SP
A,(IX+4)
HL,SVCNO
(HL),A
L,(IX+6)
H,(IX+7)
A,(HL)
L,(IX+8)
H,(IX+9)
C,(HL)
HL
B,(HL)
L,(IX+10)
H,(IX+11)
E,(HL)
HL
D,(HL)
AF,AF'
L,(IX+12)
H,(IX+13)
A,(HL)
HL
H,(HL)
L,A
L,(IX+14)
H,(IX+15)
A,(HL)
0
Z,LABEL1
LABEL2
A
AF,AF'
0CDH
57H
0E1H
0H
IX,0
IX,SP
HL
L,(IX+14)
H,(IX+15)
AF
BC
(HL),C
L,(IX+6)
H,(IX+7)
(HL),A
L,(IX+8)
H,(IX+9)
(HL),C
HL
(HL),B
L,(IX+10)
H,(IX+11)
(HL),E
HL
(HL),D
L,(IX+12)
H,(IX+13)
DE
(HL),E
HL
(HL),D
BC
|
;
; 0 bc
; 2 return adr.
; 4 SVC No.
; 6 acc reg. adr.
; 8 bc reg. adr.
;10 de reg. adr.
;12 hl reg. adr.
;14 cy flag adr.
|
|
|
|
|
END |
|
|
|
|
|
|
|
|
|
|
|
|
|
********* LINPUT.C ********* |
|
|
/*************************
lineinput for cp/m
**************************/
/* This program must call with 80 byte buffer. */
main()
{
char buff[80];
linput(buff);
printf("%s\n",buff);
}
linput(buff)
char *buff[];
{
char acc;
int hl, /* trans source adr. */
de, /* trans destination adr. */
bc, /* length */
cy;
svcref(0x0c, &acc, &bc, &de, &hl, &cy);
bc = 80;
hl = 0x0a01;
de = buff;
call(0xe100 + 34 * 3, acc, hl, bc, de);
}
|
|
|
|
|
|
|