BBC BASIC for Windows
Programming >> Assembly Language Programming >> Interrupts
http://bb4w.conforums.com/index.cgi?board=assembler&action=display&num=1466113430

Interrupts
Post by Ric 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:
        mov ax, 0
        int 33
        ret
 

The above code should reset the mouse parameters, but just crashes BB4W.

Ric
Re: Interrupts
Post by DDRM 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
Re: Interrupts
Post by Ric on Jun 17th, 2016, 11:52am

Thanks D,
At work at the moment, will post the link tonight.

Ric
Re: Interrupts
Post by Ric 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
Re: Interrupts
Post by Ric 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/
Re: Interrupts
Post by Zaphod 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.


Re: Interrupts
Post by michael 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.
Re: Interrupts
Post by Ric 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
Re: Interrupts
Post by DDRM 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