Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #5022 > unrolled thread

Language card on ][+

Started byschampailler@skynet.be
First post2019-03-17 09:03 -0700
Last post2019-03-18 09:47 -0700
Articles 11 — 5 participants

Back to article view | Back to comp.sys.apple2.programmer


Contents

  Language card on ][+ schampailler@skynet.be - 2019-03-17 09:03 -0700
    Re: Language card on ][+ D Finnigan <dog_cow@macgui.com> - 2019-03-17 19:29 +0000
      Re: Language card on ][+ schampailler@skynet.be - 2019-03-17 12:40 -0700
        Re: Language card on ][+ D Finnigan <dog_cow@macgui.com> - 2019-03-17 19:50 +0000
          Re: Language card on ][+ Michael Pohoreski <michael.pohoreski@gmail.com> - 2019-03-18 09:01 -0700
        Re: Language card on ][+ qkumba <peter.ferrie@gmail.com> - 2019-03-17 21:16 -0700
    Re: Language card on ][+ Tom Porter <laseractiveguy@gmail.com> - 2019-03-18 00:03 -0700
    Language card on ][+ Michael Pohoreski <michael.pohoreski@gmail.com> - 2019-03-18 09:31 -0700
      Language card on ][+ Michael Pohoreski <michael.pohoreski@gmail.com> - 2019-03-18 09:38 -0700
      Re: Language card on ][+ Michael Pohoreski <michael.pohoreski@gmail.com> - 2019-03-18 09:50 -0700
    Re: Language card on ][+ Tom Porter <laseractiveguy@gmail.com> - 2019-03-18 09:47 -0700

#5022 — Language card on ][+

Fromschampailler@skynet.be
Date2019-03-17 09:03 -0700
SubjectLanguage card on ][+
Message-ID<791ead48-3b52-4dc9-866c-f4553400ad18@googlegroups.com>
Hello,

(using AppleWin 'cos I've no Apple :-( )

I'm trying to understand what the langue card does on an Apple ][+. According to the operating manual, I understand the LC can give access to more RAM (one 4K bank switched and one 12K non switched). However, when I write to, say $F400, I sure don't see anything written.

With the monitor :

call -151
*F400 ; read

F400- 91
*F400:FF ; write

*F400 ; read

F400- 91 ; ah ! nothing changed !
*

So my question is : how do I tell my Apple/Language card to allow me to write to its RAM ?

(if that's even possible)

Thanks for any clue.

Stefan

[toc] | [next] | [standalone]


#5024

FromD Finnigan <dog_cow@macgui.com>
Date2019-03-17 19:29 +0000
Message-ID<dog_cow-1552850786@macgui.com>
In reply to#5022
schampailler wrote:
> 
> So my question is : how do I tell my Apple/Language card to allow me to
> write to its RAM ?
> 

You have to use the Language Card soft switches to write-protect or
write-enable the RAM of the Language Card.

Access $C08B twice to write enable RAM in the first 4K bank.
Access $C083 twice to write enable RAM in the second 4K bank.

See Appendix D of the Apple II Language Card Manual for a summary of all the
soft switches. There are more.
http://www.applelogic.org/files/LANGCARDMAN.pdf

-- 
]DF$
The New Apple II User's Guide:
https://macgui.com/newa2guide/

[toc] | [prev] | [next] | [standalone]


#5025

Fromschampailler@skynet.be
Date2019-03-17 12:40 -0700
Message-ID<01ff3af2-92b5-44e7-baea-6d13c42d9f19@googlegroups.com>
In reply to#5024
Thx, I had read that manual.

What bothers me is the area from $E000 to $FFFF. In that very manual, appendix D, they say : "the remaining of RAM in the Language Car is reached without bank switching"...

So I wonder why it doesn't work... Maybe an emulator quirk ? But given how strong those emulators are, I doubt that.

Any idea ?

Stefan


On Sunday, 17 March 2019 20:29:41 UTC+1, D Finnigan  wrote:
> schampailler wrote:
> > 
> > So my question is : how do I tell my Apple/Language card to allow me to
> > write to its RAM ?
> > 
> 
> You have to use the Language Card soft switches to write-protect or
> write-enable the RAM of the Language Card.
> 
> Access $C08B twice to write enable RAM in the first 4K bank.
> Access $C083 twice to write enable RAM in the second 4K bank.
> 
> See Appendix D of the Apple II Language Card Manual for a summary of all the
> soft switches. There are more.
> http://www.applelogic.org/files/LANGCARDMAN.pdf
> 
> -- 
> ]DF$
> The New Apple II User's Guide:
> https://macgui.com/newa2guide/

[toc] | [prev] | [next] | [standalone]


#5026

FromD Finnigan <dog_cow@macgui.com>
Date2019-03-17 19:50 +0000
Message-ID<dog_cow-1552852041@macgui.com>
In reply to#5025
schampailler wrote:
> Thx, I had read that manual.
> 
> What bothers me is the area from $E000 to $FFFF. In that very manual,
> appendix D, they say : "the remaining of RAM in the Language Car is
> reached
> without bank switching"...
> 

Are using the Monitor for testing? When you switch that area to RAM, the
Monitor disappears, and the Apple will hang. You should copy the Monitor ROM
into Language Card RAM beforehand.

I used to have the commands memorized to do this, but I'm sure someone else
can fill in what I've forgotten.

-- 
]DF$
The New Apple II User's Guide:
https://macgui.com/newa2guide/

