view level2/modules/kernel/fmapblk.asm @ 2758:e4a0f58a5f9b

Found that people who do not have the envirornment variable NITROS9DIR set before building the project get a error missing file "/rules.mak". Found this is caused do to the fact that the code to set this envirornment variable is in the rules.mak which can't get loaded. To fix this the code needed to set the envirornment variable that is in the rules.mak is now in the makefile(s) right before the include for the rules.mak file. This should fix the problem for those who do not have the NITROS9DIR envirornment variable preset.
author drencor-xeen
date Mon, 14 Jan 2013 14:37:46 -0600
parents 1da8ab9ba433
children 039ddb7c8ad7
line wrap: on
line source

**************************************************
* System Call: F$MapBlk
*
* Function: Map specific block
*
* Input:  B = Number of blocks
*         X = Beginning block number
*
* Output: U = Address of first block
*
* Error:  CC = C bit set; B = error code
*
FMapBlk  lda   R$B,u        get # blocks
         beq   L0BAA        can't map 0 blocks, return error
         cmpa  #DAT.BlCt    within range of DAT image?
         bhi   L0BAA        no, return error
         leas  -$10,s       make a buffer to hold DAT image
         ldx   R$X,u        get start block #
         ldb   #1           block increment value
         IFNE  H6309
* Change to W 05/19/93 - used W since one cycle faster per block
         tfr   s,w          point to buffer
FMapBlk2 stx   ,w++         save block # to buffer
         ELSE
         tfr   s,y          point to buffer
FMapBlk2 stx   ,y++         save block # to buffer
         ENDC
         abx                Next block
         deca               done?
         bne   FMapBlk2     no, keep going
         ldb   R$B,u        get block count again
         ldx   <D.Proc      get process pointer
         leay  <P$DATImg,x  point to DAT image
         os9   F$FreeHB     find the highest free block offset
         bcs   L0BA6        no room, return error
         IFNE  H6309
         tfr   d,w          Preserve start block # & # of blocks
         ELSE
         pshs  d
         ENDC
         lsla               Multiply start block # by 32
         lsla  
         lsla  
         lsla  
         lsla  
         clrb  
         std   R$U,u        save address of first block
         IFNE  H6309
         tfr   w,d          Restore offset
         ELSE
         puls  d
         ENDC
         leau  ,s           move DAT image into process descriptor
         os9   F$SetImg     Change process dsc to reflect new blocks
L0BA6    leas  <$10,s       Eat DAT image copy & return
         rts   

L0BAA    comb               Illegal Block address error
         ldb   #E$IBA
         rts