English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 30 November 2004, 16:18   #1
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
dos/exec/intuition asm tutorials for Kickstart 1.3

Hi!

Started some heavy nostalgia coding... Need to refresh my memory. Anybody got a link to a great site with dos/exec/(intuition) assembler examples?

You know; allocate some memory, open a file, input/output to the CLI window, save file, clean up after yourself

Last edited by Photon; 30 November 2004 at 17:30. Reason: specified
Photon is offline  
Old 01 December 2004, 07:35   #2
AmiGer
Registered User
 
AmiGer's Avatar
 
Join Date: Sep 2002
Location: Germany
Posts: 349
You've got a PM...
AmiGer is offline  
Old 01 December 2004, 10:10   #3
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
Thanks for the C help, but I'm *really* looking for assembler examples, so I can see what values to give to the library routines. (And not have to look in an include that defines that value according to some definition in another include... nothing wrong with includes, in fact I could use some Assembler includes, but they should be simple lists of "variablename=value"... I'd get a headache if I tried to translate C includes to Assembler...) For example I seem to remember you give 1002 or 1003 or something to the file open routines depending on if you want to read or write, but I dont remember which.
Photon is offline  
Old 01 December 2004, 10:54   #4
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
Amiga Realm links to "The Amiga DOS online reference manual", but the link is dead. Anyone know if it is mirrored somewhere?
Photon is offline  
Old 01 December 2004, 11:19   #5
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
Found 3 code examples via google. Will be looking at them.

It's all coming back to me now! ..except this:

1) How to allocate the largest chunk of Chip memory
2) How to access the default CLI window on a Kick 1.3 machine. I seem to remember that opening a console with the name "*" didn't always work.
Photon is offline  
Old 01 December 2004, 13:38   #6
mr_0rga5m
Tik Gora :D
 
mr_0rga5m's Avatar
 
Join Date: Oct 2001
Location: Round yo momma's
Posts: 1,273
Quote:
Originally Posted by Photon
Amiga Realm links to "The Amiga DOS online reference manual", but the link is dead. Anyone know if it is mirrored somewhere?

Which particular link you on about? .. coz i tried a couple there and they all worked.

If they dont work go and try archive.org .. its excellent for retrieving long gone pages.
mr_0rga5m is offline  
Old 01 December 2004, 13:46   #7
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
Did you try the link entitled The Amiga DOS online reference manual? i.e. http://www.nethkin.com/bmori/amiga/dos1.html

Anyway after an hour of surfing, I now have enough to work with. Btw, opening a console window with the name "*" seems to work fine.
Photon is offline  
Old 01 December 2004, 13:48   #8
bobbybearing
Zone Friend
 
bobbybearing's Avatar
 
Join Date: Oct 2003
Location: France
Age: 51
Posts: 161
Quote:
Originally Posted by Photon
1) How to allocate the largest chunk of Chip memory
$20000|chip = $20002
bobbybearing is offline  
Old 01 December 2004, 13:51   #9
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
Ooh, that would almost have been helpful if you'd told me chip=2 and fast=4

Luckily I found that out myself, thanks anyway

[Edit: Bah, now you made me look like a f00l by editing your post :P]

Last edited by Photon; 01 December 2004 at 15:58.
Photon is offline  
Old 01 December 2004, 14:54   #10
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
I made a small utility (in AsmOne) to show the largest address range of free chip mem. I didn't know if I was allowed to post longish text chunks in here, so here's the link for it:

http://student.hcedu.net/ws03hen/Amiga/chiprange.s

If you're not after the source example, but could use the utility, here's the link:

http://student.hcedu.net/ws03hen/Amiga/chiprange

Hope it's useful to someone.

Last edited by Photon; 01 December 2004 at 15:19. Reason: extra link
Photon is offline  
Old 01 December 2004, 15:45   #11
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
Found this gem of a site documenting dos.library etc:

http://www.innoidea.hu/subsites/amig...&action=Search

...so now I only need to know the actual values for ACCESS_READ and ACCESS_WRITE when doing a Lock()...
Photon is offline  
Old 01 December 2004, 15:56   #12
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
Ahh! Found it!

ACCESS_READ=-2
ACCESS_WRITE=-1

