view level2/modules/kernel/fdatlog.asm @ 1345:1da8ab9ba433

Added consistent comments to each system call
author boisy
date Wed, 17 Sep 2003 17:26:37 +0000
parents ca83286ded5b
children 039ddb7c8ad7
line wrap: on
line source

**************************************************
* System Call: F$DATLog
*
* Function: Convert DAT block/offset to logical address
*
* Input:  B = DAT image offset
*         X = Block offset
*
* Output: X = Logical address
*
* Error:  CC = C bit set; B = error code
*
FDATLog  ldb   R$B,u          Get logical Block #
         ldx   R$X,u          Get offset into block
         bsr   CmpLBlk        Go modify X to be Logical address
         stx   R$X,u          Save in callers X register
         clrb                 No error & return
         rts   

* Compute logical address given B=Logical Block # & X=offset into block
* Exits with B being logical block & X=logical address
CmpLBlk  pshs  b              Preserve logical block #
         tfr   b,a            Move log. block # to A
         lsla                 Multiply logical block by 32
         lsla  
         lsla  
         lsla  
         lsla  
         clrb                 D=8k offset value
         IFNE  H6309
         addr  d,x            X=logical address in 64k workspace
         ELSE
         leax  d,x
         ENDC
         puls  b,pc           Restore A, block # & return