Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Learning to write programs
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Logan" data-source="post: 256373"><p>I wrote a post about this topic at <a href="http://www.mac-forums.com/forums/showthread.php?t=36169" target="_blank">this link.</a> I suggest reading over the entire link, but if nothing else read my post quoted here: (Note: This was in regards to someone learning to program at an early age)</p><p></p><p>Also note I'm comparing programming books for compiling binaries, not so much "Shell scripting", (even though VB's simplicity may be called shell scripting). Do a wikipedia on just about any language out there to get a decent idea on what makes it unique. <a href="http://en.wikipedia.org/wiki/List_of_hello_world_programs" target="_blank">This link shows how to write "Hello World" on a lot of different languages</a>, I may give you an idea how the language looks.</p><p></p><p></p><p></p><p></p><p>"Hello World!" Scripts for languages above:</p><p>C++</p><p>[code]#include <iostream></p><p> </p><p>int main()</p><p>{</p><p> std::cout << "Hello, world!" << std::endl;</p><p> return 0;</p><p>}[/code]</p><p></p><p>VB .NET</p><p>[code]Module HelloWorldApp</p><p> Sub Main()</p><p> System.Console.WriteLine("Hello, world!")</p><p> End Sub</p><p>End Module[/code] </p><p></p><p>(RealBasic's example could be used in VB .NET too)</p><p>REALbasic</p><p>[code]MsgBox "Hello, world!"[/code]</p><p></p><p>Java</p><p>[code]public class HelloWorld {</p><p> public static void main(String[] args) {</p><p> System.out.println("Hello, world!");</p><p> }</p><p>}[/code]</p><p></p><p>Assembly is just crazy (x86 DOS based app)</p><p>[code]MODEL SMALL</p><p>IDEAL</p><p>STACK 100H</p><p></p><p>DATASEG</p><p> MSG DB 'Hello, world!', 13, '$'</p><p></p><p>CODESEG</p><p>Start:</p><p> MOV AX, @data</p><p> MOV DS, AX</p><p> MOV DX, OFFSET MSG</p><p> MOV AH, 09H ; DOS: output ASCII$ string</p><p> INT 21H</p><p> MOV AX, 4C00H</p><p> INT 21H</p><p>END Start[/code]</p><p>[code]; Example of making 32-bit PE program as raw code and data</p><p></p><p>format PE GUI</p><p>entry start</p><p></p><p>section '.code' code readable executable</p><p></p><p> start:</p><p></p><p> push 0</p><p> push _caption</p><p> push _message</p><p> push 0</p><p> call [MessageBox]</p><p></p><p> push 0</p><p> call [ExitProcess]</p><p></p><p>section '.data' data readable writeable</p><p></p><p> _caption db 'Win32 assembly program',0</p><p> _message db 'Hello, world!',0</p><p></p><p>section '.idata' import data readable writeable</p><p></p><p> dd 0,0,0,RVA kernel_name,RVA kernel_table</p><p> dd 0,0,0,RVA user_name,RVA user_table</p><p> dd 0,0,0,0,0</p><p></p><p> kernel_table:</p><p> ExitProcess dd RVA _ExitProcess</p><p> dd 0</p><p> user_table:</p><p> MessageBox dd RVA _MessageBoxA</p><p> dd 0</p><p></p><p> kernel_name db 'KERNEL32.DLL',0</p><p> user_name db 'USER32.DLL',0</p><p></p><p> _ExitProcess dw 0</p><p> db 'ExitProcess',0</p><p> _MessageBoxA dw 0</p><p> db 'MessageBoxA',0</p><p></p><p>section '.reloc' fixups data readable discardable[/code]</p></blockquote><p></p>
[QUOTE="Logan, post: 256373"] I wrote a post about this topic at [url=http://www.mac-forums.com/forums/showthread.php?t=36169]this link.[/url] I suggest reading over the entire link, but if nothing else read my post quoted here: (Note: This was in regards to someone learning to program at an early age) Also note I'm comparing programming books for compiling binaries, not so much "Shell scripting", (even though VB's simplicity may be called shell scripting). Do a wikipedia on just about any language out there to get a decent idea on what makes it unique. [url=http://en.wikipedia.org/wiki/List_of_hello_world_programs]This link shows how to write "Hello World" on a lot of different languages[/url], I may give you an idea how the language looks. "Hello World!" Scripts for languages above: C++ [code]#include <iostream> int main() { std::cout << "Hello, world!" << std::endl; return 0; }[/code] VB .NET [code]Module HelloWorldApp Sub Main() System.Console.WriteLine("Hello, world!") End Sub End Module[/code] (RealBasic's example could be used in VB .NET too) REALbasic [code]MsgBox "Hello, world!"[/code] Java [code]public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); } }[/code] Assembly is just crazy (x86 DOS based app) [code]MODEL SMALL IDEAL STACK 100H DATASEG MSG DB 'Hello, world!', 13, '$' CODESEG Start: MOV AX, @data MOV DS, AX MOV DX, OFFSET MSG MOV AH, 09H ; DOS: output ASCII$ string INT 21H MOV AX, 4C00H INT 21H END Start[/code] [code]; Example of making 32-bit PE program as raw code and data format PE GUI entry start section '.code' code readable executable start: push 0 push _caption push _message push 0 call [MessageBox] push 0 call [ExitProcess] section '.data' data readable writeable _caption db 'Win32 assembly program',0 _message db 'Hello, world!',0 section '.idata' import data readable writeable dd 0,0,0,RVA kernel_name,RVA kernel_table dd 0,0,0,RVA user_name,RVA user_table dd 0,0,0,0,0 kernel_table: ExitProcess dd RVA _ExitProcess dd 0 user_table: MessageBox dd RVA _MessageBoxA dd 0 kernel_name db 'KERNEL32.DLL',0 user_name db 'USER32.DLL',0 _ExitProcess dw 0 db 'ExitProcess',0 _MessageBoxA dw 0 db 'MessageBoxA',0 section '.reloc' fixups data readable discardable[/code] [/QUOTE]
Verification
Name this item 🌈
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Learning to write programs
Top