Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert x86 Assembly Code to QBasic
#1
Challenge:
Create a program to take a file written x86 Assembly Language and convert it to a QBasic .bas file.

Requirements:
  • accept any ASCII format text file
  • outputs an ASCII format file (with either .txt or .bas extension)
  • supports all commands in the x86 assembly language
  • will use Call Interrupt for any code not recognized as QBasic based
  • must be written in QB (not FB)

Judging is based on similarity to the origional .bas file.

If you want a refrence for what QB keywords translate into what asm commands, compile a program with the /zi option, put cv.exe in the same folder as the compiled .exe, go into command prompt, use chdir to change the directory to the one that your program is in, and type "cv [progname]" where [progname] is the name of your program (with the .exe extension).
Reply
#2
That's rather impossible - QB statements usually don't translate into just one assembler instruction, and QB only uses a small subset of the possible range of x86 instructions.
Reply
#3
Anything that wasn't generated by QB could be placed into QB by using DATA, READ, and CALL INTERRUPT, right? And wouldn't the same set of QB commands always translate into the same set of assembler instructions, and wouldn't the reverse be true too? If not, how does the QB compiler work?
Reply
#4
debug.com
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#5
The idea still holds, if it can be done, the reverse should be able to be done (at least in this case--I think). However command.com assembles the code from the .bas file, the reverse should be able to be done, at least to some extent. You should be able to take qb generated assembly code, and turn it back into qb commands, right?
Reply
#6
Wrong. It's kinda like Humpty Dumpty...... and all the kings horses and all the kings men cannot put Humpty Dumpty together again.

In a university research enviromment, given enough time and resources, you could conceive of this kind of reverse-engineering project being achieved. But it is definitely not material for a challenge on this forum to be implemented by one person in a finite amount of time.
*****
Reply
#7
I have to agree with Moneo here. In QB all instructions are not tranlated to Assembler, but rather to B$MNEMONIC which are in themselves series of assembly code. best that could be done is a translation to those B$MNEMONICS so to speak.
hen they say it can't be done, THAT's when they call me ;-).

[Image: kaffee.gif]
[Image: mystikshadows.png]

need hosting: http://www.jc-hosting.net
All about ASCII: http://www.ascii-world.com
Reply
#8
All variable and function names are lost when you compile in QB

DO, LOOP; WHILE, WEND; FOR, NEXT; LABEL:, GOTO all translate to almost the same.

For example:
A = 0
DO
A = A + 1
LOOP WHILE A < 10

Is equal to:
FOR A = 0 TO 10
NEXT

Or:
A = 0
Label:
A = A + 1
IF A < 10 THEN GOTO Label

Or even:
A = 0
WHILE A < 10
A = A + 1
WEND

They dont result in the same, ASM output, but you have no real way of knowing what the user did.


In the end, too much work for a challenge
Reply
#9
Oh well. I thought it might be interesting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)