Author |
Topic: Interrupts (Read 728 times) |
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Interrupts
« Thread started on: Jun 16th, 2016, 9:43pm » |
|
At long last I have found the interrupt table and I thought this would enable me to easily encorporate user input to my assembly programs. Alas I can not get them to work. Last time I asked a question RTR told me to RTFM, so this time I have RTFM ;) ;) but I can not find the answer. Does anyone out there know how to evoke int 33? or int 16? Code: The above code should reset the mouse parameters, but just crashes BB4W.
Ric
|
« Last Edit: Jun 16th, 2016, 9:45pm by Ric » |
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: Interrupts
« Reply #1 on: Jun 17th, 2016, 09:21am » |
|
Hi Ric,
Ooh, that's taking me way beyond anything I've done! Where did you find a relevant bit of manual? That might be quite useful.
A quick look at Art of Assembler suggests that reading the keyboard buffer uses int 16h -should you be using 33 in hexadecimal (=51) for the mouse?
A bit of Googling further suggests the mouse vector should be 33 in hex.
Hope that helps.
D
|
|
Logged
|
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: Interrupts
« Reply #2 on: Jun 17th, 2016, 11:52am » |
|
Thanks D, At work at the moment, will post the link tonight.
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: Interrupts
« Reply #3 on: Jun 17th, 2016, 2:52pm » |
|
Ok, got home and put new theory to the test. ??? Here is the code It fails no matter what the interrupt number!! Code: [
opt I%
.start
mov ax, 0
int &16
ret
mov [test], eax
ret
]
Not only fail, but crashes BB4W!! Does anyone know why?
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: Interrupts
« Reply #4 on: Jun 17th, 2016, 2:58pm » |
|
Forgot to add this D. Its not in the manual, I just stumbled across it on line.
http://stanislavs.org/helppc/
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Zaphod
Guest
|
 |
Re: Interrupts
« Reply #5 on: Jun 19th, 2016, 01:32am » |
|
I may be missing the point, but if this is in the context of BB4W then surely you would just use ON MOUSE and then from there CALL your assembly code passing the event parameters via the Static variables A%, B%, C% as documented in the CALL part of the manual.
|
|
Logged
|
|
|
|
michael
Senior Member
member is offline


Posts: 335
|
 |
Re: Interrupts
« Reply #6 on: Jun 19th, 2016, 03:50am » |
|
I take it that Richard set up his assembler based on NASM:
http://www.tutorialspoint.com/assembly_programming/assembly_arithmetic_instructions.htm
( scroll down that page and you will see interrupts being used.)
I am not entirely sure how the super advanced programmer would learn the assembly language, but to put it in perspective, I watched 2 programmers compete against each other to make the same game in different languages.
They did a lot of hacking and were coding so fast, it just made me watch in awe as they burned the screen with the code. They coded almost as fast as I could type. They had to have had amazing memories, as being able to remember is critical to coding. Also having a high IQ would be important as you could see through things and problem solve at break neck speeds.
And an amazing memory is not what I have. But it doesn't mean I cant play with ASM.
You would need to learn NASM, and if David Williams could create graphics with just the ASM code, then I am assuming controlling the input outputs is possible with just ASM. But if I am not mistaken, you must set aside an area of memory to operate the ASM.
I'm guessing the Vast majority of programmers were just tinkerers, or hobby programmers. That explains why very few major games were made. I had suspicions that when major computers were released, the games that were made were most likely made from the companies that made the computers or companies that were working with them. Examples to look at would be the Acorn and Gaming consoles, like Atari and other brands. So there was big money involved. But don't take it from me.. All you would need to do is watch the documentary on Netflix with Steve Jobs and listen carefully about his strategy when he first started to mass produce the Apple. Making programming available for the Apple was crucial to the computer success, because they knew that there would be countless people who would want to try to make them do stuff. *** don't get me wrong though. There is always many people who would have the smarts to make amazing things happen. But I think they don't do it alone.
That is why, if we wanted to make something amazing in BBC Basic, many people working together on it is better. I also believe that it would be nice if Richard was a part of it, but I doubt he would do that unless say a large voice of programmers started to say something to him on his forum. ( but I doubt that will happen). I could state my case of what should have been done, but I have no leverage, no feats to compare against those who I may try to direct.
|
« Last Edit: Jun 19th, 2016, 04:59am by michael » |
Logged
|
I like making program generators and like reinventing the wheel
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: Interrupts
« Reply #7 on: Jun 19th, 2016, 1:44pm » |
|
Michael, I have started a new post on the other forum. Have a look at the answers there.
Developing software as a group is of course better than on your own, but the software I am writing is purely a personal challenge, and it will become what it is. If it gets to a point where it is workable and sensible to do so, I will put it in to libraries so anyone can play with it and develop further.
Kind Regards
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: Interrupts
« Reply #8 on: Jun 30th, 2016, 07:56am » |
|
Hi Folks,
In case anyone was following the int story, there's a resolution on the cross-platform conforum:
http://bbcbasic.conforums.com/index.cgi?board=assembly&action=display&num=1466323816
The bottom line appears to be that int is only usable in DOS, and using it in BB4W will result in a crash, so don't do it!
Best wishes,
D
|
|
Logged
|
|
|
|
|