|
\masm32\bin\ml /c /Zd /coff my-prog.asm \masm32\bin\link /SUBSYSTEM:CONSOLE my-prog.obj |
.486 ;; Use 32 bit addresses .model flat, stdcall ;; Use the Protected mode option casemap :none ;; Make program case sensitive ;; Include commonly used header files include \masm32\include\kernel32.inc include \masm32\include\windows.inc include \masm32\include\masm32.inc include \masm32\include\msvcrt.inc ;; Include commonly used libraries includelib \masm32\lib\kernel32.lib includelib \masm32\lib\msvcrt.lib .data ;; Start data segment [Variable definitions] .... .code ;; Start code segment Start: ;; Segment name [Program] .... invoke ExitProcess, 0 ;; ***** Exit to Dos... with exit code 0 end Start ;; End program segment |
|
MAX equ 10000000 |
|
Example: un-initialized
Java: Intel: char c; c: DB ? |
Example: initialized
Java: Intel: char c = 45; c: DB 45 |
Example: un-initialized char array
Java: Intel: char c[100]; c: DB 100 dup (?) |
Example: initialized char array
Java: Intel: char c[100] = {0,0, ..., 0}; c: DB 100 dup (0) |
Example:
C: short ListOfShortNumbers[] = {1000, 2000, 3000, 4000, 5000}; ListOfShortNumbers: DW 1000, 2000, 3000, 4000, 5000 |
Example:
C: int ListOfInttNumbers[] = {100000, 200000, 300000, 400000, 500000}; ListOfIntNumbers: DD 1000000, 2000000, 3000000, 4000000, 5000000 |
Example:
ListOfLongNumbers: DQ 1000000, 2000000, 3000000, 4000000, 5000000 |