[cc65] Apple 2 ASCII with MSB on

Date view Thread view Subject view

From: Justin England (jengland_at_enetis.net)
Date: 2003-05-10 04:38:22


I have just started to convert my Apple // Merlin assembler files to ca65
files and have run into a problem with my first program.

I have a small program that ejects the disk in a 3.5 disk drive,
originally written (years and years ago) with Merlin assembler.  I
converted it to ca65, assembled, and linked it just fine.  When I
transfered it back to my apple, changed the file type and ran it, it
wouldn't work.

I did a byte by byte comparison of the two binary files (one created with
ca65/ld65 and one created with Merlin assembler) , I found that the
ascii characters were different (the letters 'EJECT').  The original bin
file (Merlin) had the high bits set.  I did a quick browsing of my //c
tech ref manual, and noticed that the apple assembler had a 'msb on'
command (which merlin must do automatically.)  It has been a long time
since I worked with Apple 2s so I don't recall why, but it looks like the
high bit on ascii characters must be set.

Is there an equivalent to 'msb on' in ca65?  I have looked though the
docs, but couldn't find anything that looked like it was what I needed.

FWIW, here is the .lst file for my program:

000000r 1               .define EQU     =
000000r 1
000000r 1
000000r 1               .org            $4000
004000  1
004000  1
004000  1               INBUF   EQU     $200
004000  1               EXTRNCMD        EQU     $BE06
004000  1               EXTRNADR        EQU     $BE50
004000  1               XLEN            EQU     $BE52
004000  1               XCNUM           EQU     $BE53
004000  1               PBITS           EQU     $BE54
004000  1               XRETURN         EQU     $BE9E
004000  1               SMPCALL         EQU     $C50D
004000  1
004000  1               CMDMOVE:
004000  1  AD 07 BE             lda     EXTRNCMD+1
004003  1  8D 17 40             sta     NXTCMD+1
004006  1  AD 08 BE             lda     EXTRNCMD+2
004009  1  8D 18 40             sta     NXTCMD+2
00400C  1
00400C  1  A9 1E                lda     #<START
00400E  1  8D 07 BE             sta     EXTRNCMD+1
004011  1  A9 40                lda     #>START
004013  1  8D 08 BE             sta     EXTRNCMD+2
004016  1
004016  1               NXTCMD:
004016  1  4C 00 00             jmp     $0000
004019  1               TXTCMD:
004019  1  45 4A 45 43          .byte   "EJECT"
00401D  1  54

-- it should be: C5 CA C5 C3 D4 --

00401E  1
00401E  1               START:
00401E  1  A2 00                ldx     #0
004020  1               GETCHAR:
004020  1  BD 00 02             lda     INBUF,x
004023  1  DD 19 40             cmp     TXTCMD,x
004026  1  38                   sec
004027  1  D0 ED                bne     NXTCMD
004029  1  E8                   inx
00402A  1  E0 05                cpx     #5
00402C  1  D0 F2                bne     GETCHAR
00402E  1  CA                   dex
00402F  1  8E 52 BE             stx     XLEN
004032  1  A9 00                lda     #0
004034  1  8D 53 BE             sta     XCNUM
004037  1  8D 54 BE             sta     PBITS
00403A  1  8D 55 BE             sta     PBITS+1
00403D  1  A9 9E                lda     #<XRETURN
00403F  1  8D 50 BE             sta     EXTRNADR
004042  1  A9 BE                lda     #>XRETURN
004044  1  8D 51 BE             sta     EXTRNADR+1
004047  1  20 4C 40             jsr     DOCALL
00404A  1  18                   clc
00404B  1  60                   rts
00404C  1
00404C  1               DOCALL:
00404C  1  20 0D C5             jsr     SMPCALL
00404F  1  04                   .byte   $04
004050  1  53 40                .word   CMDLIST
004052  1  60                   rts
004053  1
004053  1               CMDLIST:
004053  1  03                   .byte   $03
004054  1  01                   .byte   $01
004055  1  58 40                .word   CNTL_LIST
004057  1
004057  1               CMD_CODE:
004057  1  04                   .byte   $04
004058  1               CNTL_LIST:
004058  1  00 00                .word   $0000
004058  1




Justin England				jengland_at_enetis.net
Network Administrator
E-Net Information Services		http://www.enetis.net
Tel: 605-341-3638			Fax: 605-341-8880



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-05-10 04:54:41 CEST