2016-08-17 06:25:58 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-03-15 16:44:15 +00:00
|
|
|
|
LOMEM $A00
|
2016-08-17 06:25:58 +00:00
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
2016-10-31 21:38:53 +00:00
|
|
|
|
*/--------------------------------------
|
2017-10-19 06:19:54 +00:00
|
|
|
|
* # ExecPSNewEnv.YA
|
|
|
|
|
* # ExecPS.YA (Blocking Parent PID)
|
|
|
|
|
* # CreatePSNewEnv.YA
|
|
|
|
|
* # CreatePS.YA (Non Blocking)
|
2017-08-30 15:26:34 +00:00
|
|
|
|
* ## In:
|
|
|
|
|
* Y,A = PTR To Cmd Line
|
|
|
|
|
* ## Out:
|
|
|
|
|
* A = Child PSID
|
|
|
|
|
*\--------------------------------------
|
2017-10-19 06:19:54 +00:00
|
|
|
|
K.ExecPSNewEnv.YA
|
2017-10-06 15:25:14 +00:00
|
|
|
|
ldx #S.PS.F.DUPENV+S.PS.F.HOLD
|
2017-08-30 15:26:34 +00:00
|
|
|
|
.HS 2C bit abs
|
2017-10-19 06:19:54 +00:00
|
|
|
|
K.ExecPS.YA
|
2017-08-30 15:26:34 +00:00
|
|
|
|
ldx #S.PS.F.HOLD
|
|
|
|
|
.HS 2C bit abs
|
2017-10-19 06:19:54 +00:00
|
|
|
|
K.CreatePSNewEnv.YA
|
2017-10-06 15:25:14 +00:00
|
|
|
|
ldx #S.PS.F.DUPENV
|
2017-08-30 15:26:34 +00:00
|
|
|
|
.HS 2C bit abs
|
2017-10-19 06:19:54 +00:00
|
|
|
|
K.CreatePS.YA
|
2017-08-30 15:26:34 +00:00
|
|
|
|
ldx #0
|
2017-10-27 14:56:46 +00:00
|
|
|
|
stx PS.Flags
|
|
|
|
|
>STYA PS.CL
|
2017-08-30 15:26:34 +00:00
|
|
|
|
|
2017-08-31 15:35:15 +00:00
|
|
|
|
jsr PS.CreateChild Child S.PS at ZPPtr3
|
2017-08-30 15:26:34 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
sta .8+1
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>LDYA PS.CL
|
2017-08-31 15:35:15 +00:00
|
|
|
|
jsr PS.CmdLine2Args Y,A = Args[0]
|
2017-08-30 15:26:34 +00:00
|
|
|
|
bcs .9
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-08-30 15:26:34 +00:00
|
|
|
|
jsr PS.Init
|
|
|
|
|
bcc .8
|
|
|
|
|
|
|
|
|
|
pha save error code
|
|
|
|
|
lda .8+1
|
2017-09-08 14:49:23 +00:00
|
|
|
|
jsr CORE.PSFree.A
|
2017-08-30 15:26:34 +00:00
|
|
|
|
pla get back error code
|
|
|
|
|
sec
|
|
|
|
|
rts
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-08-30 15:26:34 +00:00
|
|
|
|
.8 lda #$ff self modified
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
PS.Flags .BS 1
|
|
|
|
|
PS.CL .BS 2
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
* PS.CreateChild
|
2016-08-17 06:25:58 +00:00
|
|
|
|
* in :
|
|
|
|
|
* out :
|
|
|
|
|
* A = PSID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
* we cannot use ZPPtrs1 & 2
|
2017-09-19 15:34:01 +00:00
|
|
|
|
* because of calling K.NewStr.YA & S.DupEnv.A
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-19 15:34:01 +00:00
|
|
|
|
PS.CreateChild ldx #0
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.1 cpx CORE.PSCount
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
lda PS.Table.PID,x
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .31 Found an empty slot
|
2017-09-19 15:34:01 +00:00
|
|
|
|
inx
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bra .1
|
|
|
|
|
|
|
|
|
|
.2 cpx #K.PS.MAX
|
2016-08-18 15:26:11 +00:00
|
|
|
|
bne .3
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
lda #K.E.OOH
|
2016-08-17 06:25:58 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2017-10-09 05:51:32 +00:00
|
|
|
|
.99 plx
|
|
|
|
|
rts
|
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.3 inc CORE.PSCount
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.31 phx save PS inex
|
2017-09-19 15:34:01 +00:00
|
|
|
|
|
|
|
|
|
.4 inc CORE.LastPSID Get a PSID not alredy running
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .4 not = 0
|
2017-09-19 15:34:01 +00:00
|
|
|
|
lda CORE.LastPSID
|
2017-09-08 14:49:23 +00:00
|
|
|
|
jsr CORE.GetPSByID.A
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcc .4
|
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
plx
|
|
|
|
|
lda CORE.LastPSID
|
|
|
|
|
sta PS.Table.PID,x
|
|
|
|
|
phx
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
>LDYAI S.PS
|
|
|
|
|
jsr K.GetMem0.YA Blank Everything in this S.PS
|
|
|
|
|
bcs .99
|
2016-08-18 15:26:11 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
>STYA ZPPtr3
|
|
|
|
|
txa
|
|
|
|
|
plx
|
|
|
|
|
sta PS.Table.hMem,x
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr PS.SetMemOwner Set Ownership
|
2017-10-09 05:51:32 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
ldy #S.PS.PID
|
|
|
|
|
lda CORE.LastPSID
|
|
|
|
|
sta (ZPPtr3),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-10-06 15:25:14 +00:00
|
|
|
|
lda #S.PS.F.DUPENV
|
2017-10-27 14:56:46 +00:00
|
|
|
|
bit PS.Flags need to create ENV & Prefix ?
|
2016-08-18 15:26:11 +00:00
|
|
|
|
beq .6 no...
|
|
|
|
|
|
2017-10-09 05:51:32 +00:00
|
|
|
|
sta (ZPPtr3) Mark this PS with DUPENV flag
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX copy hPREFIX...
|
|
|
|
|
lda (pPs),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMemPtr.A
|
2017-09-08 14:49:23 +00:00
|
|
|
|
jsr K.NewStr.YA
|
2016-08-18 15:26:11 +00:00
|
|
|
|
bcs .9
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr PS.SetMemOwner Set Ownership
|
2017-10-06 15:25:14 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hPREFIX
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.hENV ...and hENV from parent PS
|
|
|
|
|
lda (pPs),y
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr PS.DupEnv.A
|
2016-08-18 15:26:11 +00:00
|
|
|
|
bcs .9
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.hENV
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.6 ldy #S.PS.hPREFIX reuse same hPREFIX...
|
|
|
|
|
lda (pPs),y
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.hENV ...and hENV from parent PS
|
|
|
|
|
lda (pPs),y
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.8 ldy #S.PS.hStdIn
|
2016-08-18 15:26:11 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.81 lda (pPs),y
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
iny
|
2017-01-12 17:43:45 +00:00
|
|
|
|
cpy #S.PS.hStdErr+1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bne .81
|
|
|
|
|
|
2016-10-29 19:58:21 +00:00
|
|
|
|
ldy #S.PS.PID
|
2016-08-17 06:25:58 +00:00
|
|
|
|
lda (pPs),y
|
|
|
|
|
|
2016-10-29 19:58:21 +00:00
|
|
|
|
ldy #S.PS.PPID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y
|
2016-08-18 15:26:11 +00:00
|
|
|
|
|
|
|
|
|
lda #S.PS.F.HOLD
|
2017-10-27 14:56:46 +00:00
|
|
|
|
bit PS.Flags
|
2016-08-18 15:26:11 +00:00
|
|
|
|
beq .82
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2016-08-18 15:26:11 +00:00
|
|
|
|
ora (pPs)
|
2017-10-19 06:19:54 +00:00
|
|
|
|
sta (pPs) HOLD parent PS if ExecPS
|
2016-08-18 15:26:11 +00:00
|
|
|
|
|
2017-10-06 15:25:14 +00:00
|
|
|
|
.82 lda #S.PS.F.INIT
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ora (ZPPtr3)
|
2017-09-12 06:20:24 +00:00
|
|
|
|
sta (ZPPtr3) Make this PS Init....
|
2017-01-12 17:43:45 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.CPID
|
2017-09-19 15:34:01 +00:00
|
|
|
|
lda CORE.LastPSID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (pPs),y
|
|
|
|
|
|
2016-08-18 15:26:11 +00:00
|
|
|
|
clc Exit with A=PSID
|
|
|
|
|
.9 rts
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-30 15:26:34 +00:00
|
|
|
|
PS.CmdLine2Args >STYA ZPPtr1
|
2017-09-25 06:31:19 +00:00
|
|
|
|
|
2017-08-30 15:26:34 +00:00
|
|
|
|
ldy #0
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-08-30 15:26:34 +00:00
|
|
|
|
.1 lda (ZPPtr1),y compute strlen in Y,X
|
|
|
|
|
beq .2
|
2017-09-21 15:29:45 +00:00
|
|
|
|
cmp #'"' skip " in computation....
|
2017-08-30 15:26:34 +00:00
|
|
|
|
beq .1
|
|
|
|
|
iny
|
|
|
|
|
bne .1 max 255
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-08-30 15:26:34 +00:00
|
|
|
|
.2 tya +2 for ending 0 for last string, and endig 0 for array
|
|
|
|
|
clc
|
|
|
|
|
adc #2
|
|
|
|
|
tay
|
|
|
|
|
lda #0
|
|
|
|
|
bcc .3
|
|
|
|
|
inc
|
|
|
|
|
|
|
|
|
|
.3 jsr K.GetMem.YA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcs .9
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-08-30 15:26:34 +00:00
|
|
|
|
phy save PTR.LO
|
|
|
|
|
pha save PTR.HI
|
|
|
|
|
>STYA ZPPtr2
|
|
|
|
|
|
2017-08-31 15:35:15 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hARGS
|
|
|
|
|
sta (ZPPtr3),y
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr PS.SetMemOwner Set Ownership
|
2017-10-09 05:51:32 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
stz PS.bInQuote
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
ldy #$ff
|
2017-08-30 15:26:34 +00:00
|
|
|
|
ldx #0 Arg Count
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
.4 iny
|
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
beq .7
|
2017-08-30 15:26:34 +00:00
|
|
|
|
|
|
|
|
|
cmp #'"' found a quote ?
|
|
|
|
|
bne .5
|
2017-10-27 14:56:46 +00:00
|
|
|
|
lda PS.bInQuote
|
2017-08-30 15:26:34 +00:00
|
|
|
|
eor #$ff
|
2017-10-27 14:56:46 +00:00
|
|
|
|
sta PS.bInQuote
|
2017-09-25 15:50:33 +00:00
|
|
|
|
bra .4
|
2017-08-30 15:26:34 +00:00
|
|
|
|
|
|
|
|
|
.5 cmp #' '
|
2017-09-25 15:50:33 +00:00
|
|
|
|
bne .6
|
2017-08-30 15:26:34 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
bit PS.bInQuote
|
2017-09-25 15:50:33 +00:00
|
|
|
|
bmi .6
|
2017-08-30 15:26:34 +00:00
|
|
|
|
|
|
|
|
|
inx Found one arg !!!
|
2017-09-25 15:50:33 +00:00
|
|
|
|
lda #0 set this token End
|
2017-08-30 15:26:34 +00:00
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
.6 sta (ZPPtr2)
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
inc ZPPtr2
|
|
|
|
|
bne .4
|
2017-08-30 15:26:34 +00:00
|
|
|
|
inc ZPPtr2+1
|
2017-09-25 15:50:33 +00:00
|
|
|
|
bra .4
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
.7 sta (ZPPtr2) set Arg Ending 0
|
|
|
|
|
|
|
|
|
|
inc ZPPtr2
|
|
|
|
|
bne .8
|
|
|
|
|
inc ZPPtr2+1
|
2017-08-30 15:26:34 +00:00
|
|
|
|
|
2017-09-25 15:50:33 +00:00
|
|
|
|
.8 sta (ZPPtr2) set Array Ending 0
|
2017-08-30 15:26:34 +00:00
|
|
|
|
|
2017-08-31 15:35:15 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.ARGC
|
|
|
|
|
sta (ZPPtr3),y
|
|
|
|
|
|
2017-08-30 15:26:34 +00:00
|
|
|
|
pla get back PTR.HI
|
|
|
|
|
ply get back PTR.LO
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-08-30 15:26:34 +00:00
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
2016-10-12 06:28:57 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
PS.bInQuote .BS 1
|
2017-08-30 15:26:34 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
PS.Init jsr BIN.Load.YA Y,A=filename full path
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcs .9
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr4 save PTR to Code Segment
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
|
|
|
|
phy
|
2017-10-26 16:01:54 +00:00
|
|
|
|
ldy #S.PS.ZP+1
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta (ZPPtr3),y save pCode HI...
|
|
|
|
|
dey
|
|
|
|
|
pla
|
|
|
|
|
sta (ZPPtr3),y save pCode LO...
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hCS
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta (ZPPtr3),y save CS hMem in S.PS
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-10-09 15:30:48 +00:00
|
|
|
|
jsr K.GetMemByID.A
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr PS.SetMemOwner Set Ownership
|
2017-10-09 15:30:48 +00:00
|
|
|
|
|
2016-09-30 15:04:55 +00:00
|
|
|
|
ldy #H.BIN.EXE.DS.SIZE+1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr4),y Load DS.SIZE HI
|
2016-08-17 06:25:58 +00:00
|
|
|
|
tax
|
|
|
|
|
dey
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ora (ZPPtr4),y
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .2 DS.SIZE=0...
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-07-01 13:44:40 +00:00
|
|
|
|
lda (ZPPtr4),y
|
|
|
|
|
tay
|
|
|
|
|
txa Y,A = DS.SIZE
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMem0.YA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcs .9
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
phy
|
2017-10-26 16:01:54 +00:00
|
|
|
|
ldy #S.PS.ZP+3
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta (ZPPtr3),y save pData HI...
|
|
|
|
|
dey
|
|
|
|
|
pla
|
|
|
|
|
sta (ZPPtr3),y save pData LO...
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hDS
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta (ZPPtr3),y save DS hMem in S.PS
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr PS.SetMemOwner Set Ownership
|
2017-10-09 05:51:32 +00:00
|
|
|
|
|
2017-09-12 15:24:36 +00:00
|
|
|
|
.2 ldy #H.BIN.EXE.SS.SIZE
|
2017-09-20 15:09:55 +00:00
|
|
|
|
lda (ZPPtr4),y Load SS.SIZE
|
2017-10-26 16:01:54 +00:00
|
|
|
|
ldy #S.PS.ZP+4
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta (ZPPtr3),y save pStack LO...
|
2017-09-12 15:24:36 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
tay
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-09-12 15:24:36 +00:00
|
|
|
|
bne .3 SS.SIZE.LO=0, set as default $100
|
2017-09-20 15:09:55 +00:00
|
|
|
|
lda #1 SS.SIZE.HI
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
.3 lda #0
|
2017-09-12 15:24:36 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
>PUSHYA
|
2017-09-12 06:20:24 +00:00
|
|
|
|
>PUSHBI S.MEM.F.ALIGN
|
|
|
|
|
jsr K.GetMem
|
2017-08-28 15:35:10 +00:00
|
|
|
|
bcs .9
|
2017-09-12 06:20:24 +00:00
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
ldy #S.PS.ZP+5
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta (ZPPtr3),y save pStack HI...(LO alredy set to Stack TOP)
|
|
|
|
|
|
2017-08-28 15:35:10 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hSS
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta (ZPPtr3),y save SS hMem in S.PS
|
2017-08-28 15:35:10 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr PS.SetMemOwner Set Ownership
|
2017-10-09 05:51:32 +00:00
|
|
|
|
|
2016-08-18 15:26:11 +00:00
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
* PS.DupEnv.A
|
2016-08-17 06:25:58 +00:00
|
|
|
|
* In:
|
|
|
|
|
* A = ENV hMem To Duplicate
|
|
|
|
|
* Out:
|
|
|
|
|
* A = hMem to new ENV
|
|
|
|
|
*--------------------------------------
|
2017-08-25 06:37:21 +00:00
|
|
|
|
PS.DupEnv.A jsr K.GetMemPtr.A
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2017-09-14 15:21:06 +00:00
|
|
|
|
|
2017-07-01 13:44:40 +00:00
|
|
|
|
>LDYAI K.ENV.SIZE
|
2017-08-25 06:37:21 +00:00
|
|
|
|
jsr K.GetMem.YA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcs .9
|
2017-09-14 15:21:06 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr2
|
2017-09-14 15:21:06 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr PS.SetMemOwner Set Ownership
|
2017-10-06 15:25:14 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
ldy #0
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.1 lda (ZPPtr1),y
|
|
|
|
|
sta (ZPPtr2),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
2017-09-14 15:21:06 +00:00
|
|
|
|
.2 iny
|
|
|
|
|
bne .3
|
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
inc ZPPtr2+1
|
|
|
|
|
|
|
|
|
|
.3 lda (ZPPtr1),y
|
|
|
|
|
sta (ZPPtr2),y
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
iny
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bne .1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
inc ZPPtr2+1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bra .1
|
|
|
|
|
|
2017-10-06 15:25:14 +00:00
|
|
|
|
.8 txa hMem
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
2017-08-29 15:19:09 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
PS.SetMemOwner lda CORE.LastPSID
|
2017-10-09 15:30:48 +00:00
|
|
|
|
ldy #S.MEM.OWNERPID
|
|
|
|
|
sta (ZPMEMMGR),y
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-10-06 15:25:14 +00:00
|
|
|
|
K.GetPSStatus.A jsr CORE.GetPSByID.A
|
|
|
|
|
bcs .9
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2017-09-21 06:35:44 +00:00
|
|
|
|
K.GetPSList.YA >STYA ZPPtr1
|
|
|
|
|
|
|
|
|
|
ldx #0
|
2017-09-21 15:29:45 +00:00
|
|
|
|
ldy #0
|
2017-09-21 06:35:44 +00:00
|
|
|
|
|
|
|
|
|
.1 lda PS.Table.PID,x
|
2017-09-21 15:29:45 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
2017-09-21 06:35:44 +00:00
|
|
|
|
lda PS.Table.hMem,x
|
|
|
|
|
iny
|
2017-09-21 15:29:45 +00:00
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
.2 inx
|
2017-09-21 06:35:44 +00:00
|
|
|
|
cpx CORE.PSCount
|
|
|
|
|
bne .1
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
|
|
|
|
.9 tya
|
|
|
|
|
sta (ZPPtr1)
|
2017-09-21 06:35:44 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-08-17 06:25:58 +00:00
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.PS
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
2016-08-17 06:25:58 +00:00
|
|
|
|
ASM
|