Jump to content
IGNORED

Best 6502 assembler for a newbie?


Recommended Posts

Hello, I recently got a 130XE off EBay as a way of getting back into Atari 8-bits. (I sold my original Atari 800, with a Happy 1050, in 1985 to upgrade to an Amiga 1000).

 

I have an Assembler/Editor cartridge left over from my '90s retrogaming collector days. I think it would be fun for learning 6502 programming since it's on the actual hardware.

 

When I get going with "real" projects, I would switch to a cross-assembler and I wondering which is best to use for a newbie.

 

I definitely would use WUDSN IDE, since I'm already familiar with Eclipse. ATASM seems nice because it is compatible with MAC/65, but judging from this forum all the cool kids seem to be using MADS. My concern with MADS is that if you know only English, the documentation seems a bit like folklore. It also seems like a "power user" tool that might be overwhelming at first.

 

Interested in hearing comments from people who are using these tools now. Thanks!

Edited by FifthPlayer
Link to comment
Share on other sites

I'd suggest using MADS. I actually accepts the same syntax as ATASM/MAC65 with a few exceptions. For them I've describe the replacemnet here:

 

http://www.wudsn.com/index.php/ide/faq#FAQATASMtoMADSConversion

 

The WUDSN IDE compiler distribution comes with an English version of MADS' documentation too.

 

http://www.wudsn.com/productions/java/ide/downloads/compilers.zip

 

And yes, MADS supports many features you won't need (RELOC, SDX, ....) . But you can simply not use them and you're fine :-)

Edited by JAC!
  • Like 3
Link to comment
Share on other sites

  • 1 year later...

MAC/65 is very good native macroassembler.

Now I learning ATMASII macroassembler because it has not string-numbers and thus shows more text on 40-col display and has very comfortable functions realized as keystrokes or ESC-sequences.

 

F.E. Assembling - <Ctrl-Y>,

 

Saving codes on disk - $WD:CODE.SRC$$

$ - represents ESC-symbol, W - WRITE

 

Reading codes from disk - $RD:CODE.SRC$$

Link to comment
Share on other sites

Hi there, Rybags!

 

I really new nothing about ATMASII.

 

I even found something as ATMASIII in Slovac's sites... No Docs at all!!!

 

I only trying to programming in assembly and I feel myself comfortable with MAC/65

 

BUT

 

I really hate a linenumbers and I don't like ASM ,,#D... in MAC/65

And I hate QA's menues with everystep <Enter>-confirming.

 

I only understand, that there are no ideals on this GEOIDAL Earth!

 

Best wishes from Moscow, friend!

Link to comment
Share on other sites

@576XE: try MAE. It is basically a very MAC/65-like assembler (the syntax is very close), but it has a full screen editor, very powerful and convenient (it however takes some time to learn the keyboard shortcuts, but it pays off).

 

I also used the MAC/65 exclusively, but when I saw MAE, I have switched immediately.

 

Instructions: http://www.mixinc.net/atari/mae.htm

 

Some general info (in Polish) and download links: http://atariki.krap.pl/index.php/MAE

 

I would forget: nothing is perfect, so MAE requires at least 130XE (uses the ext RAM to keep the source code being edited).

Edited by drac030
Link to comment
Share on other sites

The suggestion I made re using an Assembler on actual hardware or emultion as a beginner is because it'd likely end up being faster when constantly reassembling and fixing errors.

Mac-65 has the advantage also in that it picks up some errors at program entry time.

 

Generally the PC-based assemblers also have the disadvantage that an error makes the assembly terminate, real machine based ones will almost always continue and just keep spitting out the errors which is usually preferrable.

Link to comment
Share on other sites

Hi, there!

 

I've prepared a new atr image for my BlueMAE environment and setup it for 64-cols.

Blue, because of:

 

POKE 710,146

POKE 709,14

 

Just my personal preferences.

 

Like a charm! :) I need it for ages!

 

The Editor is about perfectionalist's dream.

 

The assembler...

 

I just need some sources for investigations.

