Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. assembly language in turbo C++

assembly language in turbo C++

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    staunch
    wrote on last edited by
    #1

    this is code of gotoxy, i have made in c++ using assembly, but it is not working and giving an error of "invalid operand". plz help!!!! void _gotoxy(int row,int cols) { asm MOV AH,0x2 asm MOV DH,row// problem is here,if we use asm MOV DL,cols//constant here, it works asm MOV BH,0x0 asm INT 0x10 } void main() { clrscr(); _gotoxy(15,15); printf("x"); getch(); }

    L PJ ArendsP 2 Replies Last reply
    0
    • S staunch

      this is code of gotoxy, i have made in c++ using assembly, but it is not working and giving an error of "invalid operand". plz help!!!! void _gotoxy(int row,int cols) { asm MOV AH,0x2 asm MOV DH,row// problem is here,if we use asm MOV DL,cols//constant here, it works asm MOV BH,0x0 asm INT 0x10 } void main() { clrscr(); _gotoxy(15,15); printf("x"); getch(); }

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      ummmmmm dh is a 8 bit register so is dl and ints are 16 or 32 bits ... could it be that u are loading the wrong bit of the int value into the register and doing something really squiffy later? also can u access the params by name? i always used to use the stackframe offset :suss:


      "... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away"
      sonork: 100.18128   8028finder.com

      1 Reply Last reply
      0
      • S staunch

        this is code of gotoxy, i have made in c++ using assembly, but it is not working and giving an error of "invalid operand". plz help!!!! void _gotoxy(int row,int cols) { asm MOV AH,0x2 asm MOV DH,row// problem is here,if we use asm MOV DL,cols//constant here, it works asm MOV BH,0x0 asm INT 0x10 } void main() { clrscr(); _gotoxy(15,15); printf("x"); getch(); }

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        hmmm, I just answered this exact same question. Two people with the same problem or a case of severe impatience:~ http://www.codeproject.com/script/comments/forums.asp?msg=249735&forumid=1647#xx249735xx


        CPUA 0x5041 Sonork 100.11743 Chicken Little "So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies Within you lies the power for good - Use it!

        Within you lies the power for good; Use it!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups