Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Assembly from DOS to QT
Qt 6.11 is out! See what's new in the release blog

Assembly from DOS to QT

Scheduled Pinned Locked Moved General and Desktop
22 Posts 7 Posters 26.2k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #11

    [quote author="Taamalus" date="1292697516"]For all others: The topic has how now drastically changed. I need to figure out how to implement WASM, an Intel's x86 assembly language, into Qt Creator.[/quote]

    That's not a matter of Qt Creator, as it is only an IDE that integrates an editor, compiler, linker, debugger and some other tools into a nice graphical user interface.

    Assembler code is highly dependend on your platform (i386, x86_64, ppc, ppc64, etc.) and the compiler/tool chain (gcc, MS Visual Studio toolchain, intel, etc.).

    You should search on the web for the details of your specific combination of the above. Maybe there are some hints on how to port from one tool chain to another.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #12

      To Gerolf Reinwardt – Those links were an eye opener. This is anything but simple to use.

      To Volker – Great. :( Since Qt Creator is cross-platform it can't adapt an Assembly Version.

      To Franzk – You are now the second person to suggest to look seriously into rewriting the code into straight C++. You would not know a good book to read? I have three about Assembly (ancient), none of which even mention C or C++. - Yes, we are off topic. PM me if this is more appropriate.

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vsorokin
        wrote on last edited by
        #13

        Taamalus, see books about C++ and Qt on "this wiki page":http://developer.qt.nokia.com/wiki/Books_and_Links_for_learning_C_and_advanced_topics.

        --
        Vasiliy

        1 Reply Last reply
        0
        • X Offline
          X Offline
          xsacha
          wrote on last edited by
          #14

          [quote author="Taamalus" date="1292716462"]To Volker – Great. :( Since Qt Creator is cross-platform it can't adapt an Assembly Version.
          [/quote]

          Look, this has nothing to do with Qt or Qt Creator.

          If you want to target a single platform, continue using your Assembly code in the compiler that supports it. If the compiler supports C++, you can use Qt too.
          Just because Qt is cross-platform doesn't mean you need to use cross-platform code.

          It works the same as if you were using plain C++.

          WASM isn't supported by any mainstream compiler so if you want to continue using it and don't care about being cross-platform, just convert it to what your compiler uses.
          The default is MingW/GCC with QtCreator.

          Any assembly code you can do within C++ in any other mainstream IDE, you can do in Qt with QtCreator.

          • Sacha
          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #15

            [quote author="Taamalus" date="1292716462"]To Volker – Great. :( Since Qt Creator is cross-platform it can't adapt an Assembly Version.[/quote]
            Qt Creator is neither the compiler nor an assembler. It works on what the underlying tool chain provides. This is gcc/g++/ld in the gnu/linux/mac world, it's the Visual Studio tool chain its the Microsoft compiler, with MinGW on Windows it's again gcc. Each of them may have another syntax for assembly language. Each of them works on different platforms (read: processor families like Intel x86 and siblings, PowerPC, ARM, and so on). You would have the very same problems with the native development environments. Qt libs and Qt creator cannot help you in this domain, which is logical programming a CPU by assembly language is by its nature very platform dependent.

            [quote author="Taamalus" date="1292716462"]To Franzk – You are now the second person to suggest to look seriously into rewriting the code into straight C++. You would not know a good book to read? I have three about Assembly (ancient), none of which even mention C or C++. - Yes, we are off topic. PM me if this is more appropriate.[/quote]

            You must understand the old code. What does it do? What's the flow of control, the data structures? etc. Then you should be able to reimplement this in plain C or C++. I don't know of any special book about this topic. We do have a wiki page on C++ books "here":http://developer.qt.nokia.com/wiki/Books_and_Links_for_learning_C_and_advanced_topics. Books about assembly language do seldom cover the links to "higher" programming languages.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #16

              [quote author="Volker" date="1292717715"][quote author="Taamalus" date="1292716462"]To Volker – Great. :( Since Qt Creator is cross-platform it can't adapt an Assembly Version.[/quote] Qt Creator is neither the compiler nor an assembler. It works on what the underlying tool chain provides. This is gcc/g++/ld in the gnu/linux/mac world, it's the Visual Studio tool chain its the Microsoft compiler, with MinGW on Windows it's again gcc. Each of them may have another syntax for assembly language. Each of them works on different platforms (read: processor families like Intel x86 and siblings, PowerPC, ARM, and so on). You would have the very same problems with the native development environments. Qt libs and Qt creator cannot help you in this domain, which is logical programming a CPU by assembly language is by its nature very platform dependent.

              You must understand the old code. What does it do? What's the flow of control, the data structures? etc. Then you should be able to reimplement this in plain C or C++. I don't know of any special book about this topic. We do have a wiki page on C++ books "here":http://developer.qt.nokia.com/wiki/Books_and_Links_for_learning_C_and_advanced_topics. Books about assembly language do seldom cover the links to "higher" programming languages.[/quote]
              That was not an complained about Qt Creator but one about Assembly. Until I posted my question and received the forum's feed back I never realized how diverse Assembly is. I assumed a low level language would come more standard.

              That also cancels my second question for a book. Unless someone converted WASM code into C++ and wrote a book about it, there wont be any books available for me to use. - Therefore I'll do as you suggest! This is anything but simple. :D

              1 Reply Last reply
              0
              • X Offline
                X Offline
                xsacha
                wrote on last edited by
                #17

                Well it's actually the opposite. The lower level the language is, the less platforms and architectures it generally covers.

                Higher-level interpreted languages like scripts and interpreted languages run on pretty much anything (think javascript, html, python).

                Qt is sort of special because it is C++ which isn't as high-level (it's closer to assembly) and yet, it is cross-platform (many operating systems and architectures are supported).

                Assembly is pretty much machine code (1:1 map) for individual architectures and compilers (which generally differ dependent on platform) generally choose different syntax.

                It works this way because, as you add layers of syntax and language the idea is to make it simpler to program in. In doing so, you usually add a type of method that performs several lower level types and methods in a way that is consistent through many platforms and architectures.

                • Sacha
                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #18

                  [quote author="Taamalus" date="1292725209"]Unless someone converted WASM code into C++[/quote]

                  More than 15 years ago I remember there was a tool doing this kind of reverse engineering (at least for C), but as I remember the resulting code was rather unreadable.

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #19

                    [quote author="Taamalus" date="1292725209"]That was not an complained about Qt Creator but one about Assembly. Until I posted my question and received the forum's feed back I never realized how diverse Assembly is. I assumed a low level language would come more standard.[/quote]

                    Ah, sorry. I misunderstood this. I cannot imagine anything other that is more platform dependend than assembly code :-) It is the lowest end of programming, since you directly manipulate the processor, i.e. load/save registers, ask the processor to do some math, etc. All that depends on the processor itself: how many registers are there, is it a "RISC":http://en.wikipedia.org/wiki/Reduced_instruction_set_computing or "CISC":http://en.wikipedia.org/wiki/Complex_instruction_set_computer architecture, and so on. Regarding this nature of assembly language, it's clear, that it's quite impossible to standardize this :-)

                    [quote author="Taamalus" date="1292725209"]That also cancels my second question for a book. Unless someone converted WASM code into C++ and wrote a book about it, there wont be any books available for me to use. - Therefore I'll do as you suggest! This is anything but simple. :D[/quote]

                    This task (writing a book) would be quit impossible. Assembler code mostly used to do some time critical tasks and is often hand optimized. One has to reverse-engineer the code and understand what it does, to back-translate it into a higher level language like C or C++.

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      Franzk
                      wrote on last edited by
                      #20

                      [quote author="Taamalus" date="1292716462"]You are now the second person to suggest to look seriously into rewriting the code into straight C++.[/quote]It only makes sense. It will improve maintainability and readability. It'll just cost you the extra time of translating (I understand it's fully written in assembly?).

                      [quote author="Taamalus" date="1292716462"]You would not know a good book to read? I have three about Assembly (ancient), none of which even mention C or C++.[/quote] A book about converting asm to c/c++? I wouldn't know of any. Besides, I don't think I'd want one. You have to actually reverse engineer the thing. Find out what the assembly does and rewrite it. It'll be worth the effort in the end if you're going to maintain that project.

                      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #21

                        [quote author="Franzk" date="1292834690"]It only makes sense. It will improve maintainability and readability. It'll just cost you the extra time of translating (I understand it's fully written in assembly?). -cut- Find out what the assembly does and rewrite it. It'll be worth the effort in the end if you're going to maintain that project. [/quote]
                        It's sort of half and half. Half is Assembly the other is C. I don't think it will make a difference, if it does, please let know.

                        I consider this thread (topic) closed. The unanimous answer is given now by all parties involved, thanks to all who took the time to give the input.

                        1 Reply Last reply
                        0
                        • G Offline
                          G Offline
                          giesbert
                          wrote on last edited by
                          #22

                          Hi Taamalus, if you want to close the thread, plesae send a small note to one of our forum admins ("denis":http://developer.qt.nokia.com/member/222 or "chetankjain":http://developer.qt.nokia.com/member/1186) our "Qt admins":http://developer.qt.nokia.com/wiki/Admins so they close the topic.
                          Thanks.

                          Nokia Certified Qt Specialist.
                          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt
                          • Unsolved