I love programming languages in my manner, but I can't get Nirvana from MAE because I can't assemble wright anything.

 

Is there some working simplest codes concerning 6502 only?

 

We all learns on some sources!!!

Link to comment
Share on other sites

I did some assembly coding three years ago when I was doing a simple routine for use with Atari basic. I did that, tediously, on the assembler editor cartridge. I don't think learning the specifics of macros are important for the first project. I am on my first, mostly assembly game project, and I use eclipse with cl65/ca65/cc65. I use a little c. But mostly assembly. Just any old Google search, will return a wealth of example code, if Atari specific usually in assembler/editor format, but that's not usually important as it doesn't get in the way and I am just looking for the style. Also on style I am disappointed a bit that there are all kinds of styles... by that I mean, on some specific algorithm you can calculate which routine is fastest or smallest and thus which logic suits your needs, but as for overall organization of code, seems to be more preference than science, imho

 

in my experience, which is still fresh on my mind..learning keywords lda, sta, jsr, jmp, tax, txa, etc... Or the specifics of timers, display lists, vbi routines, etc. just a matter of google searches and probably any old assembler would do...the main thing is to have the compile and run environment for quickly seeing results.

 

Assembly, imho on the Atari is actually easier to learn than say C or Action, simply because of support. Google searches answer most and this forum the rest...assembly is very well supported. In fact learning C on the Atari would be a nightmare because you have to expertly navigate around slowdowns, better to be an expert than beginner. In assembly you can burn a few cycles -- sacrilege I know :)

 

I think wudsn/mads provides everything, however the macros are a hinderance to learning in the beginning. And also, maybe they help someone program more prolifically but imho it's questionable. Seems to be more about a desire to organize source code. Those are my thoughts on that today....subject to change of course

Link to comment
Share on other sites

Hi Dmitry!

 

I'm not trying to program anything!

I'm trying to understand WHY this world is really THIS WORLD!

 

For example How to explain my Daughter how ST-mouse works.

 

I think that you are heared something about PL65...

 

Do you have an answer why nobody extends or expands it?

 

Why Action! is OUT of Atari programming? It is BELOVED! But...

 

I know that there are a simple answers and there are very complicated answers...

 

Best wishes from Moscow

Link to comment
Share on other sites

An example program in MAE:

 

      .out test.com

      .org $2000

start lda #$0f
      sta 712
      rts

      .org $02e0
      .word start
Exit the editor (Esc), ave, then [A]ssemble.

 

The directives are only parsed up to the third character, so .org, .out and .word from the example may be shortened to .or, .ou and .wo respectively.

Edited by drac030
Link to comment
Share on other sites

More thanks!!!

 

I just realized the idea about dot/2letters assembler directives.

 

(The manual is too robotic - like "Look at map and go alone arrows direction.")

 

(Very strange thing:

These unixoids loves 2letter commands. (ls, ps, df etc.)

These LISPers loves seriously-longest-absolutely-defined-symbol-expression-names (I mean full LISP implementations of course.)

Why?!!)

 

May be I'll run from MAC65 to MAE too. :)

 

By the way, does the construction

.org $02e0
.word start

works in any DOS?

(I see that there are not INIT filling ets.)

I ask ONLY about a/m construction.

EZ

Link to comment
Share on other sites

By the way, does the construction

.org $02e0
.word start
works in any DOS?

 

Yes. Setting the run address is optional in SpartaDOS (a program is then started from the beginning of the first segment), but it is mandatory in DOS 2.0 and clones. So unless a program is to be started under SpartaDOS only, it is safer to always include the run address explicitly (like above).

 

THe init addresses:

 

.org $02e2
.word init
are optional, thus I have omitted them for simplicity.
Link to comment
Share on other sites

Hi Drac030!

 

I fill myself very comfortable with MAE.

(Do you surprize?) Sorry LISP...

 

But another question...

 

How can I obtained PC in program?

