6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 4:08 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Sweet-16 on Apple ii
PostPosted: Wed Oct 31, 2018 6:48 am 
Offline

Joined: Wed Oct 31, 2018 6:45 am
Posts: 11
Hello.
I has a question: how to configure emulator for use Sweet-16?

I took AppleWin, but i cannot load binary file at $F689.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sweet-16 on Apple ii
PostPosted: Wed Oct 31, 2018 7:56 am 
Online
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1950
Location: Sacramento, CA, USA
If you select "Apple ][ (Original)" from the Configuration menu, Sweet16 will be waiting there for you at $F689.
If you would prefer a later Apple (with lower-case and Applesoft), all you need is a DOS 3.3 System Master disk image. When you boot, Integer BASIC and Sweet16 should load from the floppy into the language card area, and you can access them both by entering INT at the prompt.

Attachment:
sweet16.JPG
sweet16.JPG [ 53.99 KiB | Viewed 3141 times ]

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
 Post subject: Re: Sweet-16 on Apple ii
PostPosted: Wed Oct 31, 2018 1:15 pm 
Offline

Joined: Wed Oct 31, 2018 6:45 am
Posts: 11
yes, it works. Thank you!

Is way exists to switch banks via assembler? I found one call - $A59E


Top
 Profile  
Reply with quote  
 Post subject: Re: Sweet-16 on Apple ii
PostPosted: Wed Oct 31, 2018 3:16 pm 
Online
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1950
Location: Sacramento, CA, USA
I am glad I could help with your initial question, but bank switching is beyond my pay grade ... FP and INT from the command line are the only ways I have ever intentionally switched banks, in actual hardware and in emulation.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
 Post subject: Re: Sweet-16 on Apple ii
PostPosted: Wed Oct 31, 2018 4:38 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
BTW, welcome to our world, dwesti!

I can't answer your question, but you might try this thread:

And maybe Chapter 8 of Inside the Apple IIc? I don't have a grasp of the differences between the Apple II flavours.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sweet-16 on Apple ii
PostPosted: Wed Oct 31, 2018 4:49 pm 
Offline

Joined: Wed Oct 31, 2018 6:45 am
Posts: 11
BigEd, thank you, I will read

my attempt to use SW16, it generate A^2 table. Didn't understand all instructions, maybe code must be done simple:

Code:

ldy #0

jsr sw16
sub r0;set 0,0 ;r0=0
st 6 ;r6=r0
inr 6
rtn

mm
lda 0
sta sqt,y

lda 1
sta sqt+256,y

jsr sw16
add 6 ; r0=r0+r6
inr 6 ;r6+1
inr 6 ; r6+1
rtn

iny
bne mm


Top
 Profile  
Reply with quote  
 Post subject: Re: Sweet-16 on Apple ii
PostPosted: Sun Mar 31, 2019 8:26 pm 
Offline

Joined: Wed Oct 31, 2018 6:45 am
Posts: 11
barrym95838 wrote:
If you select "Apple ][ (Original)" from the Configuration menu, Sweet16 will be waiting there for you at $F689.


What AppleWin version works correct with original A2 ?

Working on SW16 and I had a question: SW16 uses R12 for store return adresses for RS/BS, seems ($18)=$FFFF. From other side writing data at adresses fails.

How to initialize data?
with
Code:
   lda #$20
   sta $18
   lda #0
   sta $19


interpreter working right.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sweet-16 on Apple ii
PostPosted: Mon Apr 01, 2019 6:40 am 
Online
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1950
Location: Sacramento, CA, USA
Quote:
What AppleWin version works correct with original A2 ?
I have used 1.17.2.0 and 1.20.0.0 with some success.
Quote:
Working on SW16 and I had a question: SW16 uses R12 for store return adresses for RS/BS, seems ($18)=$FFFF. From other side writing data at adresses fails.

How to initialize data?

Here's a complete example, in which I use sbasm and init register $C with a SET STK,$0110 directly after I JSR SWEET16 in MAIN:
Code:
;234567890123456789012345678901234567890123456789012345
        .CR  6502
        .TF  SWEET16B.OTX,AP1
        .LF  SWEET16B
