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-03-30 16:11:31 +00:00
|
|
|
|
* # ExecProcessNewEnvYA
|
|
|
|
|
* # ExecProcessYA (Blocking Parent PID)
|
|
|
|
|
* # CreateProcessNewEnvYA
|
|
|
|
|
* # CreateProcessYA (Non Blocking)
|
|
|
|
|
* ## In:
|
2016-09-27 15:51:59 +00:00
|
|
|
|
* Y,A = PTR To Cmd Line
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out:
|
2016-09-27 15:51:59 +00:00
|
|
|
|
* A = Child PSID
|
2016-10-31 21:38:53 +00:00
|
|
|
|
*\--------------------------------------
|
2016-09-27 15:51:59 +00:00
|
|
|
|
K.ExecProcessNewEnvYA
|
|
|
|
|
ldx #S.PS.F.ENV+S.PS.F.HOLD
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
K.ExecProcessYA ldx #S.PS.F.HOLD
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
K.CreateProcessNewEnvYA
|
|
|
|
|
ldx #S.PS.F.ENV
|
|
|
|
|
.HS 2C bit abs
|
|
|
|
|
K.CreateProcessYA
|
|
|
|
|
ldx #0
|
|
|
|
|
stx K.CreateProcess.Flags
|
|
|
|
|
>STYA K.CreateProcess.CmdLine
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2016-09-29 15:30:15 +00:00
|
|
|
|
jsr PS.CreateChild
|
2016-11-01 17:18:04 +00:00
|
|
|
|
bcs .9
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta .8+1
|
2016-09-27 15:51:59 +00:00
|
|
|
|
|
2016-09-29 15:30:15 +00:00
|
|
|
|
jsr PS.Init
|
2016-11-01 17:18:04 +00:00
|
|
|
|
bcc .8
|
2016-09-27 15:51:59 +00:00
|
|
|
|
|
2016-11-01 17:18:04 +00:00
|
|
|
|
pha save error code
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda .8+1
|
2016-09-29 15:30:15 +00:00
|
|
|
|
jsr PS.FreeA
|
2016-09-27 15:51:59 +00:00
|
|
|
|
pla get back error code
|
2016-11-01 17:18:04 +00:00
|
|
|
|
sec
|
2016-08-17 06:25:58 +00:00
|
|
|
|
rts
|
2016-11-01 17:18:04 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.8 lda #$ff self modified
|
2016-11-01 17:18:04 +00:00
|
|
|
|
.9 rts
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-27 15:51:59 +00:00
|
|
|
|
K.CreateProcess.Flags .BS 1
|
|
|
|
|
K.CreateProcess.CmdLine .BS 2
|
2016-10-31 21:38:53 +00:00
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # GetPSByIDA
|
|
|
|
|
* ## In :
|
2016-10-31 21:38:53 +00:00
|
|
|
|
* A = PID
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out :
|
2016-10-31 21:38:53 +00:00
|
|
|
|
* Y,A = PTR to TSKSLOT
|
|
|
|
|
*\--------------------------------------
|
2016-11-13 21:03:31 +00:00
|
|
|
|
K.GetPSByIDA pha
|
2016-08-17 06:25:58 +00:00
|
|
|
|
>LDYAI TskMgr.Table
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2016-11-13 21:03:31 +00:00
|
|
|
|
pla
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
2016-11-13 21:03:31 +00:00
|
|
|
|
sta .20+1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 inx
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
clc
|
2016-10-03 15:59:36 +00:00
|
|
|
|
adc #S.PS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcc .2
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr1+1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.2 lda (ZPPtr1)
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bpl .3
|
|
|
|
|
|
2016-10-29 19:58:21 +00:00
|
|
|
|
ldy #S.PS.PID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2016-11-13 21:03:31 +00:00
|
|
|
|
.20 cmp #$ff Self Modified
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.3 cpx TskMgr.Count
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.9 lda #TSKMGR.ERRNSP
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.8 >LDYA ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2016-10-31 21:38:53 +00:00
|
|
|
|
*/--------------------------------------
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* # Sleep
|
2016-10-31 21:38:53 +00:00
|
|
|
|
* Make current process suspend until next RUN
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## In :
|
2016-10-31 21:38:53 +00:00
|
|
|
|
* (none)
|
2017-03-30 16:11:31 +00:00
|
|
|
|
* ## Out :
|
2016-10-31 21:38:53 +00:00
|
|
|
|
* (none)
|
|
|
|
|
*\--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.Sleep pla get PC LO
|
2016-08-17 06:25:58 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc pCode
|
|
|
|
|
ldy #S.PS.PC
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
|
|
|
|
|
pla get PC HI
|
|
|
|
|
sbc pCode+1
|
|
|
|
|
iny
|
|
|
|
|
sta (pPs),y
|
|
|
|
|
lda (pPs)
|
|
|
|
|
ora #S.PS.F.SLEEP
|
|
|
|
|
sta (pPs)
|
|
|
|
|
clc No error,
|
|
|
|
|
rts back to Kernel
|
|
|
|
|
*--------------------------------------
|
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
|
2016-09-21 15:20:37 +00:00
|
|
|
|
* because of calling K.NewPStrYA & S.DupEnvA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-03 15:59:36 +00:00
|
|
|
|
PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr3
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
|
|
|
|
|
|
.1 inx
|
2017-01-12 17:43:45 +00:00
|
|
|
|
cpx TskMgr.Count
|
2016-08-17 06:25:58 +00:00
|
|
|
|
beq .2
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr3) Found an empty slot
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bpl .3
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda ZPPtr3
|
2016-08-17 06:25:58 +00:00
|
|
|
|
clc
|
2016-10-03 15:59:36 +00:00
|
|
|
|
adc #S.PS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta ZPPtr3
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcc .1
|
2017-01-12 17:43:45 +00:00
|
|
|
|
inc ZPPtr3+1
|
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
|
|
|
|
|
|
|
|
|
lda #TSKMGR.ERROOH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.3 inc TskMgr.Count
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
.4 inc TSKMGR.LASTID Get a PSID not alredy running
|
|
|
|
|
beq .4 not = 0
|
|
|
|
|
lda TSKMGR.LASTID
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetPSByIDA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcc .4
|
|
|
|
|
|
2016-10-29 19:58:21 +00:00
|
|
|
|
ldy #S.PS.PID
|
2016-08-17 06:25:58 +00:00
|
|
|
|
lda TSKMGR.LASTID
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
ldy #S.PS.hCS
|
2016-08-18 15:26:11 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.5 sta (ZPPtr3),y Blank Everything in this S.PS
|
2016-08-17 06:25:58 +00:00
|
|
|
|
iny
|
2016-10-03 15:59:36 +00:00
|
|
|
|
cpy #S.PS
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bne .5
|
|
|
|
|
|
2016-08-18 15:26:11 +00:00
|
|
|
|
lda #S.PS.F.ENV
|
2016-09-21 15:20:37 +00:00
|
|
|
|
bit K.CreateProcess.Flags need to create ENV & Prefix ?
|
2016-08-18 15:26:11 +00:00
|
|
|
|
beq .6 no...
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3) Mark this PS with ENV flag
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX copy hPREFIX...
|
|
|
|
|
lda (pPs),y
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
|
|
|
|
jsr K.NewPStrYA
|
2016-08-18 15:26:11 +00:00
|
|
|
|
bcs .9
|
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
|
2016-09-29 15:30:15 +00:00
|
|
|
|
jsr PS.DupEnvA
|
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
|
2016-09-21 15:20:37 +00:00
|
|
|
|
bit K.CreateProcess.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)
|
|
|
|
|
sta (pPs) HOLD parent PS if ExecProcess
|
|
|
|
|
|
|
|
|
|
.82 lda #S.PS.F.INUSE+S.PS.F.INIT
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ora (ZPPtr3)
|
|
|
|
|
sta (ZPPtr3) Make this PS Init....
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.CPID
|
2016-08-18 15:26:11 +00:00
|
|
|
|
lda TSKMGR.LASTID
|
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
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
PS.Init >LDYA K.CreateProcess.CmdLine
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.PStr2StrArrayYA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
phy save PTR to StrArray...
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hCMDLINE
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y
|
2016-10-12 06:28:57 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
pla Restore PTR...
|
|
|
|
|
ply
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>SYSCALL LoadExeYA 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
|
2016-08-17 06:25:58 +00:00
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hCS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y save CS hMem in TSKSLOT
|
2016-08-17 06:25:58 +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
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
beq .2 DS.SIZE=0...
|
|
|
|
|
|
2017-07-01 13:44:40 +00:00
|
|
|
|
lda (ZPPtr4),y
|
|
|
|
|
tay
|
|
|
|
|
txa Y,A = DS.SIZE
|
|
|
|
|
jsr K.GetMem0YA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
ldy #S.PS.hDS
|
2017-01-12 17:43:45 +00:00
|
|
|
|
sta (ZPPtr3),y save DS hMem in TSKSLOT
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2016-08-18 15:26:11 +00:00
|
|
|
|
.2
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2016-08-18 15:26:11 +00:00
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
* PS.FreeA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
* In : A = PID to free
|
|
|
|
|
*--------------------------------------
|
2017-01-12 17:43:45 +00:00
|
|
|
|
PS.FreeA jsr K.GetPSByIDA PS in ZPPtr1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.hCMDLINE
|
2017-01-12 17:43:45 +00:00
|
|
|
|
jsr PS.FreeA.PsY
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda (ZPPtr1) get S.PS.F
|
2016-08-17 06:25:58 +00:00
|
|
|
|
and #S.PS.F.ENV do we have to discard duplicated env & prefix ?
|
2017-01-12 17:43:45 +00:00
|
|
|
|
beq .1
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ldy #S.PS.hENV
|
|
|
|
|
jsr PS.FreeA.PsY
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
jsr PS.FreeA.PsY
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.1 ldy #S.PS.hDS
|
|
|
|
|
jsr PS.FreeA.PsY
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
ldy #S.PS.hCS
|
|
|
|
|
jsr PS.FreeA.PsY
|
2016-08-17 06:25:58 +00:00
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sta (ZPPtr1) Mark TSKSLOT as free
|
2016-08-17 06:25:58 +00:00
|
|
|
|
clc
|
2017-01-12 17:43:45 +00:00
|
|
|
|
PS.FreeA.RTS rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
PS.FreeA.PsY lda (ZPPtr1),y
|
|
|
|
|
beq PS.FreeA.RTS
|
|
|
|
|
jmp K.FreeMemA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
* PS.SelectA
|
2016-09-27 15:51:59 +00:00
|
|
|
|
* In : A=PSID
|
|
|
|
|
*--------------------------------------
|
2016-11-13 21:03:31 +00:00
|
|
|
|
PS.Select0 lda #0
|
|
|
|
|
PS.SelectA jsr K.GetPSByIDA
|
2016-09-27 15:51:59 +00:00
|
|
|
|
bcs *
|
|
|
|
|
>STYA pPs
|
|
|
|
|
|
2016-09-29 15:30:15 +00:00
|
|
|
|
PS.Select ldy #S.PS.hCS
|
2016-09-27 15:51:59 +00:00
|
|
|
|
lda (pPs),y
|
2016-11-13 21:03:31 +00:00
|
|
|
|
beq .1 PS=0 (kernel) has no CS/DS
|
|
|
|
|
|
2016-09-27 15:51:59 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
|
|
|
|
>STYA pCode
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hDS
|
|
|
|
|
lda (pPs),y
|
2016-11-13 21:03:31 +00:00
|
|
|
|
beq .1
|
2016-09-27 15:51:59 +00:00
|
|
|
|
|
|
|
|
|
jsr K.GetMemPtrA
|
|
|
|
|
>STYA pData
|
|
|
|
|
|
2017-01-12 17:43:45 +00:00
|
|
|
|
.1 ldy #S.PS.hStdOut
|
2016-09-27 15:51:59 +00:00
|
|
|
|
lda (pPs),y
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
jsr K.GetDevByIDA
|
|
|
|
|
>STYA pDev
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
* PS.DupEnvA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
* In:
|
|
|
|
|
* A = ENV hMem To Duplicate
|
|
|
|
|
* Out:
|
|
|
|
|
* A = hMem to new ENV
|
|
|
|
|
*--------------------------------------
|
2016-09-29 15:30:15 +00:00
|
|
|
|
PS.DupEnvA jsr K.GetMemPtrA
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr1
|
2017-07-01 13:44:40 +00:00
|
|
|
|
>LDYAI K.ENV.SIZE
|
|
|
|
|
jsr K.GetMemYA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcs .9
|
2017-01-12 17:43:45 +00:00
|
|
|
|
>STYA ZPPtr2
|
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
|
|
|
|
|
|
|
|
|
|
iny
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
.8 txa
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
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
|