savpc    = ????
;
; CIO Equates
IOCB     .or    $0340
;
ICHID    .ds    1 ; Handler
ICDNO    .ds    1 ; DevNum
ICCOM    .ds    1 ; Command
ICSTA    .ds    1 ; Status
ICBAL    .ds    1 ; Lo BufAdr
ICBAH    .ds    1 ; Hi
ICPTL    .ds    1 ; Lo PutAdr
ICPTH    .ds    1 ; Hi
ICBLL    .ds    1 ; Lo BufLen
ICBLH    .ds    1 ; Hi
ICAX1    .ds    1 ; Aux 1
ICAX2    .ds    1 ; Aux 2
ICAX3    .ds    1 ; Aux 3
ICAX4    .ds    1 ; Aux 4
ICAX5    .ds    1 ; Aux 5
ICAX6    .ds    1 ; Aux 6
;
CBLEN    = ????

I have a results... It works!

; Drac030 Rules Demo!
    .ou dr.com

; CIO Equates
IOCB     .or    $0340

ICHID    .ds    1 ; Handler
ICDNO    .ds    1 ; Number
ICCOM    .ds    1 ; Command
ICSTA    .ds    1 ; Status
ICBAL    .ds    1 ; Lo BufAdr
ICBAH    .ds    1 ; Hi BufAdr
ICPTL    .ds    1 ; Lo PutAdr
ICPTH    .ds    1 ; Hi PutAdr
ICBLL    .ds    1 ; Lo BufLen
ICBLH    .ds    1 ; Hi BufLen
ICAX1    .ds    1 ; Aux 1
ICAX2    .ds    1 ; Aux 2

; Commands
GETREC    = 5
PUTREC    = 9

; System Equates
CIOV      = $e456
RUNAD     = $02e0
CLS       = $7D
EOL       = $9b

; Setup CIO
    .or $2000

start    ldx    #0     ;IOCB 0
    lda #PUTREC  ;want output
    sta ICCOM,x  ;issue cmd
    lda #<msg    ;low byte of msg
    sta ICBAL,x  ; into icbal
    lda #>msg    ;high byte
    sta ICBAH,x  ; into icbah
    lda #0       ;length of msg
    sta ICBLH,x  ; high byte
    lda #$ff     ;255 char length
    sta ICBLL,x  ; low byte

; Call    CIO    to print
    jsr CIOV     ;call cio
    rts             ;exit to dos

; Our message
msg .by CLS,"Drac030 Rules!!!",EOL

; Setup run address
    .or    RUNAD
    .wo start
    .en
Link to comment
Share on other sites

  • 2 weeks later...

Thank you Drac030!

 

Some long part of code (It Works!)

 

It's a translations from BigAssembler code which is slightly broaken...

; Printing Menu Demo
        .ou menu.com

        .or $2000
start    jmp main

; Equates
runad   = $02E0
tl      = $11
hl      = $12
tr      = $05
vl      = $7c
bl      = $1a
br      = $03
bufadr  = $f8
addr    = $FC

; Subroutines
position
; X - Col, Y - Row
        stx $55
        sty $54
        lda $5e
        pha
        lda $5f
        pha
        jsr $f5ac
        pla
        sta $5f
        pla
        sta $5e
        rts
;
princ
        tax
        tya
        pha
        txa
        tay
        rol
        rol
        rol
        rol
        and #$03
        tax
        tya
        and #$9f
        ora $fb49,x
        tax
        pla
        tay
        txa
        sta (100),y
        rts
;
; here
; X,Y - address of string
; X - LSB, Y - MSB
;
prins.inv
; for inverse printing
        lda #$80
        bne prins
prins.nor
; for normal printing
        lda #$00
prins
        pha
        stx addr
        sty addr+1
        ldy #0
        lda (addr),y
        sta length
        iny
prloop
        pla

        pha
        ora (addr),y
        dey
        jsr princ
        iny
        iny
        dec length
        bne prloop
        pla
        rts
;
; here
; h.blk - number of options
; x.blk - X, y.blk - Y
; of UpperLeft frame char 'ul'
; a - length of string in frame
;
frame
        sta w.blk
        ldx x.blk
        ldy y.blk
        jsr position
        ldy #$00
        lda #tl
        jsr princ
        lda #hl
        jsr plothor
        lda #tr
        ldy w.blk
        iny
        jsr princ
        lda #vl
        jsr plotver
        ldx x.blk
        lda y.blk
        sec
        adc h.blk
        tay
        iny
        jsr position
        ldy #$00
        lda #bl
        jsr princ
        lda #hl
        jsr plothor
        lda #br
        ldy w.blk
        iny
        jsr princ
        lda x.blk
        pha
        sec
        adc w.blk
        sta x.blk
        lda #vl
        jsr plotver
        pla
        sta x.blk
        rts
;
plothor
        pha
        ldy w.blk
        iny
horloop
        pla
        pha
        jsr princ
        dey
        bne horloop
        pla
        rts
;
plotver
        pha
        ldy y.blk
        iny
        sty y.blk.t
        ldy h.blk
        sty h.blk.t
verloop
        ldx x.blk
        ldy y.blk.t
        jsr position
        pla
        pha
        ldy #$00
        jsr princ
        inc y.blk.t
        dec h.blk.t
        bpl verloop
        pla
        rts
;
x.blk   .ds 1
y.blk   .ds 1
h.blk   .ds 1
w.blk   .ds 1
y.blk.t .ds 1
h.blk.t .ds 1
length  .ds 1
;
opt1    .by 12," Moscow     "
opt2    .by 12," Petersburg "
opt3    .by 12," Donezk     "
opt4    .by 12," Simeiz     "
opt5    .by 12," Konakovo   "
;
; moves screen block to/from buffer
; here
; x.blk - X, y.blk - Y
; of UpperLeft frame char 'ul'
; h.blk  - heigth of block
; w.blk  - width of block
; bufadr - address of buffer
; c - direction flag
;     c=1 to buffer
;     c=0 from buffer
moveblk
        php
        ldy y.blk
        sty y.blk.t
        ldx x.blk
        jsr position
        ldy h.blk
        iny
        iny
        sty h.blk.t
        inc w.blk
mvloop
        ldy w.blk
mvloop1
        plp
        bcc frombuf
        lda (100),y
        sta (bufadr),y
        bcs mvskip
frombuf
        lda (bufadr),y
        sta (100),y
mvskip
        php
        dey
        bpl mvloop1
        clc
        ldx w.blk
        inx
        txa
        adc bufadr
        sta bufadr
        bcc mvskip1
        inc bufadr+1
mvskip1
        dec h.blk.t
        php
        inc y.blk.t
        ldx x.blk
        ldy y.blk.t
        jsr position
        plp
        bpl mvloop
        plp
        dec w.blk
        rts
;
; here
; x.blk - X, y.blk - Y
; of UpperLeft frame char 'ul'
; h.blk - heigth of block
; w.blk - width of block
; bufadr - address of block buffer
saveblk
        sec
        jmp moveblk
;
; here
; x.blk - X, y.blk - Y
; of UpperLeft frame char 'ul'
; h.blk - heigth of block
; w.blk - width of block
; bufadr - address of block buffer
restblk
        clc
        jmp moveblk
;
setbufadr
        lda #<blk.buf
        sta bufadr
        lda #>blk.buf
        sta bufadr+1
        rts
;
; Main Program
main
        lda #4
        sta h.blk
        lda #12
        sta w.blk
        lda #7
        sta x.blk
        lda #3
        sta y.blk
;
        jsr setbufadr
        lda w.blk
        ldx x.blk
        ldy y.blk
        jsr saveblk
;
        lda w.blk
        ldx x.blk
        ldy y.blk
        jsr frame
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        jsr position
        ldx #<opt1
        ldy #>opt1
        jsr prins.inv
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        iny
        jsr position
        ldx #<opt2
        ldy #>opt2
        jsr prins.nor
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        iny
        iny
        jsr position
        ldx #<opt3
        ldy #>opt3
        jsr prins.nor
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        iny
        iny
        iny
        jsr position
        ldx #<opt4
        ldy #>opt4
        jsr prins.nor
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        iny
        iny
        iny
        iny
        jsr position
        ldx #<opt5
        ldy #>opt5
        jsr prins.nor
