A2osX/BIN/WHO.S.txt

122 lines
2.5 KiB
Plaintext
Raw Normal View History

2019-04-15 05:40:13 +00:00
NEW
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/WHO
*--------------------------------------
.INB INC/MACROS.I
.INB INC/MLI.I
.INB INC/A2OSX.I
.INB INC/KERNEL.I
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
USRID .BS 1
2019-04-26 15:07:22 +00:00
ZPSessionPtr .BS 2
2019-04-15 05:40:13 +00:00
ZS.END
.ED
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA 0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*--------------------------------------
* Relocation Table
2019-10-03 06:25:27 +00:00
*--------------------------------------
2019-04-15 05:40:13 +00:00
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.EVENT
.DA CS.QUIT
L.MSG0 .DA MSG0
L.MSG1 .DA MSG1
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
CS.RUN >LDYA L.MSG0
>SYSCALL puts
ldx #1
stx USRID
2019-04-17 06:22:23 +00:00
.1 lda S.Table.hSession-1,x
2019-04-15 05:40:13 +00:00
beq .7
2019-04-16 15:54:56 +00:00
lda S.Table.hFile-1,x
2019-04-15 05:40:13 +00:00
tax
2019-04-15 15:29:07 +00:00
jsr CS.RUN.GETIO
2019-04-15 05:40:13 +00:00
>PUSHYA
ldx USRID
2019-04-17 06:22:23 +00:00
lda S.Table.hSession-1,x
2019-04-15 05:40:13 +00:00
>SYSCALL GetMemPtr
2019-04-26 15:07:22 +00:00
>STYA ZPSessionPtr
lda ZPSessionPtr
2019-04-15 05:40:13 +00:00
clc
2019-04-16 15:54:56 +00:00
adc #S.SESSION.NAME
2019-04-15 05:40:13 +00:00
tay
2019-04-26 15:07:22 +00:00
lda ZPSessionPtr+1
2019-04-16 15:54:56 +00:00
adc /S.SESSION.NAME
2019-04-15 05:40:13 +00:00
>PUSHYA
2019-04-26 15:07:22 +00:00
>PUSHB (ZPSessionPtr)
2019-04-16 15:54:56 +00:00
ldy #S.SESSION.UID
2019-04-26 15:07:22 +00:00
>PUSHB (ZPSessionPtr),y
2019-04-15 05:40:13 +00:00
>PUSHB USRID
2019-04-15 15:29:07 +00:00
>PUSHBI 7
2019-04-15 05:40:13 +00:00
>LDYA L.MSG1
>SYSCALL printf
.7 inc USRID
ldx USRID
cpx #K.USR.MAX+1
bne .1
.8 lda #0 tell TSKMGR that all done ok, but
sec we do not want to stay in memory
.9 rts
*--------------------------------------
2019-04-15 15:29:07 +00:00
CS.RUN.GETIO lda OF.Table.hPath-1,x
bne .1
lda OF.Table.hFD-1,x
tax
lda Dev.Table-1,x
clc
adc #S.FD.DEV
tay
lda Dev.Table,x
adc /S.FD.DEV
rts
.1 >SYSCALL GetMemPtr
rts
*--------------------------------------
2019-04-15 05:40:13 +00:00
CS.EVENT sec
rts
*--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
CS.END
2019-04-16 15:54:56 +00:00
MSG0 .AZ "SID UID Privileges Name Dev"
2019-04-15 15:29:07 +00:00
MSG1 .AZ "%3d %3d %b %16s %16s\r\n"
2019-04-15 05:40:13 +00:00
*--------------------------------------
.DUMMY
.OR 0
DS.START
DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/WHO.S
ASM