TIP: Click on subject to list as thread! ANSI
echo: cbm
to: Tilmann Hentze
from: Silver Dream !
date: 2021-06-30 10:49:00
subject: Re: Closing a file in Ass

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: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.