;
keyloop lda 764
        cmp #$FF
        beq keyloop
;
        jsr setbufadr
        lda w.blk
        ldx x.blk
        ldy y.blk
        jsr restblk
;
        ldx #0
        ldy #20
        jsr position
        rts
;
blk.buf = *
;
; Setup run address
        .or runad
        .wo start
        .en; Printing Menu
        .ou menu.com

        .or $2000
start    jmp main

; Equates
runad   = $02E0
tl      = $11
hl      = $12
tr      = $05
vl      = $7c
bl      = $1a
br      = $03
bufadr  = $f8
addr    = $FC

; Subroutines
position
; X - Col, Y - Row
        stx $55
        sty $54
        lda $5e
        pha
        lda $5f
        pha
        jsr $f5ac
        pla
        sta $5f
        pla
        sta $5e
        rts
;
princ
        tax
        tya
        pha
        txa
        tay
        rol
        rol
        rol
        rol
        and #$03
        tax
        tya
        and #$9f
        ora $fb49,x
        tax
        pla
        tay
        txa
        sta (100),y
        rts
;
; here
; X,Y - address of string
; X - LSB, Y - MSB
;
prins.inv
; for inverse printing
        lda #$80
        bne prins
prins.nor
; for normal printing
        lda #$00
prins
        pha
        stx addr
        sty addr+1
        ldy #0
        lda (addr),y
        sta length
        iny
prloop
        pla

        pha
        ora (addr),y
        dey
        jsr princ
        iny
        iny
        dec length
        bne prloop
        pla
        rts
;
; here
; h.blk - number of options
; x.blk - X, y.blk - Y
; of UpperLeft frame char 'ul'
; a - length of string in frame
;
frame
        sta w.blk
        ldx x.blk
        ldy y.blk
        jsr position
        ldy #$00
        lda #tl
        jsr princ
        lda #hl
        jsr plothor
        lda #tr
        ldy w.blk
        iny
        jsr princ
        lda #vl
        jsr plotver
        ldx x.blk
        lda y.blk
        sec
        adc h.blk
        tay
        iny
        jsr position
        ldy #$00
        lda #bl
        jsr princ
        lda #hl
        jsr plothor
        lda #br
        ldy w.blk
        iny
        jsr princ
        lda x.blk
        pha
        sec
        adc w.blk
        sta x.blk
        lda #vl
        jsr plotver
        pla
        sta x.blk
        rts
;
plothor
        pha
        ldy w.blk
        iny
horloop
        pla
        pha
        jsr princ
        dey
        bne horloop
        pla
        rts
;
plotver
        pha
        ldy y.blk
        iny
        sty y.blk.t
        ldy h.blk
        sty h.blk.t
verloop
        ldx x.blk
        ldy y.blk.t
        jsr position
        pla
        pha
        ldy #$00
        jsr princ
        inc y.blk.t
        dec h.blk.t
        bpl verloop
        pla
        rts
;
x.blk   .ds 1
y.blk   .ds 1
h.blk   .ds 1
w.blk   .ds 1
y.blk.t .ds 1
h.blk.t .ds 1
length  .ds 1
;
opt1    .by 12," Moscow     "
opt2    .by 12," Petersburg "
opt3    .by 12," Donezk     "
opt4    .by 12," Simeiz     "
opt5    .by 12," Konakovo   "
;
; moves screen block to/from buffer
; here
; x.blk - X, y.blk - Y
; of UpperLeft frame char 'ul'
; h.blk  - heigth of block
; w.blk  - width of block
; bufadr - address of buffer
; c - direction flag
;     c=1 to buffer
;     c=0 from buffer
moveblk
        php
        ldy y.blk
        sty y.blk.t
        ldx x.blk
        jsr position
        ldy h.blk
        iny
        iny
        sty h.blk.t
        inc w.blk
mvloop
        ldy w.blk
