asm issue

This is a discussion on asm issue within the Tech Board forums, part of the Community Boards category; I am not familiar with assembler, so I hope that somebody might help me with this: My program controls 2 ...

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    13

    Post asm issue

    I am not familiar with assembler, so I hope that somebody might help me with this:

    My program controls 2 PCI grafic cards. Using the asm commands:
    Code:
    asm {   // activate new crt-controller
      MOV AX,switch_pci
      MOV BX,mon
      MOV CX,0x0083
      MOV DI,0x0004
      INT 0x1A       
    }
    
    and
     asm {    // switch off last activated crt-controller
      MOV AX,switch_pci
      MOV BX,mon
      MOV CX,0x0000
      MOV DI,0x0004
      INT 0x1A
    }
    This works fine, however when I use a PC with another CPU Type (another Sockel) then this switching does not work anymore.

    Does this Register commands only apply to a certain CPU type ?
    Is this the problem ?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,453
    Lemme guess, all your 16-bit real-mode code is being run inside XP ?
    Give us some specifics man, not something vague like "another machine".
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    That code is just loading registers with values and executing interrupts. We have no way of helping you without knowing:

    1. switch_pci
    2. mon
    3. register requirements and value requirements (for handler)
    4. handler that is installed on interrupt 0x1A and what it does, expects, etc.

  4. #4
    Registered User
    Join Date
    Nov 2004
    Posts
    13
    It's pure DR-DOS OS (what else) and really it's just another CPU and also a much faster board...I hope that the PCI adapters can manage this..

  5. #5
    Registered User
    Join Date
    Nov 2004
    Posts
    13
    switch_pci:
    Code:
    WORD switch_pci = 0xB10C;
    mon is address of specific PCI adapter, retrieven by:
    Code:
      for (i=0;i<4;i++)                          // search for crt-controllers
      {
    	 asm {  MOV AH,0xb1
    			  MOV AL,0x2
    			  MOV CX,0xe0
    			  MOV DX,0x102C
    			  MOV SI,i
    			  INT 0x1a
    			  MOV register_ah,AH
    			  MOV register_bh,BH
    			  MOV register_bl,BL
    		  }
    	 if (register_ah != 0x86)                 // found crt-controller
    	 {
    		moni[i] = register_bl;                 // store address
    		loggerDigit("found CRT: ", i+1);
    	 }
    	 else
    		break;
      }

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    It's pure DR-DOS OS (what else) and really it's just another CPU and also a much faster board...I hope that the PCI adapters can manage this..
    This makes no sense.

    What does 0x1A do? I am not familiar with DRDOS and have no need of it. If you are going to relegate yourself to outdated programming, then buy some outdated books and read them.

  7. #7
    Registered User
    Join Date
    Nov 2004
    Posts
    13
    Funny, in this forum I always have to post the solution by myself...
    Maybe this helps others too:
    The issue is that newer boards can have more than 1 pci bus, and if not specified
    bus number 0 is taken by default. Solution: Specify correct pci bus number:
    Code:
    MOV BH,pciBusNumber
    DRDOS

  8. #8
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    You did not give a clear indication of what interrupt 0x1A even did. How are we supposed to know what the values being passed in the registers even do w/o more information?

    That's like me asking you to tell me what this does.

    Code:
    ...
    __asm {
      mov ecx,160d
      mov edx,100d
      mov eax,04d
      int 33h
    }
    If you think that by posting tidbits of arcane, unexplained assembly on this board makes you an uber coder, you are sorely mistaken.

    Perhaps you need to read the FAQ on how to ask a good question. If you follow the FAQ you are definitely going to get better responses from the board.
    Last edited by VirtualAce; 07-04-2006 at 04:06 AM.

  9. #9
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,453
    Mmm, so by "board" you mean something in say a 6U form factor which is used in an embedded environment rather than say an Asus which is found in a normal desktop machine?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc asm code syntax
    By Uberapa in forum C Programming
    Replies: 4
    Last Post: 06-15-2007, 01:16 AM
  2. Asm + C++
    By JaWiB in forum C++ Programming
    Replies: 17
    Last Post: 06-26-2003, 03:13 PM
  3. Understanding ASM
    By kuphryn in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 07-12-2002, 07:39 PM
  4. asm mov
    By manu in forum C++ Programming
    Replies: 1
    Last Post: 12-15-2001, 11:59 AM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 05:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21