...it's so hard to find when you're drowned in C examples that use values hidden in some include you never see... luckily I got help finding an include that defined it. 8)
Photon is offline  
Old 01 December 2004, 16:51   #13
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
What's the easiest way to get the NAME of the current directory? I need it to make a program load a data file from the same directory as the program, so if I can get the path to the program, that would work too. Can I get it from a register value that the OS supplies me with at the start of the program? What do the registers contain when a program is called?

(Hoping there's a guru out there that has the answers )
Photon is offline  
Old 01 December 2004, 17:01   #14
bobbybearing
Zone Friend
 
bobbybearing's Avatar
 
Join Date: Oct 2003
Location: France
Age: 51
Posts: 161
ha! I think this function doesnt exist in AmigaDOS
I remember a routine by François Lionet (Amos) for getting full path of the current directory. (the comments are in french, sorry)
Attached Files
File Type: zip curdir.zip (3.2 KB, 215 views)
bobbybearing is offline  
Old 01 December 2004, 17:38   #15
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
omg "lea -260(sp),sp" ! ! !

...So he gets the parent dir all the way up to the root and builds a path name? ... Sure would like to know if there's an easier way to do it, though.

Is there some symbol I can use in a file name, like ".\" in M$-DOS?

And I would still like to know the register values when a program is started.

But thanks for the example, I will take a look at it!
Photon is offline  
Old 02 December 2004, 08:12   #16
AmiGer
Registered User
 
AmiGer's Avatar
 
Join Date: Sep 2002
Location: Germany
Posts: 349
Quote:
Originally Posted by Photon
And I would still like to know the register values when a program is started.
a0=pointer to command line parameters
d0=length of parameter line + 1, so e.g. do this:

Code:
lea	_arg(pc),a5
move.l	a0,(a5)
subq.l	#1,d0
move.b	#0,(a0,d0.w)
AmiGer is offline  
Old 02 December 2004, 13:41   #17
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
Thanks!

No other register values I can rely on?
Photon is offline  
Old 03 December 2004, 10:05   #18
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Quote:
Originally Posted by Photon
omg "lea -260(sp),sp" ! ! !

...So he gets the parent dir all the way up to the root and builds a path name? ... Sure would like to know if there's an easier way to do it, though.

Is there some symbol I can use in a file name, like ".\" in M$-DOS?

And I would still like to know the register values when a program is started.

But thanks for the example, I will take a look at it!
I remember seeing something like PROGDIR: ??? but I think that maybe kick 3+ =[
redblade is offline  
Old 05 January 2007, 17:55   #19
SoLo2
 
Posts: n/a
Quote:
Originally Posted by Photon
Ooh, that would almost have been helpful if you'd told me chip=2 and fast=4

Luckily I found that out myself, thanks anyway

[Edit: Bah, now you made me look like a f00l by editing your post :P]
Where does it say this?

I have been thinking and found it too complicated
to try allocating absolutely in chip memory. As the
memory is needed for COPPER list, samples, etc.
and chip memory is needed.

Thanks a lot!

SoLo2
 
Old 05 January 2007, 19:54   #20
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,655
hehe, ancient thread revived

It says so in the book Includes & Autodocs, and also in exec includes that come with most Assemblers and C compilers. Now I don't have to ask much here, since I restored my old Asm-One disks, development system etc. 8)

But I always find it's much more efficient if you have full overview and control over the whole program that you're coding. No indirect references to some file somewhere... I like asm code to be "What You See Is What You Get".

I got massive anxiety when I tried to make an unfinished version of my DevSys to work. The includes had to be the same as in 1992, there were conditional assembly directives everywhere so you didn't know what got assembled, and always references to a dozen include files so you had to be a detective and find out what each declare value and macro code did.

Never again, I say. The opposite of fun. >

If you want the normal ASM includes, get Asm-One V1.01 or later (disk) from planetemu or something.
Photon is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
exec.library v45.24 looking for beta testers Cosmos Coders. General 137 26 February 2018 21:20
How to find Exec device name and unit number for boot drive mark_k Coders. System 3 16 February 2013 19:52
PCMCIA fault: DOS error code 225 - Not a valid DOS disk 4am support.Hardware 2 07 April 2012 10:20
Intuition - Menus Gilloo Coders. System 1 05 March 2012 10:11
exec.library problem with VisualPrefs oldpx support.Apps 4 29 August 2002 00:18

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:19.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13404 seconds with 16 queries