mvloop1
        plp
        bcc frombuf
        lda (100),y
        sta (bufadr),y
        bcs mvskip
frombuf
        lda (bufadr),y
        sta (100),y
mvskip
        php
        dey
        bpl mvloop1
        clc
        ldx w.blk
        inx
        txa
        adc bufadr
        sta bufadr
        bcc mvskip1
        inc bufadr+1
mvskip1
        dec h.blk.t
        php
        inc y.blk.t
        ldx x.blk
        ldy y.blk.t
        jsr position
        plp
        bpl mvloop
        plp
        dec w.blk
        rts
;
; here
; x.blk - X, y.blk - Y
; of UpperLeft frame char 'ul'
; h.blk - heigth of block
; w.blk - width of block
; bufadr - address of block buffer
saveblk
        sec
        jmp moveblk
;
; here
; x.blk - X, y.blk - Y
; of UpperLeft frame char 'ul'
; h.blk - heigth of block
; w.blk - width of block
; bufadr - address of block buffer
restblk
        clc
        jmp moveblk
;
setbufadr
        lda #<blk.buf
        sta bufadr
        lda #>blk.buf
        sta bufadr+1
        rts
;
; Main Program
main
        lda #4
        sta h.blk
        lda #12
        sta w.blk
        lda #7
        sta x.blk
        lda #3
        sta y.blk
;
        jsr setbufadr
        lda w.blk
        ldx x.blk
        ldy y.blk
        jsr saveblk
;
        lda w.blk
        ldx x.blk
        ldy y.blk
        jsr frame
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        jsr position
        ldx #<opt1
        ldy #>opt1
        jsr prins.inv
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        iny
        jsr position
        ldx #<opt2
        ldy #>opt2
        jsr prins.nor
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        iny
        iny
        jsr position
        ldx #<opt3
        ldy #>opt3
        jsr prins.nor
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        iny
        iny
        iny
        jsr position
        ldx #<opt4
        ldy #>opt4
        jsr prins.nor
;
        ldx x.blk
        inx
        ldy y.blk
        iny
        iny
        iny
        iny
        iny
        jsr position
        ldx #<opt5
        ldy #>opt5
        jsr prins.nor
;
keyloop lda 764
        cmp #$FF
        beq keyloop
;
        jsr setbufadr
        lda w.blk
        ldx x.blk
        ldy y.blk
        jsr restblk
;
        ldx #0
        ldy #20
        jsr position
        rts
;
blk.buf = *
;
; Setup run address
        .or runad
        .wo start
        .en

atr included...

BlueMAE.atr

Link to comment
Share on other sites

Hi there, Draco!

 

Sorry, but I need some help...

 

At first I use SDX 4.47 in BANKED mode.

(This part of SDX deals ALL done.) LISP again...

 

The second is that I need RAMDISK for speedloading massive COMs or EXEs from it.

(By the way this ';' trick is very helpful! :) )

 

As they said that MAE uses 3 BANKS of extended memory by default... and I know almost nothing about memory extentions ...

(Really I read mans but I never tryed to program anything...)

 

I need some help about proved settings of MAE while I have 576XE Rambo extention from ctirad.

 

My problem is simple.

Even when I perfectly compile my test program I lost my RAMDISK because I can not setup it perfectly.

 

EZ

Link to comment
Share on other sites

The RAMDISK.SYS by default reserves 4 banks of the ext RAM so that programs which use 130XE RAM would not destroy the ramdisk.

 

512k of the ext RAM should consist of 32 extra banks. 1 bank will be occupied by the SpartaDOS itself, 4 banks should be free for MAE, this leaves max 27 banks for the ramdisk. Or maybe less, it depends what you are loading to the ext RAM - some SDX stuff is resident there. Therefore RAMDISK.SYS should be loaded last.

 

When you load RAMDISK.SYS without the parameters, it will automatically occupy all available banks except the 4 banks MAE (or BASIC XE or such) would use.

 

PS. PBI hard drives (like IDE+2.0 for example) are faster than ramdisks and are less trouble too.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...