[toc] | [prev] | [next] | [standalone]


#5029

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2019-03-18 09:01 -0700
Message-ID<3d89a18e-e183-47e4-bb50-10e5a8537fd8@googlegroups.com>
In reply to#5026
> You should copy the Monitor ROM into Language Card RAM beforehand. 
> I used to have the commands memorized to do this, but I'm sure someone else 
> can fill in what I've forgotten. 

That would be the old C081 N trick:

    CALL-151
    C081 N C081 N F800<F800.FFFFM
    C083

The second line is usually presented as:

    C081 N C081 N D000<D000.FFFFM

So that Applesoft can be used.

Michael


[toc] | [prev] | [next] | [standalone]


#5027

Fromqkumba <peter.ferrie@gmail.com>
Date2019-03-17 21:16 -0700
Message-ID<927bd28e-c8cd-4ee5-b945-c64ed33f00ae@googlegroups.com>
In reply to#5025
> What bothers me is the area from $E000 to $FFFF. In that very manual, appendix D, they say : "the remaining of RAM in the Language Car is reached without bank switching"...

It means that the same view will be presented no matter which bank is active.
So $C08B/C08B or C083/C083 will see the same contents at E000-FFFF.
Only the view of $D000-DFFF will differ between the two cases.
However, you still require one of those pairs to access the E000-FFFF region at all.

[toc] | [prev] | [next] | [standalone]


#5028

FromTom Porter <laseractiveguy@gmail.com>
Date2019-03-18 00:03 -0700
Message-ID<61d5a1bf-817b-4616-a8cd-3273e9d87673@googlegroups.com>
In reply to#5022
This is my solution... its for 128kb but its gold... allows access to the language cards... even in basic!

