home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.sys.cbm      Discussion about Commodore micros      53,866 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 53,308 of 53,866   
   Silver Dream ! to Tilmann Hentze   
   Re: Closing a file in Assembly on the VI   
   30 Jun 21 10:49:10   
   
   From: silverdr@nospam.net   
      
   On 17.06.2021 13:29, Tilmann Hentze wrote:   
      
   >> main   
   >>              lda  #$07         ; Length of file name   
   >>              ldx  #>              ldy  #>filename   ; High byte of file name location   
   >>              jsr  SETNAM       ; Set the name   
   >   
   >>              lda  #$08         ; Logical file number   
   >>              ldx  #$08         ; Device number   
   >>              ldy  #$01         ; Secondary address - $01 because saving   
   >>              jsr  SETLFS       ; Set above parameters   
   >   
   > I'd switch the two previous blocks around, so that you first set up the   
   > channel and then set the file name.   
      
   Shouldn't make any difference. The order of the two preparatory calls is   
   interchangeable.   
      
   >>              lda  #>              sta  $C1   
   >>              lda  #>flash      ; High byte of start of memory block to save   
   >>              sta  $C2   
   >   
   >>              lda  #$C1            ; Pointer to location of start address   
   >>              ldx  #<(flashend+1)  ; Low byte of (end of memory block + 1)   
   >>              ldy  #>(flashend+1)  ; High byte of (end of memory block + 1)   
   >   
   > The high byte should probaly only increment, when the low byte is $ff.   
      
   I am not sure what are you trying to say here. This takes LO/HI bytes of   
   an address. Assembler takes care of both being correct.   
      
   >   
   >>              jsr  SAVE            ; Perform save   
   >   
   >>              lda  #$08         ; Logical file number   
   >>              jsr  CLOSE        ; Close the file   
      
   One needs to CLOSE() (or CLALL() in some cases) files that were   
   previously OPEN(). Not needed for SAVE().   
      
   > Looks good to me.   
      
   LGTM too.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca