Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Sometimes, too long is too long. -- Joe Crowe


devel / comp.sys.cbm / Re: Closing a file in Assembly on the VIC-20

SubjectAuthor
* Closing a file in Assembly on the VIC-20Lawrence Woodman
+* Re: Closing a file in Assembly on the VIC-20Tilmann Hentze
|+* Re: Closing a file in Assembly on the VIC-20Lawrence Woodman
||`* Re: Closing a file in Assembly on the VIC-20Lawrence Woodman
|| `* Closing a file in Assembly on the VIC-20Daniel Path
||  `* Re: Closing a file in Assembly on the VIC-20Lawrence Woodman
||   +- Re: Closing a file in Assembly on the VIC-20Andreas Kohlbach
||   `* Closing a file in Assembly on the VIC-20Daniel Path
||    `- Re: Closing a file in Assembly on the VIC-20Lawrence Woodman
|`- Re: Closing a file in Assembly on the VIC-20Silver Dream !
`* Re: Closing a file in Assembly on the VIC-20Anssi Saari
 `* Re: Closing a file in Assembly on the VIC-20Lawrence Woodman
  `* Re: Closing a file in Assembly on the VIC-20Andreas Kohlbach
   +- Re: Closing a file in Assembly on the VIC-20Anssi Saari
   `- Re: Closing a file in Assembly on the VIC-20Silver Dream !

1
Closing a file in Assembly on the VIC-20

<saf2mm$te7$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=157&group=comp.sys.cbm#157

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lorrywoo...@gmail.com (Lawrence Woodman)
Newsgroups: comp.sys.cbm
Subject: Closing a file in Assembly on the VIC-20
Date: Thu, 17 Jun 2021 08:55:50 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 87
Message-ID: <saf2mm$te7$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 17 Jun 2021 08:55:50 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="98ff0fc79a917d32b7c8f633821b2d3f";
logging-data="30151"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/C+uBRZqZfQYUmXKiutBHyzUoUQuMXPkA="
User-Agent: Pan/0.146 (Hic habitat felicitas; 8107378
git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:bL0mcY3gNjDWWTXSIb+Ofnmc270=
 by: Lawrence Woodman - Thu, 17 Jun 2021 08:55 UTC

Hello Everyone,

I've been trying to save some memory on the VIC-20 to a file on disk but
seem to be having some problems when it comes to close the file. At the
moment the file saves the data properly from assembly but I have to use
'CLOSE 8' from basic to prevent it having an asterisk next to the name in
the directory entry.

I have created a piece of code which replicates the problem below if
anyone has any ideas where I'm going wrong I'd be very grateful.

; Basic Stub
TOK_SYS = $9E ; SYS token

.byt $01, $10 ; Load address ($1001)

* = $1001
.word basicEnd ; Next Line link, here end of Basic program
.word 1 ; The line number for the SYS statement
.byt TOK_SYS ; SYS token
.asc " "
.asc "4110" ; Start of machine language
.byt 0 ; End of Basic line
basicEnd .word 0 ; End of Basic program

; KERNEL/BASIC ROM Routines
CLOSE = $FFC3
SAVE = $FFD8
SETLFS = $FFBA
SETNAM = $FFBD

main
lda #$07 ; Length of file name
ldx #<filename ; Low byte of file name location
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

lda #<flash ; Low byte of start of memory block to save
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)
jsr SAVE ; Perform save

lda #$08 ; Logical file number
jsr CLOSE ; Close the file

rts

filename .asc "FLASH"

;=================================
; Block of memory to save
;=================================
flash lda $900F ; Record initial screen border/background combo
ldx #$FF ; First combo is $FF
setcombo stx $900F ; Set screen border/background combo

; Time delay
ldy #$FF
delay dey
bne delay

dex ; Next combo
bne setcombo
sta $900F ; restore initial screen border/background combo
flashend rts

Thanks in advance

Lorry

---
Advanced Use of .LBR Files on CP/M
https://techtinkering.com/articles/advanced-use-of-lbr-files-on-cpm/

Re: Closing a file in Assembly on the VIC-20

<safbnl$pg9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=158&group=comp.sys.cbm#158

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: 0xc...@directbox.com (Tilmann Hentze)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Thu, 17 Jun 2021 11:29:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 59
Archive: no
Message-ID: <safbnl$pg9$1@dont-email.me>
References: <saf2mm$te7$1@dont-email.me>
Injection-Date: Thu, 17 Jun 2021 11:29:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2685934a66cb16fa4cd9b24ca342ffbf";
logging-data="26121"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rV/zk39SBuPZHMCxoHPFgGnhZyftgTbU="
Cancel-Lock: sha1:EktyXNCLMOzSCV9xSs5/8wU6/9M=
X-No-Archive: yes
X-Clacks-Overhead: GNU Terry Pratchett
 by: Tilmann Hentze - Thu, 17 Jun 2021 11:29 UTC

Lawrence Woodman <lorrywoodman@gmail.com> wrote:
> I have created a piece of code which replicates the problem below if
> anyone has any ideas where I'm going wrong I'd be very grateful.

> ; Basic Stub
> TOK_SYS = $9E ; SYS token

> .byt $01, $10 ; Load address ($1001)

> * = $1001
> .word basicEnd ; Next Line link, here end of Basic program
> .word 1 ; The line number for the SYS statement
> .byt TOK_SYS ; SYS token
> .asc " "
> .asc "4110" ; Start of machine language
> .byt 0 ; End of Basic line
> basicEnd .word 0 ; End of Basic program

> ; KERNEL/BASIC ROM Routines
> CLOSE = $FFC3
> SAVE = $FFD8
> SETLFS = $FFBA
> SETNAM = $FFBD

> main
> lda #$07 ; Length of file name
> ldx #<filename ; Low byte of file name location
> 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.

> lda #<flash ; Low byte of start of memory block to save
> 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.

> jsr SAVE ; Perform save

> lda #$08 ; Logical file number
> jsr CLOSE ; Close the file

Looks good to me. Perhaps it will work with the first mentioned change?

Best regards,
Tilmann.

Re: Closing a file in Assembly on the VIC-20