;-----------------------------------------------------;
; BEER SONG FOR THE SWEET16 PSEUDO-PROCESSOR          ;
;    BY BARRYM 2011-05-21                             ;
;-----------------------------------------------------;
; THE SWEET16 PSUEDO-PROCESSOR WAS CREATED BY STEVE   ;
;    WOZNIAK IN 1977 TO HELP HIM WRITE COMPACT (BUT   ;
;    SLOWER 16-BIT CODE ON HIS NEW BABY, THE APPLE    ;
;    II.  HE NEVER BUILT IT IN HARDWARE, BUT INSTEAD  ;
;    CREATED A NIFTY LITTLE 372-BYTE INTERPRETER AND  ;
;    BURNED IT INTO THE ROM OF THE ORIGINAL INTEGER   ;
;    BASIC APPLE II.                                  ;
; SWEET16 CODE AND 6502 CODE CAN CO-EXIST PEACEFULLY  ;
;    IN AN APPLE II MACHINE LANGUAGE PROGRAM; A 6502  ;
;    'JSR $F689' IMMEDIATELY PRECEDES A BLOCK OF IN-  ;
;    LINE SWEET16 INSTRUCTIONS AND A SWEET16 'RTN'    ;
;    SWITCHES BACK TO 6502 MODE, WHICH MUST BE DONE   ;
;    AT OR BEFORE PROGRAM COMPLETION.  THE ORIGINAL   ;
;    APPLE II HAD AN UPPER-CASE 40-COLUMN DISPLAY AS  ;
;    STANDARD EQUIPMENT, SO THE OFFICIAL SONG LYRICS  ;
;    ARE ADJUSTED ACCORDINGLY.                        ;
; THANKS TO SBPROJECTS.COM FOR LOTS OF VALUABLE INFO  ;
;    AND A VERY NICE ASSEMBLER!!                      ;
; NOTE:  'ADD' AND 'SUB' ARE BUILT-IN 6502 MACROS IN  ;
;    THE CURRENT VERSION OF THIS ASSEMBLER AND WILL   ;
;    NOT ASSEMBLE TO THE CORRECT SWEET16 OPCODES (USE ;
;    '.DA #$AX' FOR 'ADD X' & '.DA #$BX' FOR 'SUB X') ;
;-----------------------------------------------------;
; CONSTANT EQUATES                                    ;
;-----------------------------------------------------;
SWEET16  =   $F689        ROM: WOZ' INTERPRETER
BIN2ASC  =   $E51B        ROM: PRINT UNSIGNED16
PUTCHAR  =   $FDED        ROM: PRINT CHARACTER
MAXB     =   99           MUST BE IN [1..65535]
;-----------------------------------------------------;
; REGISTER EQUATES                                    ;
;-----------------------------------------------------;
      
ACC      =   $0           SWEET16 MAIN ACCUM.
BEER     =   $1           BEER COUNTER
TYPE     =   $2           SUBPHRASE TYPE
PTR      =   $3           TEXT POINTER
STK      =   $C           SWEET16 STACK POINTER
;-----------------------------------------------------;
; MAIN PROGRAM                                        ;
;-----------------------------------------------------;
        .OR  $0E00
MAIN    JSR  SWEET16      ENTER SWEET16 MODE
        SET  STK,$0110    INIT STACK POINTER
        SET  BEER,MAXB    BEER = MAXB
        .DA  #$B0         (SUB ACC) TYPE = 0
        BS   PRSONG       PRINT ENTIRE SONG
        RTN               BACK TO 6502 MODE
        RTS               EXIT
;-----------------------------------------------------;
; MAIN LOOP:  PRINT ALL EXCEPT THE LAST SENTENCE      ;
;-----------------------------------------------------;
BEERME  SET  PTR,TAKE     PRINT "TAKE ONE ... AROUND,"
        BS   PRBOB        PRINT " ... ON THE WALL."
PRSONG  SET  PTR,CR       PRINT BLANK LINE
        BS   PRBOB        PRINT " ... ON THE WALL";
        DCR  ACC          TYPE = -1
        SET  PTR,COMCR    PRINT ","
        BS   PRBOB        PRINT " ... OF BEER."
        INR  ACC          TYPE = +1
        DCR  BEER         BEER = BEER - 1
        BNM1 BEERME       IF BEER <> -1 THEN BEERME
;-----------------------------------------------------;
; SET UP LAST SENTENCE AND FALL THRU                  ;
;-----------------------------------------------------;
        SET  BEER,MAXB    BEER = MAXB
;                         PRINT "GO TO ... SOME MORE,"
;-----------------------------------------------------;
; SUBROUTINES FOLLOW                                  ;
;-----------------------------------------------------;
; PRINT A PROPERLY PUNCTUATED BOTTLE SUB-PHRASE       ;
; (ENTRY): PTR CONTAINS PRE-STRING POINTER, ACC       ;
;    CONTAINS SUB-PHRASE TYPE (0 = " ... THE WALL",   ;
;    -1 = " ... OF BEER.", +1 = " ... THE WALL.")     ;
; (EXIT):  ACC IS CLEARED                             ;
;-----------------------------------------------------;
PRBOB   ST   TYPE
        BS   PUTS         PRINT PRE-STRING
        LD   BEER         IF BEER = 0 THEN
        BZ   PRBOTT          PRINT "NO MORE";
        RTN               IF BEER > 0 THEN
        LDA  $03             ESC TO 6502 MODE JUST LONG
        LDX  $02             ENOUGH TO PRINT VALUE OF
        JSR  BIN2ASC         BEER TO ACTIVE OUTPUT.
        JSR  SWEET16+3
        SET  PTR,BOTTL
PRBOTT  BS   PUTS         PRINT " ... BOTTLE";
        DCR  BEER
        BNZ  NEQ1         IF BEER = 1 THEN
        INR  PTR             SKIP OVER THE "S"
NEQ1    INR  BEER
        BS   PUTS         PRINT " ... OF BEER";
        LD   TYPE
        BM1  NOWALL       IF TYPE >= 0 THEN
        BS   PUTS            PRINT " ON THE WALL";
        LD   TYPE
        BZ   KPUT         IF TYPE <> 0 THEN
NOWALL  SET  PTR,DOTCR       PRINT "."
;-----------------------------------------------------;
; PRINT A NULL-TERMINATED STRING @ PTR                ;
; (ENTRY): PTR POINTS TO THE START OF THE STRING      ;
; (EXIT):  PTR POINTS TO THE NEXT STRING IN MEMORY,   ;
;          ACC IS CLEARED                             ;
;-----------------------------------------------------;
PUTS    LD   @PTR         GRAB CHAR @ PTR, ADVANCE PTR
        BZ   KPUT
        RTN               ESC TO 6502 MODE
        LDA  $00             JUST LONG ENOUGH
        JSR  PUTCHAR         TO PRINT THE CHAR
        JSR  SWEET16+3       TO ACTIVE OUTPUT
        BR   PUTS         LOOP UNTIL NULL
KPUT    RS                RETURN
;-----------------------------------------------------;
; OPTIMIZED SONG LYRIC STRING                         ;
;-----------------------------------------------------;
TAKE    .AS  -"TAKE ONE DOWN AND PASS IT AROUND"
COMCR   .AS  -","
CR      .AZ  -#13
        .AS  -"NO MORE"
BOTTL   .AZ  -" BOTTLE"
        .AZ  -"S OF BEER"
        .AZ  -" ON THE WALL"
DOTCR   .AZ  -".",#13
        .AZ  -"GO TO THE STORE AND BUY SOME MORE,",#13
        .EN
;-----------------------------------------------------;
; HEX DUMP FOLLOWS.  IF YOU COPY AND PASTE THIS INTO  ;
;    AN APPLE II EMULATOR SUCH AS APPLEWIN 1.17.2.0,  ;
;    (MY PERSONAL FAVORITE), PLEASE MAKE SURE THAT IT ;
;    IS SET TO ORIGINAL APPLE II MODE (INTEGER BASIC  ;
;    MUST BE AVAILABLE IN ROM OR ON A LANGUAGE CARD   ;
;    IN ORDER FOR THIS PROGRAM TO WORK).  ENJOY!  :-) ;
;-----------------------------------------------------;
CALL-151
0E00: 20 89 F6 1C 00 01 11 63 00 B0 0C 07 00 60 13 5C
0E10: 0E 0C 12 13 7D 0E 0C 0D F0 13 7C 0E 0C 07 E0 F1
0E20: 09 EC 11 63 00 32 0C 25 21 06 0E 00 A5 03 A6 02
0E30: 20 1B E5 20 8C F6 13 86 0E 0C 12 F1 07 01 E3 E1
0E40: 0C 0B 22 08 05 0C 06 22 06 11 13 A5 0E 43 06 0B
0E50: 00 A5 00 20 ED FD 20 8C F6 01 F2 0B D4 C1 CB C5
0E60: A0 CF CE C5 A0 C4 CF D7 CE A0 C1 CE C4 A0 D0 C1
0E70: D3 D3 A0 C9 D4 A0 C1 D2 CF D5 CE C4 AC 8D 00 CE
0E80: CF A0 CD CF D2 C5 A0 C2 CF D4 D4 CC C5 00 D3 A0
0E90: CF C6 A0 C2 C5 C5 D2 00 A0 CF CE A0 D4 C8 C5 A0
0EA0: D7 C1 CC CC 00 AE 8D 00 C7 CF A0 D4 CF A0 D4 C8
0EB0: C5 A0 D3 D4 CF D2 C5 A0 C1 CE C4 A0 C2 D5 D9 A0
0EC0: D3 CF CD C5 A0 CD CF D2 C5 AC 8D 00
E00GE000G

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
 Post subject: Re: Sweet-16 on Apple ii
PostPosted: Tue Apr 02, 2019 9:21 am 
Offline

Joined: Wed Oct 31, 2018 6:45 am
Posts: 11
barrym95838,
thank you for example.
Can you explain how bytecode Dr works?
I've found description, but I do not understand:
Code:
;DR   1   ACC<-ACC-R
;Dn          CPR  n          R13 <-- (R0) - (Rn),R14 <-- status flags.
;Dr CMP r RD=R0-Rr, set status Compare result to RD,w:CPR Rn compare


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 49 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: