inherit
143665
wildgoosespeeder wildgoosespeeder wildgoosespeeder
0
Jun 14, 2018 5:59:55 GMT -8
wildgoosespeeder
ProBoards V5 be trippin'. I'm disoriented. :P
4,393
August 2009
wildgoosespeeder
|
Post by wildgoosespeeder on Oct 11, 2010 18:07:18 GMT -8
I have no idea what I'm doing at this moment when making programs in assembly (MASM611). My teacher isn't making it any easier to understand. What I'm supposed to do is to be able to encrypt/decrypt a message typed in. ALPHA_TABLE DB ZYXWVUTSRQPONMLKJIHGFEDCBA NUMERIC_TABLE DB 9876543210 M=N, L=O, K=P...A=Z What I currently have: wimg.co.uk/k9S.txtHelp? I wish I could cheat and make this program in C++ or something.
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Oct 11, 2010 19:24:06 GMT -8
I'm taking an assembly class right now as well, and you appear to be at the same place as I am but I haven't read the chapter on jumps/loops/if statements yet haha. I plan on playing catch up in that class on Wednesday and Thursday, so if you still need help by then I can take another look when I know all the commands.
By the way, assembly blows. People who create compilers like Bjarne Stroustrup have to be robots.
You could write a very simple encryption/decryption algorithm in C++ and then disassemble your code just so you know.
|
|
inherit
143665
wildgoosespeeder wildgoosespeeder wildgoosespeeder
0
Jun 14, 2018 5:59:55 GMT -8
wildgoosespeeder
ProBoards V5 be trippin'. I'm disoriented. :P
4,393
August 2009
wildgoosespeeder
|
Post by wildgoosespeeder on Oct 15, 2010 15:17:39 GMT -8
By the way, assembly blows. People who create compilers like Bjarne Stroustrup have to be robots. I (and possibly many other students) think my teacher is egotistical. She thinks high-level programming languages make programmers dumber but really they just makes creating programs easier and faster for programmers. Get with the times old timer! You could write a very simple encryption/decryption algorithm in C++ and then disassemble your code just so you know. OK, but what disassembler program would you recommend that can translate C++, scratch that, make that C# source code (or C# compiled exe) to assembly source code?
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Oct 16, 2010 15:32:34 GMT -8
I (and possibly many other students) think my teacher is egotistical. She thinks high-level programming languages make programmers dumber but really they just makes creating programs easier and faster for programmers. Get with the times old timer! I have a female teacher as well, but she isn't that hard core. I can't even imagine implementing a full scale program with objects and inheritance in assembly. >< OK, but what disassembler program would you recommend that can translate C++, scratch that, make that C# source code (or C# compiled exe) to assembly source code? Your IDE can show you the disassembled code, you just need to find the option. By the way, C# is compiled into intermediate/byte code like Java, it's not compiled into native code. It actually runs in a virtual machine which converts the byte code into native code at runtime.
|
|
inherit
143665
wildgoosespeeder wildgoosespeeder wildgoosespeeder
0
Jun 14, 2018 5:59:55 GMT -8
wildgoosespeeder
ProBoards V5 be trippin'. I'm disoriented. :P
4,393
August 2009
wildgoosespeeder
|
Post by wildgoosespeeder on Oct 16, 2010 15:41:32 GMT -8
Your IDE can show you the disassembled code, you just need to find the option. Elaborate. By the way, C# is compiled into intermediate/byte code like Java, it's not compiled into native code. It actually runs in a virtual machine which converts the byte code into native code at runtime. Not even making a C# console application?
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Oct 16, 2010 15:55:45 GMT -8
The compiler compiles the source code into assembly which your IDE can show you. I use CodeBlocks and the debugger program it uses allows me to actually step through each assembly instruction line by line. Below is the assembly for a code that I just wrote. So basically you just need to find the option in your IDE that lets you view the disassembled code.
00401318 push %ebp 00401319 mov %esp,%ebp 0040131B and $0xfffffff0,%esp 0040131E sub $0x10,%esp 00401321 call 0x401740 <__main> 00401326 movl $0x0,0x8(%esp) 0040132E movl $0x1,0xc(%esp) 00401336 mov 0xc(%esp),%eax 0040133A add %eax,0x8(%esp) 0040133E mov $0x0,%eax 00401343 leave 00401344 ret
I'm nearly positive that all C# programs as well as all other Microsoft languages (Visual Basic, J++ etc.) are compiled into Microsoft's intermediate language. To disprove this you would need to run a .NET program on a computer that does not have the .NET Framework installed.
|
|
inherit
143665
wildgoosespeeder wildgoosespeeder wildgoosespeeder
0
Jun 14, 2018 5:59:55 GMT -8
wildgoosespeeder
ProBoards V5 be trippin'. I'm disoriented. :P
4,393
August 2009
wildgoosespeeder
|
Post by wildgoosespeeder on Oct 16, 2010 16:29:59 GMT -8
OK, I'm trying CodeBlocks and how do I see the C++-compiled exe disassembled into an assembly file (*.asm), preferably MASM611, which is what I'm using for my assembly class?
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Oct 17, 2010 10:51:36 GMT -8
Just write the code, set a random break point, start the debugger, and then hit next instruction or select "Disassembly" like this.
|
|
inherit
143665
wildgoosespeeder wildgoosespeeder wildgoosespeeder
0
Jun 14, 2018 5:59:55 GMT -8
wildgoosespeeder
ProBoards V5 be trippin'. I'm disoriented. :P
4,393
August 2009
wildgoosespeeder
|
Post by wildgoosespeeder on Oct 17, 2010 12:19:00 GMT -8
OK, one problem, break point? I have never debugged like this before.
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Oct 17, 2010 12:42:28 GMT -8
If you've never debugged with break points you've been missing out. They allow you to stop the code so you can view the state of the program at a specific position of the instructions. You can then step through each C++ line or by each assembly instruction to see exactly what is happening. The debugger is priceless because of this. As you can see in the picture below, just left click to the left of the C++ line of code and it will create a red circle. Then click "Debug" -> "Start" at the top. The program will then halt when it reaches a break point, and then you can choose to step through each instruction or allow the code to execute at normal speed again. i55.tinypic.com/11ilnvo.png
|
|
inherit
143665
wildgoosespeeder wildgoosespeeder wildgoosespeeder
0
Jun 14, 2018 5:59:55 GMT -8
wildgoosespeeder
ProBoards V5 be trippin'. I'm disoriented. :P
4,393
August 2009
wildgoosespeeder
|
Post by wildgoosespeeder on Oct 18, 2010 14:51:44 GMT -8
OK, one problem, starting the debug (F8) is disabled. Why?
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Oct 18, 2010 16:06:42 GMT -8
Make sure you are compiling in debug mode and not release mode. If that's not the problem then I don't know. Just do a few Google searches.
|
|
inherit
143665
wildgoosespeeder wildgoosespeeder wildgoosespeeder
0
Jun 14, 2018 5:59:55 GMT -8
wildgoosespeeder
ProBoards V5 be trippin'. I'm disoriented. :P
4,393
August 2009
wildgoosespeeder
|
Post by wildgoosespeeder on Oct 18, 2010 16:55:16 GMT -8
It is but I figured out what was really going on. I was just reading the *.cpp without it being in the workspace or something. Now the only problem is the debugger. I'm using GNC GCC Compiler and even though I have the debugger set, I keep getting an error.
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Oct 18, 2010 19:57:04 GMT -8
What is the error?
It may be best to just go back to coding in assembly at this point. Basically you are going to have a main loop which will encrypt/decrypt a character during each iteration. It appears that for your assignment you need to subtract 1 from the ASCII value when encrypting. If the value is == 'a' or == 'A', then set it to 'z' instead. Do the opposite for decrypting.
I suggest writing it in C++ to get the basic logic figured out, and then write it in assembly. That's what I have been doing.
|
|
inherit
143665
wildgoosespeeder wildgoosespeeder wildgoosespeeder
0
Jun 14, 2018 5:59:55 GMT -8
wildgoosespeeder
ProBoards V5 be trippin'. I'm disoriented. :P
4,393
August 2009
wildgoosespeeder
|
Post by wildgoosespeeder on Oct 18, 2010 20:19:37 GMT -8
Well I did figure out the debugger error just by going to "Project" > "Build options...". Even if I do look at the assembly, it looks way to complicated that what was in the class PowerPoints. Thanks for trying but I think at this point that I need someone that knows assembly, not someone that is trying to figure it out.
|
|