<sag5sg$c75$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=159&group=comp.sys.cbm#159

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lorrywoo...@gmail.com (Lawrence Woodman)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Thu, 17 Jun 2021 18:56:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <sag5sg$c75$1@dont-email.me>
References: <saf2mm$te7$1@dont-email.me> <safbnl$pg9$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 17 Jun 2021 18:56:16 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="98ff0fc79a917d32b7c8f633821b2d3f";
logging-data="12517"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZU1qMhCsYlqo1Ct/lbclnm/sI+599rz4="
User-Agent: Pan/0.146 (Hic habitat felicitas; 8107378
git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:+kNUjsQnLr1H0LOvTjfKQRfiKes=
 by: Lawrence Woodman - Thu, 17 Jun 2021 18:56 UTC

On Thu, 17 Jun 2021 11:29:57 -0000 (UTC), Tilmann Hentze wrote:

> Lawrence Woodman <lorrywoodman@gmail.com> wrote:
>> I have created a piece of code which replicates the problem below if
>> anyone has any ideas where I'm going wrong I'd be very grateful.
>>
>> [code snipped]
>>
>> main
>> lda #$07 ; Length of file name
>> ldx #<filename ; Low byte of file name location
>> 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.

Thanks for the suggestion. I gave it a go but unfortunately it still
gives the same result.

>> [code snipped]
>> lda #$08 ; Logical file number
>> jsr CLOSE ; Close the file
>
> Looks good to me. Perhaps it will work with the first mentioned change?

Sadly not. However, I'm not sure that a CLOSE is necessary as I noticed
in other code examples that it isn't used. I've tried without it and
also checked for errors via a carry after the SAVE but still no joy. If
you or anyone else has any ideas I'd love to get this working.

Best wishes

Lorry

---
Advanced Use of .LBR Files on CP/M
https://techtinkering.com/articles/advanced-use-of-lbr-files-on-cpm/

Re: Closing a file in Assembly on the VIC-20

<sahg3k$7hf$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=160&group=comp.sys.cbm#160

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lorrywoo...@gmail.com (Lawrence Woodman)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Fri, 18 Jun 2021 06:56:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <sahg3k$7hf$1@dont-email.me>
References: <saf2mm$te7$1@dont-email.me> <safbnl$pg9$1@dont-email.me>
<sag5sg$c75$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 18 Jun 2021 06:56:52 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="cef685329a630af42880e5b97e71ae59";
logging-data="7727"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198XmblxP0Z7EDT5olOX5usg1IFJ0FE+/I="
User-Agent: Pan/0.146 (Hic habitat felicitas; 8107378
git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:q16Z6jBzN1ziZ5ir/JNP8VkMyAQ=
 by: Lawrence Woodman - Fri, 18 Jun 2021 06:56 UTC

On Thu, 17 Jun 2021 18:56:16 -0000 (UTC), Lawrence Woodman wrote:

> On Thu, 17 Jun 2021 11:29:57 -0000 (UTC), Tilmann Hentze wrote:
>
>> Lawrence Woodman <lorrywoodman@gmail.com> wrote:
>>> I have created a piece of code which replicates the problem below if
>>> anyone has any ideas where I'm going wrong I'd be very grateful.
>>>
>>> [code snipped]
>>>
>>> main
>>> lda #$07 ; Length of file name
>>> ldx #<filename ; Low byte of file name location
>>> 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.
>
> Thanks for the suggestion. I gave it a go but unfortunately it still
> gives the same result.
>
>
>>> [code snipped]
>>> lda #$08 ; Logical file number
>>> jsr CLOSE ; Close the file
>>
>> Looks good to me. Perhaps it will work with the first mentioned change?
>
> Sadly not. However, I'm not sure that a CLOSE is necessary as I noticed
> in other code examples that it isn't used. I've tried without it and
> also checked for errors via a carry after the SAVE but still no joy. If
> you or anyone else has any ideas I'd love to get this working.

I've managed to track down the problem. Because I was automating some of
the testing around this I hadn't left a long enough delay before
displaying the directory. It turns out that it takes a little longer
than I expected for the SAVE command to complete the write. Once I left
a bigger delay before checking the directory everything was fine. It
also appears that there is no need to call CLOSE either.

Best wishes

Lorry

---
Advanced Use of .LBR Files on CP/M
https://techtinkering.com/articles/advanced-use-of-lbr-files-on-cpm/

Re: Closing a file in Assembly on the VIC-20

<sm0h7hvipfe.fsf@lakka.kapsi.fi>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=161&group=comp.sys.cbm#161

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: as...@sci.fi (Anssi Saari)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Fri, 18 Jun 2021 10:48:21 +0300
Organization: An impatient and LOUD arachnid
Lines: 13
Message-ID: <sm0h7hvipfe.fsf@lakka.kapsi.fi>
References: <saf2mm$te7$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="682fde7c3bd3bf9d9bb0688c0cc77458";
logging-data="26357"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NpI2E3J4pqz9GjUspT6NT"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:TT9mRAwdErhdYc1QGuLwkKUzuNw=
sha1:WVvIouY6yBxa72bXIb4NMqu5d1o=
 by: Anssi Saari - Fri, 18 Jun 2021 07:48 UTC

Lawrence Woodman <lorrywoodman@gmail.com> writes:

> Hello Everyone,
>
> I've been trying to save some memory on the VIC-20 to a file on disk but
> seem to be having some problems when it comes to close the file. At the
> moment the file saves the data properly from assembly but I have to use
> 'CLOSE 8' from basic to prevent it having an asterisk next to the name in
> the directory entry.

I assembled with xa and ran in Vice but I don't get an asterisk in the
directory entry. Other than the obvious file name issue I see nothing
wrong but I'm hardly an expert.

Re: Closing a file in Assembly on the VIC-20

<sahk1n$tvh$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=162&group=comp.sys.cbm#162

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lorrywoo...@gmail.com (Lawrence Woodman)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Fri, 18 Jun 2021 08:04:07 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <sahk1n$tvh$1@dont-email.me>
References: <saf2mm$te7$1@dont-email.me> <sm0h7hvipfe.fsf@lakka.kapsi.fi>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 18 Jun 2021 08:04:07 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="cef685329a630af42880e5b97e71ae59";
logging-data="30705"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX180wDYV8TPLMwQtMo2X/JK4phDtOoW22pw="
User-Agent: Pan/0.146 (Hic habitat felicitas; 8107378
git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:f1Ry1RzpsUy8t9th9wMQfX5yhMk=
 by: Lawrence Woodman - Fri, 18 Jun 2021 08:04 UTC

On Fri, 18 Jun 2021 10:48:21 +0300, Anssi Saari wrote:

> Lawrence Woodman <lorrywoodman@gmail.com> writes:
>
>> Hello Everyone,
>>
>> I've been trying to save some memory on the VIC-20 to a file on disk but
>> seem to be having some problems when it comes to close the file. At the
>> moment the file saves the data properly from assembly but I have to use
>> 'CLOSE 8' from basic to prevent it having an asterisk next to the name in
>> the directory entry.
>
> I assembled with xa and ran in Vice but I don't get an asterisk in the
> directory entry. Other than the obvious file name issue I see nothing
> wrong but I'm hardly an expert.

Thanks for trying. I have got it running now, the problem was that I was
automating this and wasn't leaving it long enough before checking the
directory. It's all working now :-)

Best wishes

Lorry

---
Advanced Use of .LBR Files on CP/M
https://techtinkering.com/articles/advanced-use-of-lbr-files-on-cpm/

Re: Closing a file in Assembly on the VIC-20

<87tulvvttb.fsf@usenet.ankman.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=163&group=comp.sys.cbm#163

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ank...@spamfence.net (Andreas Kohlbach)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Fri, 18 Jun 2021 15:47:28 -0400
Organization: https://news-commentaries.blogspot.com/
Lines: 30
Message-ID: <87tulvvttb.fsf@usenet.ankman.de>
References: <saf2mm$te7$1@dont-email.me> <sm0h7hvipfe.fsf@lakka.kapsi.fi>
<sahk1n$tvh$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="954c1a9ba7470c82ea511a9193470528";
logging-data="11883"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uW5d5sSX8g/4eyFtz70db"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:y3KNV48YRE8ONbAPtcWwIEvBFN8=
sha1:7N+gFJ+qVAjLHnUs8zC4kqXlgas=
X-No-Archive: Yes
X-Face: '#R~-oJz-_!iXhczPJ;=w1(`5-uQ2$0qHB7KKDV,]VoAC!P?swaa#m|eB<DkOt*XH=~9C[g S^w)b,)1q,{P\7Z3H,N(^m.YKuYM//B{X:PvbDk.|:g:$wVr*3*)[K6F+k\z-s32+oB]YJPy11wuGGz'bQAk~1.b1[;M{^A2@bboIENBB:Wd:<Fm~r7OuiJA1g}7KC-T'>Du+
X-Face-What-Is-It: Capture Bee from Galaga
 by: Andreas Kohlbach - Fri, 18 Jun 2021 19:47 UTC

On Fri, 18 Jun 2021 08:04:07 -0000 (UTC), Lawrence Woodman wrote:
>
> On Fri, 18 Jun 2021 10:48:21 +0300, Anssi Saari wrote:
>
>> Lawrence Woodman <lorrywoodman@gmail.com> writes:
>>
>>> Hello Everyone,
>>>
>>> I've been trying to save some memory on the VIC-20 to a file on disk but
>>> seem to be having some problems when it comes to close the file. At the
>>> moment the file saves the data properly from assembly but I have to use
>>> 'CLOSE 8' from basic to prevent it having an asterisk next to the name in
>>> the directory entry.
>>
>> I assembled with xa and ran in Vice but I don't get an asterisk in the
>> directory entry. Other than the obvious file name issue I see nothing
>> wrong but I'm hardly an expert.
>
> Thanks for trying. I have got it running now, the problem was that I was
> automating this and wasn't leaving it long enough before checking the
> directory. It's all working now :-)

And the delay when physically writing a file does not occur in
emulators. That's why it worked in VICE right away.

Hmm, VICE has "true drive emulation". I wonder what happens if activated...
--
Andreas

PGP fingerprint 952B0A9F12C2FD6C9F7E68DAA9C2EA89D1A370E0

Closing a file in Assembly on the VIC-20

<1624042512@f52.n371.z2.fidonet.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=164&group=comp.sys.cbm#164

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.D...@f52.n371.z2.fidonet.org (Daniel Path)
Newsgroups: comp.sys.cbm
Subject: Closing a file in Assembly on the VIC-20
Date: Fri, 18 Jun 2021 20:54:46 +1200
Organization: Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID: <1624042512@f52.n371.z2.fidonet.org>
References: <sahg3k$7hf$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="23665"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-Comment-To: Lawrence Woodman
X-MailConverter: SoupGate-Win32 v1.05
 by: Daniel Path - Fri, 18 Jun 2021 08:54 UTC

Hello Lawrence.

18 Jun 21 06:56, you wrote to you:

LW> On Thu, 17 Jun 2021 18:56:16 -0000 (UTC), Lawrence Woodman wrote:

>> On Thu, 17 Jun 2021 11:29:57 -0000 (UTC), Tilmann Hentze wrote:
>>
>>> Lawrence Woodman <lorrywoodman@gmail.com> wrote:
>>>> I have created a piece of code which replicates the problem below
>>>> if anyone has any ideas where I'm going wrong I'd be very
>>>> grateful.
>>>>
>>>> [code snipped]
>>>>
>>>> main
>>>> lda #$07 ; Length of file name
>>>> ldx #<filename ; Low byte of file name location
>>>> 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. Thanks for the suggestion.
>>> I gave it a go but unfortunately it still
>> gives the same result.
>>
>>
>>>> [code snipped]
>>>> lda #$08 ; Logical file number
>>>> jsr CLOSE ; Close the file
>>>
>>> Looks good to me. Perhaps it will work with the first mentioned
>>> change? Sadly not. However, I'm not sure that a CLOSE is necessary
>>> as I noticed
>> in other code examples that it isn't used. I've tried without it
>> and also checked for errors via a carry after the SAVE but still no
>> joy. If you or anyone else has any ideas I'd love to get this
>> working.

LW> I've managed to track down the problem. Because I was automating some
LW> of the testing around this I hadn't left a long enough delay
LW> before displaying the directory. It turns out that it takes a little
LW> longer than I expected for the SAVE command to complete the write.
LW> Once I left a bigger delay before checking the directory everything
LW> was fine. It also appears that there is no need to call CLOSE either.

and what are you coding? :)

--
Daniel

.... BBS: Uptime is 02d 20h 42m 32s (BT-Uptime/OS2, V1.5)

Re: Closing a file in Assembly on the VIC-20

<sm0czsihxiv.fsf@lakka.kapsi.fi>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=165&group=comp.sys.cbm#165

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: as...@sci.fi (Anssi Saari)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Sat, 19 Jun 2021 15:03:20 +0300
Organization: An impatient and LOUD arachnid
Lines: 16
Message-ID: <sm0czsihxiv.fsf@lakka.kapsi.fi>
References: <saf2mm$te7$1@dont-email.me> <sm0h7hvipfe.fsf@lakka.kapsi.fi>
<sahk1n$tvh$1@dont-email.me> <87tulvvttb.fsf@usenet.ankman.de>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="76429ded47057210075c71d01790e599";
logging-data="24342"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+z8CaE3hmrkTTOJR5os2Ud"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:Cj1vSvMNKJmo3QXI5VeKy6KAQMQ=
sha1:UsDxIvFd0rzvfEEm7rnQyneRxXk=
 by: Anssi Saari - Sat, 19 Jun 2021 12:03 UTC

Andreas Kohlbach <ank@spamfence.net> writes:

> And the delay when physically writing a file does not occur in
> emulators. That's why it worked in VICE right away.

Unless emulators actually emulate the drive? Not sure if you think I'm
stupid or not. Anyways, drive emulation is often needed on 8-bit
Commodores since the drives are "smart", in effect computers in
themselves.

> Hmm, VICE has "true drive emulation". I wonder what happens if activated...

Disk access is authentically slow if activated. I usually have it on and
had for this. I find my little retro fun is more fun with that. Vice
even emulates drive sounds if requested but that gets tiresome pretty
fast.

Re: Closing a file in Assembly on the VIC-20

<saphlu$r40$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=167&group=comp.sys.cbm#167

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lorrywoo...@gmail.com (Lawrence Woodman)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Mon, 21 Jun 2021 08:12:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <saphlu$r40$1@dont-email.me>
References: <sahg3k$7hf$1@dont-email.me> <1624042512@f52.n371.z2.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 21 Jun 2021 08:12:46 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="7bb7d023c5d200e718bdff52564824dd";
logging-data="27776"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9qpAZTtK1G+25oFoJY/MjMw3uwPU5RNA="
User-Agent: Pan/0.146 (Hic habitat felicitas; 8107378
git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:/Jt4um3hxc+vgKkuCV3MgewWmSw=
 by: Lawrence Woodman - Mon, 21 Jun 2021 08:12 UTC

On Fri, 18 Jun 2021 20:54:46 +1200, Daniel Path wrote:

> 18 Jun 21 06:56, you wrote to you:
>
> LW> On Thu, 17 Jun 2021 18:56:16 -0000 (UTC), Lawrence Woodman wrote:
>
> >> On Thu, 17 Jun 2021 11:29:57 -0000 (UTC), Tilmann Hentze wrote:
> >>
> >>> Lawrence Woodman <lorrywoodman@gmail.com> wrote:
> >>>> I have created a piece of code which replicates the problem below
> >>>> if anyone has any ideas where I'm going wrong I'd be very
> >>>> grateful.
> >>>>
> >>>> [snip]
>
> LW> I've managed to track down the problem. Because I was automating some
> LW> of the testing around this I hadn't left a long enough delay
> LW> before displaying the directory. It turns out that it takes a little
> LW> longer than I expected for the SAVE command to complete the write.
> LW> Once I left a bigger delay before checking the directory everything
> LW> was fine. It also appears that there is no need to call CLOSE either.
>
> and what are you coding? :)

I'm creating an article and video about various ways to load and save
memory on the VIC-20. I wrote the assembly code that I posted a while
ago and was sure it worked previously. As it turned out there was
nothing significantly wrong with the code, it was purely a testing
issue. I can post the URLs to the article/video once finished if
you're interested?

Best wishes

Lorry

---
Basic Line Storage on the VIC-20
https://techtinkering.com/articles/basic-line-storage-on-the-vic-20/

Re: Closing a file in Assembly on the VIC-20

<877dinv8nm.fsf@usenet.ankman.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=168&group=comp.sys.cbm#168

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ank...@spamfence.net (Andreas Kohlbach)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Mon, 21 Jun 2021 06:01:17 -0400
Organization: https://news-commentaries.blogspot.com/
Lines: 37
Message-ID: <877dinv8nm.fsf@usenet.ankman.de>
References: <sahg3k$7hf$1@dont-email.me> <1624042512@f52.n371.z2.fidonet.org>
<saphlu$r40$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="e9317c6209db30cd57e0cb0da00ad914";
logging-data="6903"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18hQtsm4T94eUMU+McNvS0A"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:WxNWSigb1kWxIjd88ROk2c4pu/Y=
sha1:/0R7iYbZtLDHp6pircAxP4JrQhI=
X-No-Archive: Yes
X-Face: '#R~-oJz-_!iXhczPJ;=w1(`5-uQ2$0qHB7KKDV,]VoAC!P?swaa#m|eB<DkOt*XH=~9C[g S^w)b,)1q,{P\7Z3H,N(^m.YKuYM//B{X:PvbDk.|:g:$wVr*3*)[K6F+k\z-s32+oB]YJPy11wuGGz'bQAk~1.b1[;M{^A2@bboIENBB:Wd:<Fm~r7OuiJA1g}7KC-T'>Du+
X-Face-What-Is-It: Capture Bee from Galaga
 by: Andreas Kohlbach - Mon, 21 Jun 2021 10:01 UTC

On Mon, 21 Jun 2021 08:12:46 -0000 (UTC), Lawrence Woodman wrote:
>
> On Fri, 18 Jun 2021 20:54:46 +1200, Daniel Path wrote:
>
>> 18 Jun 21 06:56, you wrote to you:
>>
>> LW> On Thu, 17 Jun 2021 18:56:16 -0000 (UTC), Lawrence Woodman wrote:
>>
>> >> On Thu, 17 Jun 2021 11:29:57 -0000 (UTC), Tilmann Hentze wrote:
>> >>
>> >>> Lawrence Woodman <lorrywoodman@gmail.com> wrote:
>> >>>> I have created a piece of code which replicates the problem below
>> >>>> if anyone has any ideas where I'm going wrong I'd be very
>> >>>> grateful.
>> >>>>
>> >>>> [snip]
>>
>> LW> I've managed to track down the problem. Because I was automating some
>> LW> of the testing around this I hadn't left a long enough delay
>> LW> before displaying the directory. It turns out that it takes a little
>> LW> longer than I expected for the SAVE command to complete the write.
>> LW> Once I left a bigger delay before checking the directory everything
>> LW> was fine. It also appears that there is no need to call CLOSE either.
>>
>> and what are you coding? :)
>
>
> I'm creating an article and video about various ways to load and save
> memory on the VIC-20. I wrote the assembly code that I posted a while
> ago and was sure it worked previously. As it turned out there was
> nothing significantly wrong with the code, it was purely a testing
> issue. I can post the URLs to the article/video once finished if
> you're interested?

I'd be interested.
--
Andreas

Closing a file in Assembly on the VIC-20

<1624300167@f52.n371.z2.fidonet.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=169&group=comp.sys.cbm#169

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail
From: nospam.D...@f52.n371.z2.fidonet.org (Daniel Path)
Newsgroups: comp.sys.cbm
Subject: Closing a file in Assembly on the VIC-20
Date: Mon, 21 Jun 2021 20:28:44 +1200
Organization: Agency HUB, Dunedin - New Zealand | bbs.nz/#Fidonet
Message-ID: <1624300167@f52.n371.z2.fidonet.org>
References: <saphlu$r40$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: news.bbs.nz; posting-host="8IWYKlztXHa0+IViEdY46zrq8kpk7dC9fTbT74JiSDQ";
logging-data="17085"; mail-complaints-to="abuse@news.bbs.nz"
User-Agent: VSoup v1.2.9.47Beta [95/NT]
X-MailConverter: SoupGate-Win32 v1.05
X-Comment-To: Lawrence Woodman
 by: Daniel Path - Mon, 21 Jun 2021 08:28 UTC

Hello Lawrence.

21 Jun 21 08:12, you wrote to me:

LW> On Fri, 18 Jun 2021 20:54:46 +1200, Daniel Path wrote:

>> 18 Jun 21 06:56, you wrote to you:
>>
>> LW> On Thu, 17 Jun 2021 18:56:16 -0000 (UTC), Lawrence Woodman
>> LW> wrote:
>>
>> >> On Thu, 17 Jun 2021 11:29:57 -0000 (UTC), Tilmann Hentze wrote:
>> >>
>> >>> Lawrence Woodman <lorrywoodman@gmail.com> wrote:
>> >>>> I have created a piece of code which replicates the problem
>> >>>> below if anyone has any ideas where I'm going wrong I'd be
>> >>>> very grateful.
>> >>>>
>> >>>> [snip]
>>
>> LW> I've managed to track down the problem. Because I was
>> LW> automating some of the testing around this I hadn't left a long
>> LW> enough delay before displaying the directory. It turns out
>> LW> that it takes a little longer than I expected for the SAVE
>> LW> command to complete the write. Once I left a bigger delay
>> LW> before checking the directory everything was fine. It also
>> LW> appears that there is no need to call CLOSE either.
>>
>> and what are you coding? :)

LW> I'm creating an article and video about various ways to load and save
LW> memory on the VIC-20. I wrote the assembly code that I posted a while
LW> ago and was sure it worked previously. As it turned out there was
LW> nothing significantly wrong with the code, it was purely a testing
LW> issue. I can post the URLs to the article/video once finished if
LW> you're interested?

sure i am! thanks Lawrence :)
good luck and have fun!

--
Daniel

.... 10:23pm up 6 days, 11:23:31, load: 69 processes, 275 threads.

Re: Closing a file in Assembly on the VIC-20

<sb1eh5$g1m$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=170&group=comp.sys.cbm#170

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lorrywoo...@gmail.com (Lawrence Woodman)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Thu, 24 Jun 2021 08:08:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <sb1eh5$g1m$1@dont-email.me>
References: <saphlu$r40$1@dont-email.me> <1624300167@f52.n371.z2.fidonet.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 24 Jun 2021 08:08:05 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="af65d3437c2b307ab867940928cecbb0";
logging-data="16438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/PW3xlNSpN22Q7+S0q5K4o7Bc6dUugqU="
User-Agent: Pan/0.146 (Hic habitat felicitas; 8107378
git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:PHGg6NGOybnSTKYjv4nQNbcLl3U=
 by: Lawrence Woodman - Thu, 24 Jun 2021 08:08 UTC

On Mon, 21 Jun 2021 20:28:44 +1200, Daniel Path wrote:

> 21 Jun 21 08:12, you wrote to me:
>
> LW> I'm creating an article and video about various ways to load and save
> LW> memory on the VIC-20. I wrote the assembly code that I posted a while
> LW> ago and was sure it worked previously. As it turned out there was
> LW> nothing significantly wrong with the code, it was purely a testing
> LW> issue. I can post the URLs to the article/video once finished if
> LW> you're interested?
>
> sure i am! thanks Lawrence :)
> good luck and have fun!

The article and video about saving and loading memory on the VIC-20 are
live on my TechTinkering website/YouTube channel.

The article is at:
https://techtinkering.com/articles/saving-and-loading-memory-on-the-vic-20/

The video is at:
https://www.youtube.com/watch?v=sOBrRV6p82w

I hope you like it

Lorry

---
Retro Computers, Programming, CP/M, VIC-20
https://techtinkering.com

Re: Closing a file in Assembly on the VIC-20

<sbhb66$7ge$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=172&group=comp.sys.cbm#172

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: silve...@nospam.net (Silver Dream !)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Wed, 30 Jun 2021 10:49:10 +0200
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <sbhb66$7ge$1@dont-email.me>
References: <saf2mm$te7$1@dont-email.me> <safbnl$pg9$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 30 Jun 2021 08:49:10 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="521b3aa189ed37bed570c730885545c3";
logging-data="7694"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188KbYyIIkPhgkFemtpqpWXzRf5Qo4IEU8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:QqzeErkiGxevPRv5LuOHg3HiKwI=
In-Reply-To: <safbnl$pg9$1@dont-email.me>
Content-Language: en-US
 by: Silver Dream ! - Wed, 30 Jun 2021 08:49 UTC

On 17.06.2021 13:29, Tilmann Hentze wrote:

>> main
>> lda #$07 ; Length of file name
>> ldx #<filename ; Low byte of file name location
>> 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 #<flash ; Low byte of start of memory block to save
>> 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.

Re: Closing a file in Assembly on the VIC-20

<sbhb9s$7ge$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=173&group=comp.sys.cbm#173

  copy link   Newsgroups: comp.sys.cbm
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: silve...@nospam.net (Silver Dream !)
Newsgroups: comp.sys.cbm
Subject: Re: Closing a file in Assembly on the VIC-20
Date: Wed, 30 Jun 2021 10:51:08 +0200
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <sbhb9s$7ge$2@dont-email.me>
References: <saf2mm$te7$1@dont-email.me> <sm0h7hvipfe.fsf@lakka.kapsi.fi>
<sahk1n$tvh$1@dont-email.me> <87tulvvttb.fsf@usenet.ankman.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 30 Jun 2021 08:51:08 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="521b3aa189ed37bed570c730885545c3";
logging-data="7694"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19m1+p87NepJN1i06tPKGwRKjcLp/0lhV8="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:aLi8MTjWYTe/GDDshsRuBdx20iM=
In-Reply-To: <87tulvvttb.fsf@usenet.ankman.de>
Content-Language: en-US
 by: Silver Dream ! - Wed, 30 Jun 2021 08:51 UTC

On 18.06.2021 21:47, Andreas Kohlbach wrote:

> And the delay when physically writing a file does not occur in
> emulators. That's why it worked in VICE right away.
>
> Hmm, VICE has "true drive emulation". I wonder what happens if activated...

Then it emulates the real machine's behaviour at much more accurately.
Keep it set.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor