Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.apple2.programmer > #2736 > unrolled thread
| Started by | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| First post | 2016-05-20 13:56 -0500 |
| Last post | 2016-05-22 01:52 -0500 |
| Articles | 18 — 5 participants |
Back to article view | Back to comp.sys.apple2.programmer
Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-20 13:56 -0500
Re: Using ProDOS DOSCMD mmphosis <mmphosis@macgui.com> - 2016-05-21 01:06 +0000
Re: Using ProDOS DOSCMD Antoine Vignau <antoine.vignau@laposte.net> - 2016-05-21 02:44 -0700
Re: Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-22 01:52 -0500
Re: Using ProDOS DOSCMD gids.rs@sasktel.net - 2016-05-22 16:52 -0700
Re: Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-23 00:54 -0500
Re: Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-23 15:48 -0500
Re: Using ProDOS DOSCMD gids.rs@sasktel.net - 2016-05-23 21:49 -0700
Re: Using ProDOS DOSCMD Antoine Vignau <antoine.vignau@laposte.net> - 2016-05-24 00:28 -0700
Re: Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-24 14:32 -0500
Re: Using ProDOS DOSCMD Antoine Vignau <antoine.vignau@laposte.net> - 2016-05-24 15:02 -0700
Re: Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-25 10:56 -0500
Re: Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-25 10:56 -0500
Re: Using ProDOS DOSCMD Antoine Vignau <antoine.vignau@laposte.net> - 2016-05-25 14:09 -0700
Re: Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-25 17:01 -0500
Re: Using ProDOS DOSCMD gids.rs@sasktel.net - 2016-05-25 22:00 -0700
Re: Using ProDOS DOSCMD Michael Pohoreski <michael.pohoreski@gmail.com> - 2016-05-28 09:07 -0700
Re: Using ProDOS DOSCMD Michael J. Mahon <mjmahon@aol.com> - 2016-05-22 01:52 -0500
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-20 13:56 -0500 |
| Subject | Using ProDOS DOSCMD |
| Message-ID | <d7-dnVVxcK9YwKLKnZ2dnUU7-U_NnZ2d@giganews.com> |
I'm writing an assembler program that will run with BASIC.SYSTEM, and I'd like to use DOSCMD to handle some disk I/O. I'm using a lot of page 0 space, from $80 to $CA, trying to stay out of ProDOS and BASIC.SYSTEM's way, but I still observe some unintended consequences: a blank line is printed after each BSAVE request, and some COUT variables seem to be disturbed. The BSAVE itself seems to work fine. Is there some way of minimizing or eliminating the side effects? -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [next] | [standalone]
| From | mmphosis <mmphosis@macgui.com> |
|---|---|
| Date | 2016-05-21 01:06 +0000 |
| Message-ID | <mmphosis-1463793000@macgui.com> |
| In reply to | #2736 |
I am not familiar with DOSCMD, but this is what I would do... JSR save80toCA ; at the beginning of your program ; ... your code that disturbs 80 to CA JSR swap80toCA ; before calling DOSCMD ; call DOSCMD JSR swap80toCA ; after calling DOSCMD ; ... more of your code that uses 80 to CA JSR swap80toCA ; might want to do this again before quitting your code. I did something similar to this in "Apple-1 for Apple II" to save and restore critical pages of memory that I clobber with my code.
[toc] | [prev] | [next] | [standalone]
| From | Antoine Vignau <antoine.vignau@laposte.net> |
|---|---|
| Date | 2016-05-21 02:44 -0700 |
| Message-ID | <2a2025d5-b240-45f6-bc1c-76d7526a6d16@googlegroups.com> |
| In reply to | #2737 |
Hi Michael, According to its source code, the BASIC INTERPRETER (here for 1.5) adds "clear end of line" + "carriage return" for deferred commands, see LDA STATE BNE SYNTX1A ;NO CR IF IMMEDIATE MODE. LDA EXACTV BNE SYNTX1A ;OR IF FROM EXEC FILE JSR CLEOL JSR CROUT SYNTX1A LDA #0 ;BUT FIRST, CLEAR 'FOUND PARAMETERS' BYTES. STATE is 0 for immediate commands, non zero for the others. Apart from changing the value of STATE ($BE42), or patching the code, I do not think of other possibilities yet. This is the code generated by the source above: 00/A6AA: AD 42 BE LDA BE42 00/A6AD: D0 0B BNE A6BA ;+0B= 00/A6AF: AD 43 BE LDA BE43 00/A6B2: D0 06 BNE A6BA ;+06= 00/A6B4: 20 9C FC JSR FC9C 00/A6B7: 20 AF 9F JSR 9FAF 00/A6BA: A9 00 LDA #00 Antoine
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-22 01:52 -0500 |
| Message-ID | <Ia6dnRA0e6yzytzKnZ2dnUU7-anNnZ2d@giganews.com> |
| In reply to | #2738 |
Antoine Vignau <antoine.vignau@laposte.net> wrote: > Hi Michael, > > According to its source code, the BASIC INTERPRETER (here for 1.5) adds > "clear end of line" + "carriage return" for deferred commands, see > > LDA STATE > BNE SYNTX1A ;NO CR IF IMMEDIATE MODE. > LDA EXACTV > BNE SYNTX1A ;OR IF FROM EXEC FILE > JSR CLEOL > JSR CROUT > SYNTX1A LDA #0 ;BUT FIRST, CLEAR 'FOUND PARAMETERS' BYTES. > > STATE is 0 for immediate commands, non zero for the others. Apart from > changing the value of STATE ($BE42), or patching the code, I do not think > of other possibilities yet. > > This is the code generated by the source above: > 00/A6AA: AD 42 BE LDA BE42 > 00/A6AD: D0 0B BNE A6BA ;+0B= > 00/A6AF: AD 43 BE LDA BE43 > 00/A6B2: D0 06 BNE A6BA ;+06= > 00/A6B4: 20 9C FC JSR FC9C > 00/A6B7: 20 AF 9F JSR 9FAF > 00/A6BA: A9 00 LDA #00 > > Antoine > Interesting, Antoine. The ProDOS Technical Ref specifies that DOSCMD should be called from deferred mode, and unhelpfully declares that things may not work correctly otherwise. I'm pretty disappointed that BASIC.SYSTEM authors cared enough to provide the DOSCMD interface, but didn't bother to provide the details that would make it generally useful. I note that this code snippet doesn't refer to anything on page zero, though I think that AppleSoft keeps an "immediate/deferred" flag on page zero, too. I was hoping that someone had written a program that used DOSCMD for its disk interface and had determined what byte or two needed tweaking to make BASIC.SYSTEM happy. If worse comes to worst, I can always implement a direct MLI interface, but I was hoping to avoid reimplementing the wheel... -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [next] | [standalone]
| From | gids.rs@sasktel.net |
|---|---|
| Date | 2016-05-22 16:52 -0700 |
| Message-ID | <87948c82-2f2b-4bec-a28b-a5db6bb5a987@googlegroups.com> |
| In reply to | #2739 |
On Sunday, May 22, 2016 at 12:52:31 AM UTC-6, mjm...@aol.com wrote: > Antoine Vignau <antoine> wrote: > > Hi Michael, > > > > According to its source code, the BASIC INTERPRETER (here for 1.5) adds > > "clear end of line" + "carriage return" for deferred commands, see > > > > LDA STATE > > BNE SYNTX1A ;NO CR IF IMMEDIATE MODE. > > LDA EXACTV > > BNE SYNTX1A ;OR IF FROM EXEC FILE > > JSR CLEOL > > JSR CROUT > > SYNTX1A LDA #0 ;BUT FIRST, CLEAR 'FOUND PARAMETERS' BYTES. > > > > STATE is 0 for immediate commands, non zero for the others. Apart from > > changing the value of STATE ($BE42), or patching the code, I do not think > > of other possibilities yet. > > > > This is the code generated by the source above: > > 00/A6AA: AD 42 BE LDA BE42 > > 00/A6AD: D0 0B BNE A6BA ;+0B= > > 00/A6AF: AD 43 BE LDA BE43 > > 00/A6B2: D0 06 BNE A6BA ;+06= > > 00/A6B4: 20 9C FC JSR FC9C > > 00/A6B7: 20 AF 9F JSR 9FAF > > 00/A6BA: A9 00 LDA #00 > > > > Antoine > > > Interesting, Antoine. The ProDOS Technical Ref specifies that DOSCMD should > be called from deferred mode, and unhelpfully declares that things may not > work correctly otherwise. > > I'm pretty disappointed that BASIC.SYSTEM authors cared enough to provide > the DOSCMD interface, but didn't bother to provide the details that would > make it generally useful. > > I note that this code snippet doesn't refer to anything on page zero, > though I think that AppleSoft keeps an "immediate/deferred" flag on page > zero, too. > > I was hoping that someone had written a program that used DOSCMD for its > disk interface and had determined what byte or two needed tweaking to make > BASIC.SYSTEM happy. > > If worse comes to worst, I can always implement a direct MLI interface, but > I was hoping to avoid reimplementing the wheel... > -- > -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com Your problem sounds the same as I had with my squirt file selector, it expected to be launched from deferred mode. I can't remember all I did, but I remember I had to initialize applesoft from a system file, and I had to also fool the system file that it was still in deferred mode to launch some commands. To initialize applesoft, I did it this way: LDA #L2010 ; lo-byte STA $38 LDA #<L2010 ; hi-byte STA $39 JMP $E000 L2010 - your program starts here And I am pretty sure all I did to fool my system program that it was still in deferred mode was store a $FF at zero-page $76. This may be getting changed when launching DOSCMD. Rob
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-23 00:54 -0500 |
| Message-ID | <9eOdne1cc6C8Bt_KnZ2dnUU7-L3NnZ2d@giganews.com> |
| In reply to | #2741 |
<gids.rs@sasktel.net> wrote: > On Sunday, May 22, 2016 at 12:52:31 AM UTC-6, mjm...@aol.com wrote: >> Antoine Vignau <antoine> wrote: >>> Hi Michael, >>> >>> According to its source code, the BASIC INTERPRETER (here for 1.5) adds >>> "clear end of line" + "carriage return" for deferred commands, see >>> >>> LDA STATE >>> BNE SYNTX1A ;NO CR IF IMMEDIATE MODE. >>> LDA EXACTV >>> BNE SYNTX1A ;OR IF FROM EXEC FILE >>> JSR CLEOL >>> JSR CROUT >>> SYNTX1A LDA #0 ;BUT FIRST, CLEAR 'FOUND PARAMETERS' BYTES. >>> >>> STATE is 0 for immediate commands, non zero for the others. Apart from >>> changing the value of STATE ($BE42), or patching the code, I do not think >>> of other possibilities yet. >>> >>> This is the code generated by the source above: >>> 00/A6AA: AD 42 BE LDA BE42 >>> 00/A6AD: D0 0B BNE A6BA ;+0B= >>> 00/A6AF: AD 43 BE LDA BE43 >>> 00/A6B2: D0 06 BNE A6BA ;+06= >>> 00/A6B4: 20 9C FC JSR FC9C >>> 00/A6B7: 20 AF 9F JSR 9FAF >>> 00/A6BA: A9 00 LDA #00 >>> >>> Antoine >>> >> Interesting, Antoine. The ProDOS Technical Ref specifies that DOSCMD should >> be called from deferred mode, and unhelpfully declares that things may not >> work correctly otherwise. >> >> I'm pretty disappointed that BASIC.SYSTEM authors cared enough to provide >> the DOSCMD interface, but didn't bother to provide the details that would >> make it generally useful. >> >> I note that this code snippet doesn't refer to anything on page zero, >> though I think that AppleSoft keeps an "immediate/deferred" flag on page >> zero, too. >> >> I was hoping that someone had written a program that used DOSCMD for its >> disk interface and had determined what byte or two needed tweaking to make >> BASIC.SYSTEM happy. >> >> If worse comes to worst, I can always implement a direct MLI interface, but >> I was hoping to avoid reimplementing the wheel... >> -- >> -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com > > > > Your problem sounds the same as I had with my squirt file selector, it > expected to be launched from deferred mode. > > I can't remember all I did, but I remember I had to initialize applesoft > from a system file, and I had to also fool the system file that it was > still in deferred mode to launch some commands. > > To initialize applesoft, I did it this way: > > LDA #L2010 ; lo-byte > STA $38 > LDA #<L2010 ; hi-byte > STA $39 > JMP $E000 > > L2010 - your program starts here > > And I am pretty sure all I did to fool my system program that it was > still in deferred mode was store a $FF at zero-page $76. This may be > getting changed when launching DOSCMD. > > Rob > Progress report: I launch the binary file from BASIC with a smart RUN, save all the page zero that I'm using, then swap BASIC's page zero back before invoking DOSCMD, and swap again after. The exact same screen scramble occurs! If I quit to the monitor and issue some memory-examining commands, then go to my restart routine, the screen is perfect... Clearly, something subtle is changing, but I haven't found it yet. I love to watch the screen being painted, but I can't figure out how to switch between APPLEWIN's debug screen and the emulated Apple screen, or, even better, see them both at once. I've read the debugger docs several times, but can't see how to switch screens. I'm sure it's easy, and I just don't see it... -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-23 15:48 -0500 |
| Message-ID | <HLqdnZMJA_sV8d7KnZ2dnUU7-WnNnZ2d@giganews.com> |
| In reply to | #2742 |
Michael J. Mahon <mjmahon@aol.com> wrote: > <gids.rs@sasktel.net> wrote: >> On Sunday, May 22, 2016 at 12:52:31 AM UTC-6, mjm...@aol.com wrote: >>> Antoine Vignau <antoine> wrote: >>>> Hi Michael, >>>> >>>> According to its source code, the BASIC INTERPRETER (here for 1.5) adds >>>> "clear end of line" + "carriage return" for deferred commands, see >>>> >>>> LDA STATE >>>> BNE SYNTX1A ;NO CR IF IMMEDIATE MODE. >>>> LDA EXACTV >>>> BNE SYNTX1A ;OR IF FROM EXEC FILE >>>> JSR CLEOL >>>> JSR CROUT >>>> SYNTX1A LDA #0 ;BUT FIRST, CLEAR 'FOUND PARAMETERS' BYTES. >>>> >>>> STATE is 0 for immediate commands, non zero for the others. Apart from >>>> changing the value of STATE ($BE42), or patching the code, I do not think >>>> of other possibilities yet. >>>> >>>> This is the code generated by the source above: >>>> 00/A6AA: AD 42 BE LDA BE42 >>>> 00/A6AD: D0 0B BNE A6BA ;+0B= >>>> 00/A6AF: AD 43 BE LDA BE43 >>>> 00/A6B2: D0 06 BNE A6BA ;+06= >>>> 00/A6B4: 20 9C FC JSR FC9C >>>> 00/A6B7: 20 AF 9F JSR 9FAF >>>> 00/A6BA: A9 00 LDA #00 >>>> >>>> Antoine >>>> >>> Interesting, Antoine. The ProDOS Technical Ref specifies that DOSCMD should >>> be called from deferred mode, and unhelpfully declares that things may not >>> work correctly otherwise. >>> >>> I'm pretty disappointed that BASIC.SYSTEM authors cared enough to provide >>> the DOSCMD interface, but didn't bother to provide the details that would >>> make it generally useful. >>> >>> I note that this code snippet doesn't refer to anything on page zero, >>> though I think that AppleSoft keeps an "immediate/deferred" flag on page >>> zero, too. >>> >>> I was hoping that someone had written a program that used DOSCMD for its >>> disk interface and had determined what byte or two needed tweaking to make >>> BASIC.SYSTEM happy. >>> >>> If worse comes to worst, I can always implement a direct MLI interface, but >>> I was hoping to avoid reimplementing the wheel... >>> -- >>> -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com >> >> >> >> Your problem sounds the same as I had with my squirt file selector, it >> expected to be launched from deferred mode. >> >> I can't remember all I did, but I remember I had to initialize applesoft >> from a system file, and I had to also fool the system file that it was >> still in deferred mode to launch some commands. >> >> To initialize applesoft, I did it this way: >> >> LDA #L2010 ; lo-byte >> STA $38 >> LDA #<L2010 ; hi-byte >> STA $39 >> JMP $E000 >> >> L2010 - your program starts here >> >> And I am pretty sure all I did to fool my system program that it was >> still in deferred mode was store a $FF at zero-page $76. This may be >> getting changed when launching DOSCMD. >> >> Rob >> > > Progress report: I launch the binary file from BASIC with a smart RUN, > save all the page zero that I'm using, then swap BASIC's page zero back > before invoking DOSCMD, and swap again after. > > The exact same screen scramble occurs! > > If I quit to the monitor and issue some memory-examining commands, then go > to my restart routine, the screen is perfect... Clearly, something subtle > is changing, but I haven't found it yet. > > I love to watch the screen being painted, but I can't figure out how to > switch between APPLEWIN's debug screen and the emulated Apple screen, or, > even better, see them both at once. I've read the debugger docs several > times, but can't see how to switch screens. > > I'm sure it's easy, and I just don't see it... Antoine, I set $BE42 to $FF prior to my DOSCMD call, and the blank line is suppressed. Thank you for that! Unfortunately, HOME still doesn't work after the call, probably for the same reason that my subsequent screen painting doesn't work. My first 3-line write, using COUT, appears to work fine, ending with a CR. But the next 1-line write overwrites the last line of the first write--as if the CR didn't move the cursor to the next line. This pattern persists, with every other line write overwriting the previous line, with occasional non-zero horizontal cursor positions following final CRs. After I exit my program (back to BASIC), and entering the monitor, I set WNDTOP back to 0 and call HOME, and get a BRK at $8F02 on the first call. On the second call, HOME works and then warm restarting my program repaints the screen perfectly! I'm beginning to suspect some softswitch... -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [next] | [standalone]
| From | gids.rs@sasktel.net |
|---|---|
| Date | 2016-05-23 21:49 -0700 |
| Message-ID | <ac52ae27-9e39-4173-adb4-60781f8ee574@googlegroups.com> |
| In reply to | #2744 |
On Monday, May 23, 2016 at 2:48:10 PM UTC-6, mjm...@aol.com wrote: > Michael J. Mahon wrote: > > <Rob> wrote: > >> On Sunday, May 22, 2016 at 12:52:31 AM UTC-6, Michael wrote: > >>> Antoine Vignau <antoine> wrote: > >>>> Hi Michael, > >>>> > >>>> According to its source code, the BASIC INTERPRETER (here for 1.5) adds > >>>> "clear end of line" + "carriage return" for deferred commands, see > >>>> > >>>> LDA STATE > >>>> BNE SYNTX1A ;NO CR IF IMMEDIATE MODE. > >>>> LDA EXACTV > >>>> BNE SYNTX1A ;OR IF FROM EXEC FILE > >>>> JSR CLEOL > >>>> JSR CROUT > >>>> SYNTX1A LDA #0 ;BUT FIRST, CLEAR 'FOUND PARAMETERS' BYTES. > >>>> > >>>> STATE is 0 for immediate commands, non zero for the others. Apart from > >>>> changing the value of STATE ($BE42), or patching the code, I do not think > >>>> of other possibilities yet. > >>>> > >>>> This is the code generated by the source above: > >>>> 00/A6AA: AD 42 BE LDA BE42 > >>>> 00/A6AD: D0 0B BNE A6BA ;+0B= > >>>> 00/A6AF: AD 43 BE LDA BE43 > >>>> 00/A6B2: D0 06 BNE A6BA ;+06= > >>>> 00/A6B4: 20 9C FC JSR FC9C > >>>> 00/A6B7: 20 AF 9F JSR 9FAF > >>>> 00/A6BA: A9 00 LDA #00 > >>>> > >>>> Antoine > >>>> > >>> Interesting, Antoine. The ProDOS Technical Ref specifies that DOSCMD should > >>> be called from deferred mode, and unhelpfully declares that things may not > >>> work correctly otherwise. > >>> > >>> I'm pretty disappointed that BASIC.SYSTEM authors cared enough to provide > >>> the DOSCMD interface, but didn't bother to provide the details that would > >>> make it generally useful. > >>> > >>> I note that this code snippet doesn't refer to anything on page zero, > >>> though I think that AppleSoft keeps an "immediate/deferred" flag on page > >>> zero, too. > >>> > >>> I was hoping that someone had written a program that used DOSCMD for its > >>> disk interface and had determined what byte or two needed tweaking to make > >>> BASIC.SYSTEM happy. > >>> > >>> If worse comes to worst, I can always implement a direct MLI interface, but > >>> I was hoping to avoid reimplementing the wheel... > >>> -- > >>> -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com > >> > >> > >> > >> Your problem sounds the same as I had with my squirt file selector, it > >> expected to be launched from deferred mode. > >> > >> I can't remember all I did, but I remember I had to initialize applesoft > >> from a system file, and I had to also fool the system file that it was > >> still in deferred mode to launch some commands. > >> > >> To initialize applesoft, I did it this way: > >> > >> LDA #L2010 ; lo-byte > >> STA $38 > >> LDA #<L2010 ; hi-byte > >> STA $39 > >> JMP $E000 > >> > >> L2010 - your program starts here > >> > >> And I am pretty sure all I did to fool my system program that it was > >> still in deferred mode was store a $FF at zero-page $76. This may be > >> getting changed when launching DOSCMD. > >> > >> Rob > >> > > > > Progress report: I launch the binary file from BASIC with a smart RUN, > > save all the page zero that I'm using, then swap BASIC's page zero back > > before invoking DOSCMD, and swap again after. > > > > The exact same screen scramble occurs! > > > > If I quit to the monitor and issue some memory-examining commands, then go > > to my restart routine, the screen is perfect... Clearly, something subtle > > is changing, but I haven't found it yet. > > > > I love to watch the screen being painted, but I can't figure out how to > > switch between APPLEWIN's debug screen and the emulated Apple screen, or, > > even better, see them both at once. I've read the debugger docs several > > times, but can't see how to switch screens. > > > > I'm sure it's easy, and I just don't see it... > > Antoine, I set $BE42 to $FF prior to my DOSCMD call, and the blank line is > suppressed. Thank you for that! > > Unfortunately, HOME still doesn't work after the call, probably for the > same reason that my subsequent screen painting doesn't work. > > My first 3-line write, using COUT, appears to work fine, ending with a CR. > But the next 1-line write overwrites the last line of the first write--as > if the CR didn't move the cursor to the next line. > > This pattern persists, with every other line write overwriting the previous > line, with occasional non-zero horizontal cursor positions following final > CRs. > > After I exit my program (back to BASIC), and entering the monitor, I set > WNDTOP back to 0 and call HOME, and get a BRK at $8F02 on the first call. > On the second call, HOME works and then warm restarting my program repaints > the screen perfectly! > > I'm beginning to suspect some softswitch... > -- > -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com Or maybe something as simple as a clear decimal (CLD) at the beginning of your program. I know that has messed me up on an occasion or two. I know this is pretty obvious, but you don't say if you are using 40 or 80 columns, have the video routines been initialized ($FE93 or $C300)?
[toc] | [prev] | [next] | [standalone]
| From | Antoine Vignau <antoine.vignau@laposte.net> |
|---|---|
| Date | 2016-05-24 00:28 -0700 |
| Message-ID | <5dcbff67-1432-4b07-b11b-591211e91ca8@googlegroups.com> |
| In reply to | #2745 |
I was reading Gary Little's Exploring the Apple GS/OS and ProDOS 8 (Addison-Wesley Publishing Company, ISBN 0-201-15008-5) which is for me, the best book about Apple II OSes and page 236 is about the I/O links. It is worth reading. Do you have the book? Want a scan of the pages? Antoine
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-24 14:32 -0500 |
| Message-ID | <2LqdnUcwzNvXMdnKnZ2dnUU7-S_NnZ2d@giganews.com> |
| In reply to | #2746 |
Antoine Vignau <antoine.vignau@laposte.net> wrote: > I was reading Gary Little's Exploring the Apple GS/OS and ProDOS 8 > (Addison-Wesley Publishing Company, ISBN 0-201-15008-5) which is for me, > the best book about Apple II OSes and page 236 is about the I/O links. It is worth reading. > > Do you have the book? Want a scan of the pages? > > Antoine > No, I don't have that one. I'd appreciate a scan, thank you! -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [next] | [standalone]
| From | Antoine Vignau <antoine.vignau@laposte.net> |
|---|---|
| Date | 2016-05-24 15:02 -0700 |
| Message-ID | <7aa8d346-4285-4642-b578-5c837fa666b0@googlegroups.com> |
| In reply to | #2747 |
Michael, The first three interesting pages @ http://www.brutaldeluxe.fr/public/gl/ av
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-25 10:56 -0500 |
| Message-ID | <COWdnR7Ur6OoVtjKnZ2dnUU7-YXNnZ2d@giganews.com> |
| In reply to | #2748 |
Antoine Vignau <antoine.vignau@laposte.net> wrote: > Michael, > The first three interesting pages @ http://www.brutaldeluxe.fr/public/gl/ > av > Thank you, Antoine. So far, I seem to be following all the rules... ;-) -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-25 10:56 -0500 |
| Message-ID | <COWdnRnUr6OrVtjKnZ2dnUU7-YVQAAAA@giganews.com> |
| In reply to | #2745 |
<gids.rs@sasktel.net> wrote: > On Monday, May 23, 2016 at 2:48:10 PM UTC-6, mjm...@aol.com wrote: >> Michael J. Mahon wrote: >>> <Rob> wrote: >>>> On Sunday, May 22, 2016 at 12:52:31 AM UTC-6, Michael wrote: >>>>> Antoine Vignau <antoine> wrote: >>>>>> Hi Michael, >>>>>> >>>>>> According to its source code, the BASIC INTERPRETER (here for 1.5) adds >>>>>> "clear end of line" + "carriage return" for deferred commands, see >>>>>> >>>>>> LDA STATE >>>>>> BNE SYNTX1A ;NO CR IF IMMEDIATE MODE. >>>>>> LDA EXACTV >>>>>> BNE SYNTX1A ;OR IF FROM EXEC FILE >>>>>> JSR CLEOL >>>>>> JSR CROUT >>>>>> SYNTX1A LDA #0 ;BUT FIRST, CLEAR 'FOUND PARAMETERS' BYTES. >>>>>> >>>>>> STATE is 0 for immediate commands, non zero for the others. Apart from >>>>>> changing the value of STATE ($BE42), or patching the code, I do not think >>>>>> of other possibilities yet. >>>>>> >>>>>> This is the code generated by the source above: >>>>>> 00/A6AA: AD 42 BE LDA BE42 >>>>>> 00/A6AD: D0 0B BNE A6BA ;+0B= >>>>>> 00/A6AF: AD 43 BE LDA BE43 >>>>>> 00/A6B2: D0 06 BNE A6BA ;+06= >>>>>> 00/A6B4: 20 9C FC JSR FC9C >>>>>> 00/A6B7: 20 AF 9F JSR 9FAF >>>>>> 00/A6BA: A9 00 LDA #00 >>>>>> >>>>>> Antoine >>>>>> >>>>> Interesting, Antoine. The ProDOS Technical Ref specifies that DOSCMD should >>>>> be called from deferred mode, and unhelpfully declares that things may not >>>>> work correctly otherwise. >>>>> >>>>> I'm pretty disappointed that BASIC.SYSTEM authors cared enough to provide >>>>> the DOSCMD interface, but didn't bother to provide the details that would >>>>> make it generally useful. >>>>> >>>>> I note that this code snippet doesn't refer to anything on page zero, >>>>> though I think that AppleSoft keeps an "immediate/deferred" flag on page >>>>> zero, too. >>>>> >>>>> I was hoping that someone had written a program that used DOSCMD for its >>>>> disk interface and had determined what byte or two needed tweaking to make >>>>> BASIC.SYSTEM happy. >>>>> >>>>> If worse comes to worst, I can always implement a direct MLI interface, but >>>>> I was hoping to avoid reimplementing the wheel... >>>>> -- >>>>> -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com >>>> >>>> >>>> >>>> Your problem sounds the same as I had with my squirt file selector, it >>>> expected to be launched from deferred mode. >>>> >>>> I can't remember all I did, but I remember I had to initialize applesoft >>>> from a system file, and I had to also fool the system file that it was >>>> still in deferred mode to launch some commands. >>>> >>>> To initialize applesoft, I did it this way: >>>> >>>> LDA #L2010 ; lo-byte >>>> STA $38 >>>> LDA #<L2010 ; hi-byte >>>> STA $39 >>>> JMP $E000 >>>> >>>> L2010 - your program starts here >>>> >>>> And I am pretty sure all I did to fool my system program that it was >>>> still in deferred mode was store a $FF at zero-page $76. This may be >>>> getting changed when launching DOSCMD. >>>> >>>> Rob >>>> >>> >>> Progress report: I launch the binary file from BASIC with a smart RUN, >>> save all the page zero that I'm using, then swap BASIC's page zero back >>> before invoking DOSCMD, and swap again after. >>> >>> The exact same screen scramble occurs! >>> >>> If I quit to the monitor and issue some memory-examining commands, then go >>> to my restart routine, the screen is perfect... Clearly, something subtle >>> is changing, but I haven't found it yet. >>> >>> I love to watch the screen being painted, but I can't figure out how to >>> switch between APPLEWIN's debug screen and the emulated Apple screen, or, >>> even better, see them both at once. I've read the debugger docs several >>> times, but can't see how to switch screens. >>> >>> I'm sure it's easy, and I just don't see it... >> >> Antoine, I set $BE42 to $FF prior to my DOSCMD call, and the blank line is >> suppressed. Thank you for that! >> >> Unfortunately, HOME still doesn't work after the call, probably for the >> same reason that my subsequent screen painting doesn't work. >> >> My first 3-line write, using COUT, appears to work fine, ending with a CR. >> But the next 1-line write overwrites the last line of the first write--as >> if the CR didn't move the cursor to the next line. >> >> This pattern persists, with every other line write overwriting the previous >> line, with occasional non-zero horizontal cursor positions following final >> CRs. >> >> After I exit my program (back to BASIC), and entering the monitor, I set >> WNDTOP back to 0 and call HOME, and get a BRK at $8F02 on the first call. >> On the second call, HOME works and then warm restarting my program repaints >> the screen perfectly! >> >> I'm beginning to suspect some softswitch... >> -- >> -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com > > > Or maybe something as simple as a clear decimal (CLD) at the beginning of > your program. I know that has messed me up on an occasion or two. > > I know this is pretty obvious, but you don't say if you are using 40 or > 80 columns, have the video routines been initialized ($FE93 or $C300)? > Yes, the 80-col firmware has been initialized, then disconnected by sending a NAK ($15), and multiple 40-col requests have been made successfully. I'm using BCD mode in several places, and I think of SED/CLD as opening and closing parentheses, so I was confident that I was not still in decimal mode... But I was! Thank you for the whack upside the head! When I inserted a CLD before my screen repaint routine, everything worked as intended! Now I will easily locate where control is escaping from one of my bracketed BCD code regions. This is (another) example of how being "certain" of something that "just ain't so" can blind one to what is actually going on. ;-( -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [next] | [standalone]
| From | Antoine Vignau <antoine.vignau@laposte.net> |
|---|---|
| Date | 2016-05-25 14:09 -0700 |
| Message-ID | <f3fe480e-9658-4948-8a56-e8e1529f6cbe@googlegroups.com> |
| In reply to | #2750 |
Very good, congratulations for squashing that bug. Is 10 in decimal or binary ;-) Antoine
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-25 17:01 -0500 |
| Message-ID | <OMWdne40LslKvdvKnZ2dnUU7-WfNnZ2d@giganews.com> |
| In reply to | #2751 |
Antoine Vignau <antoine.vignau@laposte.net> wrote: > Very good, congratulations for squashing that bug. > > Is 10 in decimal or binary ;-) > > Antoine > Ha! You know, after a careful review of my code, and watching the Decimal flag status in AppleWin, I still don't see my code leaving the flag set when calling BASIC.SYSTEM or exiting. But putting a CLD in front of my screen painting subroutine makes the problem go away... Wierd. I don't use interrupts in my code, but I don't disable them, either. (And I thought all interrupt handlers start with a CLD, anyway). At this point, I'll worry about it later--though I hate unexplained weirdness. ;-) -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [next] | [standalone]
| From | gids.rs@sasktel.net |
|---|---|
| Date | 2016-05-25 22:00 -0700 |
| Message-ID | <037b2cee-59e3-4e51-90eb-1994c88ca045@googlegroups.com> |
| In reply to | #2750 |
> I'm using BCD mode in several places, and I think of SED/CLD as opening and > closing parentheses, so I was confident that I was not still in decimal > mode... But I was! > > Thank you for the whack upside the head! Any time. (Now I got that picture in my head of the first Ice Age movie when Manny knocks Sid over the head to make the baby laugh) (But to keep it Apple II related, I am sure the writers could have fit an Apple II computer into at least one of the Ice Age movie scripts somewhere)(The best place would have been in Ice Age 3-Dinosaur one where Scrat falls in love and is moving the couch around the tree house. It could have showed him playing video games on an Apple II instead and she is trying to get his attention :) Sorry for that, My brain goes into dreamland mode sometimes.
[toc] | [prev] | [next] | [standalone]
| From | Michael Pohoreski <michael.pohoreski@gmail.com> |
|---|---|
| Date | 2016-05-28 09:07 -0700 |
| Message-ID | <83334dd7-e99e-4380-820f-fcaf243cbc82@googlegroups.com> |
| In reply to | #2742 |
On Sunday, May 22, 2016 at 10:54:42 PM UTC-7, mjm...@aol.com wrote: > I love to watch the screen being painted, but I can't figure out how to > switch between APPLEWIN's debug screen and the emulated Apple screen, or, > even better, see them both at once. I've read the debugger docs several > times, but can't see how to switch screens. You can't seem them both at once but from the debugger you can see any mode: F7 // To view 40-col page 1 TEXT // To view 40-col page 2 TEXT2 // To view 80-col page 1 TEXT80 // To view 80-col page 2 TEXT82 You'll need to press a key to exit viewing mode and return to the debugger. Unfortunately CAPS, SHIFT, CTRL, or ALT won't work (guess I need to raise a bug report for that.) I'd recommend TAB.
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2016-05-22 01:52 -0500 |
| Message-ID | <Ia6dnRM0e6yzytzKnZ2dnUU7-alQAAAA@giganews.com> |
| In reply to | #2737 |
mmphosis <mmphosis@macgui.com> wrote: > I am not familiar with DOSCMD, but this is what I would do... > > > > JSR save80toCA ; at the beginning of your program > > ; ... your code that disturbs 80 to CA > > JSR swap80toCA ; before calling DOSCMD > > ; call DOSCMD > > JSR swap80toCA ; after calling DOSCMD > > ; ... more of your code that uses 80 to CA > > JSR swap80toCA ; might want to do this again before quitting your code. > > > > I did something similar to this in "Apple-1 for Apple II" to save and > restore critical pages of memory that I clobber with my code. Thanks for your suggestion--I'll give it a try to see how much better it works. But it does seem like using a cannon to shoot a mouse, since there can't be much page zero state that is relevant to the DOSCMD entry point. Interestingly, aside from the unwanted blank line, the command also seems to leave COUT in a peculiar state, since a subsequent HOME and COUT calls result in a scrambled display. Oh, and this is done while the alternate character set is selected--which BASIC.SYSTEM may not preserve. I specifically used a page zero region which is documented as used only by AppleSoft precisely to avoid having to save and restore state. I'm guessing that there is a byte or two that participate in BASIC.SYSTEM processing of a BSAVE command--and I need to find out which ones. ;-) The most tantalizing thing is that it *almost* works... ;-) -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.sys.apple2.programmer
csiph-web