CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Other Programming > Assembly
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Assembly Questions and Answers for Assembly here!

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old May 8th, 2005, 04:48 PM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Interrupts

    Could some one give me or direct me to a simple interrupt list please? I'm looking for all the interrupts that directly control hardware such as keyboard, mouse and uh.......does there exist interrupts which directly control networks hardwares such as firewire port and even wireless LAN? I still only know the basics of assembly, still have a lot to learn.
    Reply With Quote
      #2    
    Old May 9th, 2005, 03:12 AM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Interrupts

    Which system? Which CPU? And which mode? DOS/BIOS Interrupts? Port I/O?
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #3    
    Old May 9th, 2005, 06:00 AM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Re: Interrupts

    Sorry, 32-bit windows, intel 32 bit CPU's (anything compatible with 80386 through to Pentium Centrino I suppose), could you give me all the port I/O interrupts first please?
    Reply With Quote
      #4    
    Old May 9th, 2005, 06:48 AM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Interrupts

    The problem is that Win32 does not allow you to write on ports. But to use limited interrupts. You should install a DOS in Bochs or something like that on programm on this. In DOS you have full access to everything.

    Ralph Brown's Interrupt list:
    http://www.ctyme.com/intr/int.htm

    The IRQ's
    http://www.osdever.net/tutorials/irqs.php?the_id=37
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #5    
    Old May 10th, 2005, 05:31 AM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Re: Interrupts

    Thanks man!

    I would like to learn about interfacing NetBIOS. I've read quite a few introductions about what it is, what it does, and about its history. Some of them said this:

    Calling the Net Bios is accomplished by building a Net Bios
    Control Block (NCB), and execute an INT 5Ch with registers ES:BX
    containing the address of the NCB. When control is returned,
    only AX is changed.


    The question is, how do I build an NCB?
    Reply With Quote
      #6    
    Old May 10th, 2005, 05:34 AM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Post Re: Interrupts

    Oh! And I don't quite understand this table:
    Attached Files
    File Type: txt NCB table.txt (3.9 KB, 122 views)
    Reply With Quote
      #7    
    Old May 10th, 2005, 11:29 AM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Interrupts

    This table is the best you can have... .. It shows you how a NCB packet should look like!

    Just pack into a C structure... Notice to archieve that the alignment of your compiler is set to 1! Old turbo C compilers do not have a alignment feature but the newer (gnu, msvc) do.

    Code:
    typedef unsigned char   BYTE;
    typedef unsigned short WORD;
    typedef unsigned long  DWORD;
    
    typedef struct tag_NCB_PACKET
    {
       BYTE Command;
       BYTE RetCode;
       BYTE LSN;
       BYTE Num;
       DWORD BufAdr;
       WORD BufLen;
       BYTE CallName[16];
       BYTE Name[16];
       BYTE RTO;
       BYTE STO;
       DWORD Post;
       BYTE LANA_Num;
       BYTE CMD_Done;
       BYTE Reserved[14];
    } NCB_PACKET;
    
    typedef FAR *NCB_PACKET LP_NCB_PACKET;
    typedef const FAR * NCB_PACKET LPC_NCB_PACKET;
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #8    
    Old May 10th, 2005, 12:54 PM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Re: Interrupts

    Yeah cool! Thank you!

    One of the tutorials I read ages ago showed me how to draw graphics with and without using interrupts. I've learnt a lot from it and can do it myself now. The one thing I don't like about that tutorial is that it concentrates too much on what I'm supposed to do technically, but way too little on the theory behind it all. It said that, to draw without interrupts, point ES register to A000h and DI register to the offset of the pixel. My question is, how did the author of that tutorial know that ES has to be pointed to A000h for VGA of that mode? Is there a list of what ES should be pointed to for a range of hardware e.g. graphics, network, human interface, etc.?
    Reply With Quote
      #9    
    Old May 10th, 2005, 01:07 PM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Interrupts

    Quote:
    Originally Posted by Fatboy
    Yeah cool! Thank you!

    One of the tutorials I read ages ago showed me how to draw graphics with and without using interrupts. I've learnt a lot from it and can do it myself now. The one thing I don't like about that tutorial is that it concentrates too much on what I'm supposed to do technically, but way too little on the theory behind it all. It said that, to draw without interrupts, point ES register to A000h and DI register to the offset of the pixel. My question is, how did the author of that tutorial know that ES has to be pointed to A000h for VGA of that mode? Is there a list of what ES should be pointed to for a range of hardware e.g. graphics, network, human interface, etc.?
    Exactly this stuff has been normed by IBM and Intel several years ago. The norm (which you can view by downloading Intel's Programming Reference to 386) tells which memory resources are reserved for which uses. for example 0x8C00h supposed to be the default memory for characteroutput on memory for non-monochrome displays.
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
      #10    
    Old May 11th, 2005, 04:03 AM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Re: Interrupts

    I can't seem to be able to find the norm.....maybe I'm not searching with the right keywords.....could you give me a direction?
    Reply With Quote
      #11    
    Old May 11th, 2005, 05:42 AM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Re: Interrupts

    And another thing, my masm doesn't seem to be able to handle 32-bit stuff. Whenever I use 32-bit registers, masm32 gives an error saying:

    Intruction or register not allowed in current processor mode.

    Something like that. That error was given in the compilation stage, why?
    Reply With Quote
      #12    
    Old May 11th, 2005, 05:51 AM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Re: Interrupts

    sorry, the exact error was this:

    error A2085: instruction or register not accepted in current CPU mode.
    Reply With Quote
      #13    
    Old May 11th, 2005, 06:01 AM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Re: Interrupts

    Sorry, ignore my last post, I solved it by putting .386 before my code.

    Still can't find the norm though...
    Reply With Quote
      #14    
    Old May 11th, 2005, 06:06 AM
    Fatboy Fatboy is offline
    Member
     
    Join Date: Aug 2004
    Posts: 138
    Fatboy is on a distinguished road (10+)
    Re: Interrupts

    When I go into control panel and check out my hardware for example my graphics adapter, I can see, under its resources, its I/O range and memory range, what are they? Are they useful to me if I want to control the hardware in assembly? How do I make sense of them?
    Reply With Quote
      #15    
    Old May 11th, 2005, 09:27 AM
    NoHero's Avatar
    NoHero NoHero is offline
    Moderator
     
    Join Date: Mar 2004
    Location: (Upper-) Austria
    Posts: 2,899
    NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)NoHero has much to be proud of (1500+)
    Re: Interrupts

    Yes, both are address namespaces when accessing a device in DMA mode. More important is the IRQ number of the hardware...

    I have included the resource and norm from Intel...
    __________________
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Other Programming > Assembly


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    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 -5. The time now is 09:58 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009