LANG-RAM.INF
=====USE THE LANGUAGE CARD=======================================================
LANGUAGE CARD RAM STORAGE.... (PAGES [208-223] [224-255]
A=START  B=A+#TO TRANSER  C=DESTINATION

100 POKE 61,A:POKE 63,B:POKE 67,C:CALL 30000:RETURN:REM 'STORAGE TO MAIN LANGUAGE CARD
200 POKE 61,A:POKE 63,B:POKE 67,C:CALL 30055:RETURN:REM 'STORAGE TO AUX LANGUAGE CARD
CALL 30075  SWITCH TO D1 BANK  **THIS SWITCHES BETWEEN PGS:[208-223]
CALL 30085  SWITCH TO D2 BANK  **(SAME)
================================================================================



EXAMPLE CODE....
0 GR
1 PRINT CHR$(4);"BLOAD SAM.A"

2 PRINT CHR$(4);"BLOAD CHAR1.LRD"
3 A=4:B=A+3:C=210:GOSUB 100

4 PRINT CHR$(4);"BLOAD CHAR2.LRD"
5 A=4:B=A+3:C=210:GOSUB 200

6 PRINT CHR$(4);"BLOAD CHAR3.LRD"
7 A=4:B=A+3:C=210:CALL 8885:GOSUB 100

8 PRINT CHR$(4);"BLOAD CHAR4.LRD"
9 A=4:B=A+3:C=210:GOSUB 200


10 GOSUB 300:A=210:B=A+3:C=4:CALL 8875:GOSUB 100:GOSUB 300
11 GOSUB 300:A=210:B=A+3:C=4:GOSUB 200:GOSUB 300
12 GOSUB 300:A=210:B=A+3:C=4:CALL 8885:GOSUB 100:GOSUB 300
13 GOSUB 300:A=210:B=A+3:C=4:GOSUB 200:GOSUB 300
14 END


100 REM MAIN TO LANG
101 REM (PG 4-150) (PG 208-255)
101 POKE 61,A:POKE 63,B:POKE 67,C:CALL 8800:RETURN

200 REM MAIN TO AUX LANG (PG 4-150) (PG 208-255)
201 POKE 61,A:POKE 63,B:POKE 67,C:CALL 8855:RETURN
300 FOR BB=1 TO 1000:NEXT BB:RETURN







7530-   8D 08 C0    STA   $C008    w:SETSTDZP
7533-   AD 8B C0    LDA   $C08B    rw:LCBANK1
7536-   AD 8B C0    LDA   $C08B    rw:LCBANK1
7539-   A9 00       LDA   #$00
753B-   A8          TAY
753C-   85 3C       STA   $3C
753E-   85 42       STA   $42
7540-   A9 FF       LDA   #$FF
7542-   85 3E       STA   $3E
7544-   B1 3C       LDA   ($3C),Y
7546-   91 42       STA   ($42),Y
7548-   E6 42       INC   $42
754A-   D0 02       BNE   $754E
754C-   E6 43       INC   $43
754E-   C5 3E       CMP   $3E
7550-   A5 3D       LDA   $3D
7552-   E5 3F       SBC   $3F
7554-   E6 3C       INC   $3C
7556-   D0 02       BNE   $755A
7558-   E6 3D       INC   $3D
755A-   90 E8       BCC   $7544
755C-   8D 08 C0    STA   $C008    w:SETSTDZP
755F-   AD 8A C0    LDA   $C08A
7562-   60          RTS
7563-   00          BRK
7564-   00          BRK
7565-   00          BRK
7566-   00          BRK
7567-   A5 3D       LDA   $3D
7569-   A6 3F       LDX   $3F
756B-   A4 43       LDY   $43
756D-   8D 09 C0    STA   $C009    w:SETALTZP
7570-   85 3D       STA   $3D
7572-   86 3F       STX   $3F
7574-   84 43       STY   $43
7576-   4C 33 75    JMP   $7533
7579-   00          BRK
757A-   00          BRK
757B-   A9 8B       LDA   #$8B
757D-   8D 34 75    STA   $7534
7580-   8D 37 75    STA   $7537
7583-   60          RTS
7584-   00          BRK
7585-   A9 83       LDA   #$83
7587-   4C 7D 75    JMP   $757D

[toc] | [prev] | [next] | [standalone]


#5030

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2019-03-18 09:31 -0700
Message-ID<b3e24c14-b56d-4d24-9f03-06935ceef5b5@googlegroups.com>
In reply to#5022
Stefan,

The Langauge Card (LC) can be a bit tricky to understand for beginners.

Here is a LC primer.

The first trick is understanding how the bank-switching works.  Aside, I'll be
using the usual dollar symbol ('$') notation to refer to hex.

As you know the address space $C000..$FFFF is the top 16 KB of memory.  The
Apple ][ reserves 4K from $C000..$CFFF for IO. This leaves 12 KB from
$D000..$FFFF. "Wait!" you say; the LC says it has 16 KB of RAM? Where did the
missing 4K go?

The Language has a window of 8 KB of which you select _which_ 4KB you want to use.
That is, of the first 8 KB LC RAM you select which "bank" of 4KB you want.
(The remaining 8 KB are always available regardless of which bank is selected.)

Here is a ASCII diagram showing how the LC ram is accessible via the 6502:

+-------+    +-------+    +-------+
| $FFFF |    | $FFFF |    | $FFFF |
|    :  |    |    :  |    |    :  |
| $E000 |    | $E000 |    | $E000 |
+-------+    +-------+    +-------+
| $D000 |    | $D000 |    |  n/a  |
+-------+    +-------+    +-------+
+ $C000 |    |  n/a  |    | $D000 |
+-------+    +-------+    +-------+
 LC RAM        Bank A       Bank B

Moving on, the LC responds to 8 I/O addresses:

    $C0N1 4K Bank A, ROM read, Write enabled
    $C0N2 4K Bank A, ROM read, Write protect
    $C0N3 4K Bank A, RAM read, Write enabled
    $C0N8 4K Bank B, RAM read, Write protect
    $C0N9 4K Bank B, ROM read, Write enabled
    $C0NA 4K Bank B, ROM read, Write protect
    $C0NB 4K Bank B, RAM read, Write enabled

When you are in the monitor (CALL-151) the interactive disassembler is executing
code from $F800 .. $FFFF.  If you enable (bank-switch) to the LC RAM it will
crash (!) so we first need to do these steps before we copy from ROM to RAM:

  a) read ROM,
  b) write-enable RAM,

