Jump to content
IGNORED

Ma65 macro assembler for spartados


Recommended Posts

HI !!

 

trying it under spartados /side 2

 

works well as long as i don't put line numbers on source files

 

if i do i get E A errors

 

can someone put an example line here to check the formatting?

Link to comment
Share on other sites

I think the source code here (from the open-source website with no source code on it) is in MA65 format. You sure don't want to put line numbers in there... I didn't write MA65 with line numbers in mind at all.

 

Labels should start it column 0, and op codes should have a space or tabs in front of them.

 

If there's any interest, I'd like to update this assembler so that it outputs non-segmented files and has a more broadly compatible set of pseudo-ops.

Edited by flashjazzcat
Link to comment
Share on other sites

  • 2 weeks later...

I think the source code here (from the open-source website with no source code on it) is in MA65 format. You sure don't want to put line numbers in there... I didn't write MA65 with line numbers in mind at all.

 

Labels should start it column 0, and op codes should have a space or tabs in front of them.

 

If there's any interest, I'd like to update this assembler so that it outputs non-segmented files and has a more broadly compatible set of pseudo-ops.

 

tried the compiler with "the visitor" program, page 110 ,Atari Roots,

of course replaced .BYTE with DB

 

compiled without errors, but the .obj output program does hang the machine or even nothing?!

 

i need to "trust" this program / spartados 4.46 before doing bigger things on it

wanting to switch back to A8 native coding from pc emulators :-)

Edited by 8bit-guy
Link to comment
Share on other sites

tried the compiler with "the visitor" program, page 110 ,Atari Roots,

of course replaced .BYTE with DB

 

compiled without errors, but the .obj output program does hang the machine or even nothing?!

 

i need to "trust" this program / spartados 4.46 before doing bigger things on it

wanting to switch back to A8 native coding from pc emulators :-)

 

A laudable aim, and of course one must have reasonably complete confidence in a compiler lest it introduces more headaches when developing and debugging. :)

 

Can you post the sources here? I'd like to investigate myself, since I aim to make some improvements to this assembler.

 

Note that the first two versions of The Last Word were developed exclusively using this assembler back in the late Nineties. Some 250KB of source code on DD floppy disks. :D

 

Found it:

 

10 ;
20 ; THE VISITOR
30 ;
35 TXTBUF=$5041
40 OPNSCR=$5003
50 PRNTLN=$5031
70 ;
80  *=$600
90 ;
0100 TEXT .BYTE $54,$41,$4B,$45,$20,$4D,$45,$20
0110  .BYTE $54,$4F,$20,$59,$4F,$55,$52,$20
0120  .BYTE $4C,$45,$41,$44,$45,$52,$21
0130 ;
0140 VIZTOR
0150 ;
0160  LDX #0
0170 LOOP LDA TEXT,X
0180  STA TXTBUF,X
0190  INX
0200  CPX #23
0210  BNE LOOP
0220  JSR OPNSCR
0230  JSR PRNTLN
0240 INFIN JMP INFIN

 

Note this is dependent on the "PRNTSC" routine in the same section already being assembled in RAM. I assume you're just appending the two sections of source code together and compiling them into a single OBJ file. If so, watch out for your RUN address. You need the following at the end of the source code:

 

ORG $2e0
.WORD VIZTOR

 

This will ensure DOS executes the correct segment of code. At the moment, DOS might be transferring control directly to the screen print routine or the middle of some data, depending on how you've set things up. Anyway - please post or PM your version of the source code so I can have a look.

Edited by flashjazzcat
Link to comment
Share on other sites

A laudable aim, and of course one must have reasonably complete confidence in a compiler lest it introduces more headaches when developing and debugging. :)

 

Can you post the sources here? I'd like to investigate myself, since I aim to make some improvements to this assembler.

 

Note that the first two versions of The Last Word were developed exclusively using this assembler back in the late Nineties. Some 250KB of source code on DD floppy disks. :D

 

Found it:

 

10 ;
20 ; THE VISITOR
30 ;
35 TXTBUF=$5041
40 OPNSCR=$5003
50 PRNTLN=$5031
70 ;
80 *=$600
90 ;
0100 TEXT .BYTE $54,$41,$4B,$45,$20,$4D,$45,$20
0110 .BYTE $54,$4F,$20,$59,$4F,$55,$52,$20
0120 .BYTE $4C,$45,$41,$44,$45,$52,$21
0130 ;
0140 VIZTOR
0150 ;
0160 LDX #0
0170 LOOP LDA TEXT,X
0180 STA TXTBUF,X
0190 INX
0200 CPX #23
0210 BNE LOOP
0220 JSR OPNSCR
0230 JSR PRNTLN
0240 INFIN JMP INFIN

 

