CompuServe Thread

#CreatePort() in ASM

20 messages in this thread
#50635From: Mike BerroJan 25, 1987 12:29 AM
Well, I hate to look stupid, but it's better than actually being stupid. I want to use CreatePort() from assembly, and the RKM volume 2 book says that function is in the exec_support library. Where is the exec_support library documented (i.e., which registers should be used)? Thanx! —Mike
#50658From: John DraperJan 25, 1987 1:41 AM
Mike… If you are using the Addison Wesley books, go back to your dealer and ask him to supply you with appendix F of the RKM as published by Commodore. Unfortunately, it doesn't help much in this case, as it is still documented in C. There is code in Amiga.lib that might help though, so I'll see if I can give you enough clues to get you going. The Exec support docs say… struct MsgPort *CreatePort (name, pri) char *name BYTE pri; /* oops… missed ; on prev line */ { UBYTE sigBit; struct MsgPort *port; if ((sigBit = AllocSignal (-1)) == 1) return ((struct MsgPort *) 0); port = AllocMem ((ULONG) sizeof (*port), MEMF_CLEAR | MEMF_PUBLIC); if (port == 0) { FreeSignal (sigBit); return ((struct MsgPort *) (0)); } port->mp_Node.ln_name = name; port->mp_Node.ln_Pri = pri; port->mp_Node.ln_Type = NT_MSGPORT; port->mp_Flags = PA_SIGNAL; port->mp_SigBit = sigBit; port->mp_SigTask = FindTask; /* correction to above line …. port->mp_SigTask = FindTask (0); */ if (name != 0) AddPort (port); else NewList (&(port->mp_MsgList)); return (port); } ————-CreatePort in Amiga.lib says…. move.l 32(A7),D4 move.b 39(A7),D3 so I would imagine that D4 is the name and D3 is the priority. If you want the rest of the assembly stuff from Amiga.lib, let me know. Hope this helps. We straight talking assembler types need to stick together. Regards, Larry.
#50785From: Mike BerroJan 25, 1987 5:30 PM
Larry, I'm trying to read data from the serial port using assembly. I've translated the C code in "Opening the Serial Device", and am using DoIO() to grab four characters. DoIO returns an error of -3. Can you tell me what that error means? Thanx! —Mike
#50858From: John DraperJan 25, 1987 11:51 PM
I'm afraid I can't help you much right now Mike, as I have none of my books with me. I am calling from a Holiday Inn in Toronto. As a first thought, could it be invalid baud rate? The baud settings are a bit strange I think. I gather you got the CreatePort running? Regards, Larry.
#50911From: Mike BerroJan 26, 1987 2:21 AM
Yes, I think I have CreatePort running, at least I get no errors and I recover the resources when I use my DeletePort. The sample program in the RKM says you can set the flags to NULL to get the default settings, including baud rate, but maybe it isn't so. The error I get from DoIO() is -3, and 3 (Don tells me) is the error for invalid baud rate. Something tells me I should try setting the baud rate myself! I'll let you know what I find. Thanx! —Mike P.S. Pretty cold up there I hear!
#50990From: John DraperJan 26, 1987 8:38 PM
Good luck with the program Mike. Yes it is cold here. My room is colder than the outdoors in Vancouver, and I am _not_ amused. Regards, Larry.
#51066From: BILL LEACHJan 27, 1987 12:40 AM
Larry: You should not be so 'tight' and stay in those cheap, cold, damp places. Its not good for your computing equipment <grin>! 73s, bill
#51089From: Dave Haynie/C128 LandJan 27, 1987 5:09 AM
heh heh Welcome to the East Coast Larry.. <chuckle>. ….. Rick
#51518From: Brian NiessenJan 30, 1987 12:11 AM
Aw, shucks Larry, is it really cold in TO? Bri P.S. Shuda seen how cold it was in Vegas!
#51001From: John DraperJan 26, 1987 8:55 PM
Another thought Mike… by default do they really mean some default (9600?) or do they mean Preferences? If you want to check Preferences, it is really quite easy, and Aterm 7.3 does it (I wrote that part, so it must be easy). The source code for Aterm 7.3 is in DL 10, in C, but of course reasonably translatable. Regards, Larry.
#51080From: Mike BerroJan 27, 1987 3:12 AM
I have the source code for an earlier version of Aterm (thanx!), my problem is converting it to assembly! I get the error on the DoIO() call no matter what, even if I'm trying to set the baud rate (so i don't think it's that!). It's very frustrating, but that's nothing new! —Mike
#51185From: John DraperJan 28, 1987 1:05 AM
I know the feeling exactly Mike, and I wish I had dragged more books out with me. I did just remember though, there is an assembly language program in DL4 by Jez San of Firebird Software. I forget the exact name, but it is Argoterm (ARGO.SRC? ARGO.???). Anyway, he used assembler to open the serial port. Regards, Larry.
#51316From: Mike BerroJan 28, 1987 9:54 PM
Thanx, Larry……I'm off hunting…..—Mike
#50927From: David JohnsonJan 26, 1987 8:47 AM
Larry, How long are you going to stay in TO this time? There is a Amiga group meeting next monday. Aegis rep will be there demoing Sonix, new draw and a 3d package If you are around you might like to attend. dwj
#50997From: John DraperJan 26, 1987 8:48 PM
DAvid, Unfortunately (or fortunately, depending on whether I am thinking of the weather or the meeting) I will be flying back Friday evening. Regards, Larry.
#51018From: David JohnsonJan 26, 1987 10:18 PM
Larry, Too bad. You might want to try the largest Amiga BBS in TO at 445-2169. Leave a msg for Wayne to give you quick validation. You might be pleased at what is there etc. dwj
#51053From: John DraperJan 26, 1987 11:36 PM
I'd like to try it David, but I am quite busy while I am here. Maybe next trip. Regards, Larry.
#51097From: David JohnsonJan 27, 1987 8:39 AM
Okay, no problem dwj
#50948From: Mike BerroJan 26, 1987 2:33 PM
Larry, DoIO() always returns an error of -3 even when I am setting the baud rate to 1200! If I just open "ser:" for input as a DOS file, is there anyway to detect that no more data is being sent, and "jump out" of the Read()? (It's desperation time!) Thanx! —Mike
#51000From: John DraperJan 26, 1987 8:51 PM
Mike, I don't know of any way to detect end of data from SER:, but you can do it with the DoIO/SendIO/Command_Query (pick one or more… lack of docs here). The idea is to ask for a certsin number of characters within a set length of time, and to terminate when you get a timeout. Regards, Larry.