|
|
Serial device problems (68k assembler) |
Posted on: 2011/11/28 17:18
#1 |
|---|---|---|
|
Just can't stay away
![]()
Joined:
2009/10/7 1:11 From Copenhagen
Posts: 1205
|
I'm trying to open the serial device from the Napalm net driver. Sometimes it works, but some other times it hangs the entire machine right at the call to OpenDevice(). I'm wondering why this is. Here is my garbled code:
MOVEA.L ABSEXECBASE.W,A6 ;080: 2c780004
|
|
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/11/28 18:52
#2 |
|---|---|---|
|
Not too shy to talk
![]()
Joined:
2006/12/1 23:50 From Skærbæk. Denmark
Posts: 266
|
I can not see any errors, other than the posibility that your debug functions trashes the D0 Register.
|
|
|
_________________
“The best thing about a boolean is even if you are wrong, you are only off by a bit.” |
||
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/11/28 21:06
#3 |
|---|---|---|
|
Just can't stay away
![]()
Joined:
2009/10/7 1:11 From Copenhagen
Posts: 1205
|
I have tried to remove all debug output, so that is not the problem.
And even if I try copying the code to a separate small project that just opens and closes the serial device, then there is no problem. The problem arises only when this very same code is run as part of the network driver in Napalm... Annoying!! Who's the expert on serial device issues?? |
|
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/11/30 18:12
#4 |
|---|---|---|
|
Just can't stay away
![]()
Joined:
2009/10/7 1:11 From Copenhagen
Posts: 1205
|
Arrrgh!!!...
|
|
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/11/30 20:41
#5 |
|---|---|---|
|
Just can't stay away
![]() Joined:
2006/12/1 18:01 From Copenhagen, Denmark
Posts: 1244
|
Quote:
alfkil wrote: Best regards, Niels |
|
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/12/1 8:51
#6 |
|---|---|---|
|
Just can't stay away
![]()
Joined:
2009/10/7 1:11 From Copenhagen
Posts: 1205
|
@niels
Thanks Niels, I will do that . |
|
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/12/2 1:32
#7 |
|---|---|---|
|
Not too shy to talk
![]()
Joined:
2006/12/1 23:50 From Skærbæk. Denmark
Posts: 266
|
Checking out you source again I found this...
acording to my old Autodoc it do not mention that the CreateMsgPort() returns the result in D0. Small chance this is wrong. and you OpenDevice() ends with a TST D0, here you do not set the size it uses... if I remember correct ASM-Pro uses .w as default, this is wrong as the result is only a Byte size.. but that depends on the assembler you uses. René |
|
|
_________________
“The best thing about a boolean is even if you are wrong, you are only off by a bit.” |
||
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/12/2 6:21
#8 |
|---|---|---|
|
Just can't stay away
![]() Joined:
2006/11/30 11:30 From Finland
Posts: 1801
|
@rwo
Quote:
Result should always be in D0 if function has one, except for a few functions in utility.library that return a 64-bit result in which case it's in D0/D1. |
|
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/12/2 14:00
#9 |
|---|---|---|
|
Just can't stay away
![]()
Joined:
2009/10/7 1:11 From Copenhagen
Posts: 1205
|
@rwo
I am using phxass. It seems, that if I put crimsoncrisis on the Petunia blacklist (SYS:Prefs/Compatibility), then the problem does not arise. How could this be?? |
|
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/12/2 15:55
#10 |
|---|---|---|
|
Not too shy to talk
![]()
Joined:
2006/12/1 23:50 From Skærbæk. Denmark
Posts: 266
|
@alfkil
OpenDevice() puts the result in D0 but only as a byte (move.b d0).. So you should really change your 'TST D0' to 'TST.B D0'.. for I expect phxass converts your 'TST D0' into 'TST.W D0' so it check to many bits.. As the 24 upper bits in D0 is trash from anywhere, and blacklisting it will only result it being run from a diffrent place and will ofcoase result in diffrent upper 24bits. But if this change do not work I must say I don't have an idea whats is wrong. Btw: what serial device do you open? EDIT: Windows locked up, so I had to make a temp save Edited by rwo on 2011/12/2 16:13:48
|
|
|
_________________
“The best thing about a boolean is even if you are wrong, you are only off by a bit.” |
||
|
|
Re: Serial device problems (68k assembler) |
Posted on: 2011/12/3 21:45
#11 |
|---|---|---|
|
Just can't stay away
![]()
Joined:
2009/10/7 1:11 From Copenhagen
Posts: 1205
|
@rwo
I have tried to change TST to TST.B, and so far it has not hung up on me! Thanks for noticing this (if this is really the solution)! ![]() |
|



.