Note this is dependent on the "PRNTSC" routine in the same section already being assembled in RAM. I assume you're just appending the two sections of source code together and compiling them into a single OBJ file. If so, watch out for your RUN address. You need the following at the end of the source code:

 

ORG $2e0
.WORD VIZTOR

 

This will ensure DOS executes the correct segment of code. At the moment, DOS might be transferring control directly to the screen print routine or the middle of some data, depending on how you've set things up. Anyway - please post or PM your version of the source code so I can have a look.

 

you're right, took this as an example ,

 

was just appending the two sections of source code together,great

working now

 

but first i took an even simpler example:

 

page 99 ,routine for moving a block of text,

again no compiling errors with very few adaptations :-)

 

but executing the obj program hangs spartados

what am i'm doing wrong?

Edited by 8bit-guy
Link to comment
Share on other sites

  • 2 weeks later...

I have encountered EXACTLY the same problem attempting to run precisely these programmes from 'Atari Roots' under SDX4.46.

 

As I recall you enter the routine to print to the screen. You then enter 'The Visitor'. Assemble both then save the resultant sections of memory as object code. Then, inside SDX use 'Load' to read both images into memory and finally attempt to run them having dropped to BASIC with x=usr(1536). And... It crashes every time. I could never get it to work using either Load or BLoad. The only difference from your setup 8bit-guy being I was assembling using the bog-standard Atari Assembler Editor cartridge - version 1.0 with 'CPY' bug and all. Interestingly in Atari DOS's 2.0s, 2.5, 4.0 or XE it does work - and I tried them all!

 

At the time I knew almost nothing about either ASM or SDX and just thought they were incompatible in some way, probably well known to other more experienced fellows. Given Phaeron's rather devastating analysis of several of the other programmes in Atari Roots though I am starting to loose faith in Mr. Andrews coding skill! It remains an excellent text though, if only in conveying the basic ideas and giving confidence.

Link to comment
Share on other sites

I have encountered EXACTLY the same problem attempting to run precisely these programmes from 'Atari Roots' under SDX4.46.

 

As I recall you enter the routine to print to the screen. You then enter 'The Visitor'. Assemble both then save the resultant sections of memory as object code. Then, inside SDX use 'Load' to read both images into memory and finally attempt to run them having dropped to BASIC with x=usr(1536). And... It crashes every time. I could never get it to work using either Load or BLoad. The only difference from your setup 8bit-guy being I was assembling using the bog-standard Atari Assembler Editor cartridge - version 1.0 with 'CPY' bug and all. Interestingly in Atari DOS's 2.0s, 2.5, 4.0 or XE it does work - and I tried them all!

 

At the time I knew almost nothing about either ASM or SDX and just thought they were incompatible in some way, probably well known to other more experienced fellows. Given Phaeron's rather devastating analysis of several of the other programmes in Atari Roots though I am starting to loose faith in Mr. Andrews coding skill! It remains an excellent text though, if only in conveying the basic ideas and giving confidence.

 

 

maybe this thread is too complex for me,but

as a beginner reading the book, which setup

would you suggest to avoid all the typing while trying the programs?

Altirra+mac 65 ?

 

how do i switch to mydos4.53 to save load files then ?

Link to comment
Share on other sites

Not at all Aking! There is never anything too complex. You just have to break it down.

 

"Altirra" certainly. That goes without saying.

 

Personally I got all the programmes to run using any of the Atari DOSes from 2.0s to xe. The latter causes an incredibly annoying, high pitched whistle when you try to save or load things though so in the end I used plain old DOS 2.5.

 

I also used only the 'Atari Assembler Editor' cartridge - and to save future irritation make sure you get the later version that corrects the 'cpy' bug!

 

http://www.atarimania.com/utility-atari-400-800-xl-xe-assembler-editor_19777.html

 

I have never myself used the Atari native mac65. I did however recently move over to cross-assembling, that is writing the code in a windows platform and then using a windows native assembler to produce 6502 code you can then import in to Altirra in a variety of ways. Most of these windows assemblers are based on mac65 - ATasm and MADS for instance - and accept code written for it with almost no alteration.

 