We can execute step (a) via:

    C081 N C081 N

The monitor N command is basically a no-op so we can chain commands together.

Next, (b), to copy from ROM to LC RAM:

    D000<D000.FFFFM
    
This uses the built-in memory move command. The syntax is:

    DST < SRC.END M

At this point we can write to the LC RAM but we *won't* be able to view it since we are still reading from ROM.  We disable the internal ROM and enable the LC RAM.

    C083

Putting it all together you will usually see this two-liner:

    CALL-151
    C081 N C081 N D000<D000.FFFFM N C083

And here is a test you can do to see that indeed RAM is indeed being changed:

    D000 N

You will see 6F

    D000:7F
    D000 N

Here we have changed a byte in the LC RAM.

    D000:6F
    D000 N

And we leave things the way we found it since Applesoft is now running out of
the LC RAM.

From AppleWin if you press F7, there are LC I/O indicators on the bottom
left of the info window. The info window is the the cyan window on the right).
You will a memory indicator like this:

  80: B2/M   R/W
  88: B1/M

These are telling you which memory banks of the LC are active.

Legend:

  B1 = LC Bank A (LC $C000-$CFFF is mapped to $D000..$DFFF)
  B2 = LC Bank B (LC $D000-$DFFF is mapped to $D000..$DFFF)
  R = LC Read enabled
  W = LC Write enabled
  
In the debugger you can use the OUT command to bank-switch:

    OUT C081

This will switch back to reading from ROM.

Cheers,
Michael

[toc] | [prev] | [next] | [standalone]


#5031

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2019-03-18 09:38 -0700
Message-ID<01c0145e-ced8-4540-8b6c-35441ed32f0d@googlegroups.com>
In reply to#5030
Update: Whoops, I see that I've switched the terminology for Bank A and B, and that I missed the $C0N0 I/O line.

Here is the correct chart:

    $C0N0 4K Bank B, RAM read, Write protect
    $C0N1 4K Bank B, ROM read, Write enabled
    $C0N2 4K Bank B, ROM read, Write protect
    $C0N3 4K Bank B, RAM read, Write enabled

    $C0N8 4K Bank A, RAM read, Write protect
    $C0N9 4K Bank A, ROM read, Write enabled
    $C0NA 4K Bank A, ROM read, Write protect
    $C0NB 4K Bank A, RAM read, Write enabled

Appendix C, Page 25, and Appendix D, Page 26, of the "Apple Language Card" manual basically summarize what you need to know.

[toc] | [prev] | [next] | [standalone]


#5033

FromMichael Pohoreski <michael.pohoreski@gmail.com>
Date2019-03-18 09:50 -0700
Message-ID<2e8fefb8-a3fa-47c1-937f-27db6cbac0ac@googlegroups.com>
In reply to#5030
On Monday, March 18, 2019 at 9:31:14 AM UTC-7, Michael Pohoreski wrote:
> Stefan,
> 
> The Langauge Card (LC) can be a bit tricky to understand for beginners.

And apparently even harder to spell correctly for the experienced. ;-)

[toc] | [prev] | [next] | [standalone]


#5032

FromTom Porter <laseractiveguy@gmail.com>
Date2019-03-18 09:47 -0700
Message-ID<2bd705e0-e07c-4034-a70f-b0962473261b@googlegroups.com>
In reply to#5022
Here is an assembly version of the 'so-called' C081 trick...  it can be turned into a binary and BRUN (or whatever) to do it automatically inside a program.

7530-   A0 D0       LDY   #$D0
7532-   84 3D       STY   $3D
7534-   84 43       STY   $43
7536-   A0 FF       LDY   #$FF
7538-   84 3E       STY   $3E
753A-   84 3F       STY   $3F
753C-   C8          INY
753D-   84 3C       STY   $3C
753F-   84 42       STY   $42
7541-   8D 81 C0    STA   $C081    rw:ROMIN
7544-   8D 81 C0    STA   $C081    rw:ROMIN
7547-   20 2C FE    JSR   $FE2C    F8ROM:MOVE
754A-   8D 83 C0    STA   $C083    rw:LCBANK2
754D-   60          RTS
-----
another version of the listing....

REM COPY ROM TO RAM & ACTIVATE
RAM KEEPING READ/WRITE ACTIVE
RAM CHANGE LAST STA $C080 4 READ ONLY

NEW
MEM 30000

LDY #208
STY 61
STY 67
LDY #255
STY 62
STY 63
INY
STY 60
STY 66
STA $C081
STA $C081
JSR $FE2C
STA $C083
RTS

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.apple2.programmer


csiph-web