view level2/modules/kernel/fgprocp.asm @ 1624:bb75784a1ec5

Minor source change by Rodney H.
author boisy
date Wed, 30 Jun 2004 01:07:36 +0000
parents 1da8ab9ba433
children 039ddb7c8ad7
line wrap: on
line source

**************************************************
* System Call: F$GProcP
*
* Function: Get process pointer
*
* Input:  A = Process ID
*
* Output: Y = Pointer to process descriptor
*
* Error:  CC = C bit set; B = error code
*
FGProcP  lda   R$A,u        get process #
         bsr   L0B2E        Get ptr to process descriptor
         bcs   L0B2D        If error, exit with it
         sty   R$Y,u        Save ptr in caller's Y
L0B2D    rts                Return

* Entry: A=Process #
* Exit:  Y=Ptr to process descriptor
*  All others preserved
L0B2E    pshs  d,x          Preserve regs
         ldb   ,s           Get process # into B
         beq   L0B40        0, skip ahead
         ldx   <D.PrcDBT    Get ptr to process descriptor block table
         abx                Point to specific process' entry
         lda   ,x           Get MSB of process dsc. ptr
         beq   L0B40        None there, exit with error
         clrb               Clear LSB of process dsc. ptr (always fall on $200
         tfr   d,y            boundaries) & move ptr to Y
         puls  d,x,pc       Restore regs & return

L0B40    puls  d,x          Get regs back
         comb               Exit with Bad process ID error
         ldb   #E$BPrcID
         rts