For the absolute and total beginner I would recommend the simplest possible set up. which for me was Altirra,DOS 2.5 and 'Atari Assembler Editor'. From that combination I managed to find my feet a little bit and begin to experiment on my own away from the examples in the book - which is always the best way to learn in my opinion.

 

Just be aware that some of the source code given in Atari Roots is not always to be treated as writ from the gods! Particularly later on in the advanced Graphics section Mark Andrews makes a couple of VERY serious but quite difficult to spot errors. This especially the case if a beginner is working through step by step Do as he says, not always as he does!

 

Finally - TYPE them in! I mean that seriously. It is tempting to copy and paste, but like taking notes in a college lecture by hand rather than relying on the printed notes it helps you learn FAR more than you otherwise would. The compromise I made was to type the source in to a comfortable windows text editor without the myriad irritating issues of trying to type directly in to the emulated atari. Then when finished you can either load it through the altirra host device or simply copy from the text editor and paste in to Altirra where it appears as if you HAVE typed it in.

Link to comment
Share on other sites

Not at all Aking! There is never anything too complex. You just have to break it down.

 

"Altirra" certainly. That goes without saying.

 

Personally I got all the programmes to run using any of the Atari DOSes from 2.0s to xe. The latter causes an incredibly annoying, high pitched whistle when you try to save or load things though so in the end I used plain old DOS 2.5.

 

I also used only the 'Atari Assembler Editor' cartridge - and to save future irritation make sure you get the later version that corrects the 'cpy' bug!

 

http://www.atarimani...itor_19777.html

 

I have never myself used the Atari native mac65. I did however recently move over to cross-assembling, that is writing the code in a windows platform and then using a windows native assembler to produce 6502 code you can then import in to Altirra in a variety of ways. Most of these windows assemblers are based on mac65 - ATasm and MADS for instance - and accept code written for it with almost no alteration.

 

For the absolute and total beginner I would recommend the simplest possible set up. which for me was Altirra,DOS 2.5 and 'Atari Assembler Editor'. From that combination I managed to find my feet a little bit and begin to experiment on my own away from the examples in the book - which is always the best way to learn in my opinion.

 

Just be aware that some of the source code given in Atari Roots is not always to be treated as writ from the gods! Particularly later on in the advanced Graphics section Mark Andrews makes a couple of VERY serious but quite difficult to spot errors. This especially the case if a beginner is working through step by step Do as he says, not always as he does!

 

Finally - TYPE them in! I mean that seriously. It is tempting to copy and paste, but like taking notes in a college lecture by hand rather than relying on the printed notes it helps you learn FAR more than you otherwise would. The compromise I made was to type the source in to a comfortable windows text editor without the myriad irritating issues of trying to type directly in to the emulated atari. Then when finished you can either load it through the altirra host device or simply copy from the text editor and paste in to Altirra where it appears as if you HAVE typed it in.

 

Nice , :D

BUT

 

please detail me the exact method you used

 

example:

load atari asm in altirra , paste txt from notepad

asm

 

then

 

save

 

and boot dos 2.5 atr to run?

 

any other advice?

Link to comment
Share on other sites

I'd say you've got the skeleton of the process working there - assuming you already have a fresh disk with DOS files copied on to it.

 

1. Start Altirra

2. 'insert' the freshly formatted disk image with the DOS files copied on to it in drive 1

3. 'insert' the 'Atari Assembler Editor' cartridge image in to the main cartridge slot

4. Altirra will automatically reboot and when complete you will see the 'Edit' prompt instead of the usual 'Ready'

5. Type in the source code using a windows text editor like notepad - make sure you press 'Enter' after the last line!

6. Select all the source code text from inside Notepad and then Copy

7. Bring Altirra to the focus and use 'View->Paste Text' to get the source inside Altirra.

8. At the 'Edit' prompt type 'ASM'. I found it more useful to activate the emulated printer, open its dockable window and type 'ASM,#p' as that way you can examine the full assembly listing on the 'hard copy' and more easily spot and correct errors.

9. Assuming you have no errors type 'LIST#D1:SOURCE.SRC' - this will save text source code on to your disk in drive 1. SOURCE.SRC is a place holder. Atari Roots will usually tell you which name to give your source code,

10. To save the object code type 'SAVE#D1:NAME.OBJ<START ADDRESS, END ADDRESS' 'NAME.OBJ' is again a place holder, a better name will be suggested in Atari roots. 'START ADDRESS' AND 'END ADDRESS' are also placeholders, determined by the section of memory your programme as been assembled in to. The 'ASM' printer listing will show you which memory addresses it begins and ends at.

11. finally, enter DOS with the usual 'DOS' at the 'Edit' prompt.

12. Assuming DOS 2.5 choose option 'L' - Binary Load and give it the filename you chose for your object code,

13. Once this has loaded choose option 'M' - Run at address and give it the start memory address of your programme.

14. Alternately, if you typed up your routine so it can be used from basic - including the vital PLA and RTS instructions - prepend step 11 with Detach Cartridge and Altirra will reboot in to basic.

15 Perform steps 11&12 as above.

16 Once the object file has loaded drop out of DOS and back in to BASIC with option B - Run Cartridge.

17 From BASIC type x=usr(MEMORY ADDRESS) - MEMORY ADDRESS being a place holder for the location in memory where your programme begins, in DECIMAL format - and all being well your machine language program should run!

 

I hope it helps! Atari Roots does cover quite a bit of this ground itself though, so you have at least two references to check with once you get used to operating Altirra as a pretend 'virtual' machine.

Link to comment
Share on other sites

I'd say you've got the skeleton of the process working there - assuming you already have a fresh disk with DOS files copied on to it.

 

1. Start Altirra

2. 'insert' the freshly formatted disk image with the DOS files copied on to it in drive 1

3. 'insert' the 'Atari Assembler Editor' cartridge image in to the main cartridge slot

4. Altirra will automatically reboot and when complete you will see the 'Edit' prompt instead of the usual 'Ready'

5. Type in the source code using a windows text editor like notepad - make sure you press 'Enter' after the last line!

6. Select all the source code text from inside Notepad and then Copy

7. Bring Altirra to the focus and use 'View->Paste Text' to get the source inside Altirra.

8. At the 'Edit' prompt type 'ASM'. I found it more useful to activate the emulated printer, open its dockable window and type 'ASM,#p' as that way you can examine the full assembly listing on the 'hard copy' and more easily spot and correct errors.

9. Assuming you have no errors type 'LIST#D1:SOURCE.SRC' - this will save text source code on to your disk in drive 1. SOURCE.SRC is a place holder. Atari Roots will usually tell you which name to give your source code,

10. To save the object code type 'SAVE#D1:NAME.OBJ<START ADDRESS, END ADDRESS' 'NAME.OBJ' is again a place holder, a better name will be suggested in Atari roots. 'START ADDRESS' AND 'END ADDRESS' are also placeholders, determined by the section of memory your programme as been assembled in to. The 'ASM' printer listing will show you which memory addresses it begins and ends at.

11. finally, enter DOS with the usual 'DOS' at the 'Edit' prompt.

12. Assuming DOS 2.5 choose option 'L' - Binary Load and give it the filename you chose for your object code,

13. Once this has loaded choose option 'M' - Run at address and give it the start memory address of your programme.

14. Alternately, if you typed up your routine so it can be used from basic - including the vital PLA and RTS instructions - prepend step 11 with Detach Cartridge and Altirra will reboot in to basic.

15 Perform steps 11&12 as above.

16 Once the object file has loaded drop out of DOS and back in to BASIC with option B - Run Cartridge.

17 From BASIC type x=usr(MEMORY ADDRESS) - MEMORY ADDRESS being a place holder for the location in memory where your programme begins, in DECIMAL format - and all being well your machine language program should run!

 

I hope it helps! Atari Roots does cover quite a bit of this ground itself though, so you have at least two references to check with once you get used to operating Altirra as a pretend 'virtual' machine.

 

 

nice, all ok, but

when i type any disk command , list ,save etc , i get error 144 disk protected

 

attached is the dos image i'm using

Edited by Aking
Link to comment
Share on other sites

I'm guessing that image is a DOS master disk. Although you certainly can save your data on to it - it is the usual practice to format a blank floppy and then boot in to the master disk just this once in order to copy the DOS files on to your blank floppy. That way you only need to use this new bootable disk and you don't have to worry about potentially over-writing your master disk.

 

However all of that is the process with a 'real iron' physical machine. In the world of virtual computers you could just if you wanted make many copies of the master disk in windows and use those with Altirra. It depends what you are in to - I like using the virtual machine as if it were a real once, at least when I am playing games and experimenting with any new hardware phaeron might add.

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...