Skip to main content

Create Your First Assembly Program Step By Step

Step 1. First let us define what is an Assembly language.



A programming language that is once removed from a computer's machine language. Machine languages consist entirely of numbers and are almost impossible for humans to read and write. Assembly languages have the same structure and set of commands as machine languages, but they enable a programmer to use names instead of numbers.

Each type of CPU has its own machine language and assembly language, so an assembly language program written for one type of CPU won't run on another. In the early days of programming, all programs were written in assembly language. Now, most programs are written in a high-level language such as FORTRAN or C. Programmers still use assembly language when speed is essential or when they need to perform an operation that isn't possible in a high-level language.

- from: http://www.webopedia.com

In order to create program in this language we need an assembler. Assembler is a program that is use to translate assembly code into machine language.

Step 2. Download an assembler:
Go to: http://eji.com/a86/ and download the latest A86 assembler, also in this site you can download D86 disassembler.


List of files in a86.zip:


The A86.COM file is what we want, so please copy this file and paste in another folder (create this folder), ex. project.

Step 3. Open MS DOS program.


You can open this thru: Start -> Run -> Type: cmd and click the OK button (for older operating system usecommand).

Step 4. Create a folder in drive C: named project with a86.com inside.


Step 5. In DOS, go to your project folder. Type: cd c:\project and press enter.


Step 6. Open an editor in DOS.
In DOS, type edit to open an editor.
C:\project>edit


Step 7. Create simple assembly program.
Write this code in this editor (edit). You can use other tool also like notepad.
01start: jmp main
02
03main proc
04        mov ah,02h
05
06        mov dl,"H"
07        int 21h
08        mov dl,"e"
09        int 21h
10        mov dl,"l"
11        int 21h
12        mov dl,"l"
13        int 21h
14        mov dl,"o"
15        int 21h
16        mov dl,0a
17        int 21h
18        mov dl,0d
19        int 21h
20        mov dl,"G"
21        int 21h
22        mov dl,"a"
23        int 21h
24        mov dl,"r"
25        int 21h
26        mov dl,"c"
27        int 21h
28        mov dl,"i"
29        int 21h
30        int 20h
31
32main endp
33end start

Save this file as hello.asm in project folder.


Step 8. Compiling and running the program.
To compile just type: a86 hello.asm and press enter.


If no error(s) found, otherwise you need to debug or edit it.
To run: just type: hello and press enter.



Good luck! have a nice coding...

Comments

Popular posts from this blog

Off-Page SEO – 7 Tips On How To Build BackLinks

Well a site cannot get expected traffic without doing seo in the world of completion. After introducing  on page seo . Now come back to introduce off page seo and basics of off page seo. As the word off page seo shows to do seo staying off from own page. Means to optimize a website from other sources. In simple a short we can define it as link building or creating backlinks. Off page seo helps site to get rank in search engines.   Fairly Off page seo is to create and build backlinks from several of ways. Off page seo is a hungriness of backlinks.”There so many ways to do off page seo or creating backlinks but now, let me show you how to build links to your pages: 1. Profile Pages Build Profile Pages in the top Social Media sites like: Google+ Profiles-           https://profiles.google.com            (A Must) Facebook Pages –     ...

August 6, 2017 CSE-PPT Professional Level - List of Passers (REGION XII)

August 6, 2017 CSE-PPT Professional Level  - List of Passers Civil Service Commission Regional Office No. 12 SOURCE: PRC ABALOS, ROMEO III G ABANG, CHRISTIAN MARK B ABAS, AMIRA A ABBA, BRYAN M ABDULADSIS, SAYEED MOHBEN K ABDULSATAR, SAHID M ABEAR, KRIZIA ANDREA Q ABELLON, SHIENA MAE F ABING, MARY SOL T ABOLENCIA, SEAN HOPE C ACIDO, DANIEL CARLO G ACUPAN, NONA MARIE P ADANG, SAIMA D ADELAN, MAILA LOUISA N ADVENTAJADO, CLYDELL S AGAD, LUCILLE ANGELIKKA DC AGAWA, YSA LOU S AGCARAO, APRIL BERNADETH P AGUILAR, RUTH D AGUJA, MARCO D AGURING, FROILAN J AJOC, LOVELL L AKIL, SAGUIRA M ALAMADA, SHAINETRA C ALAMAN, OMAR ADRIANNE P ALBARAN, GLORY GRACE C ALBRANDO, GERALDINE P ALCANTARA, KIMBERLY V ALCOBA, MARY ANN L ALCORDO, QUENNIE N ALDAVE, ANNABELLE JOY B ALLAGA, LOREN F ALLOSO, MERCY FE N ALMOJALLAS, JAN MARIE MAY J ALONZO, CHARMAINE KLAIRE A ALTIZO, ALEN JANE E ALURAN, ELLEN JANE C ALVAREZ, NEALL DOMINICK T AMAN, JOHN PAUL C AMANDE, JOEVEN A AMBAY, ARRIZ PAULA D AMER, ABJUHARY H AMINO, ...

Future Pinoy scientists, a Museum of Natural History

Michael Purugganan, when he was an elementary student at Union Science Elementary School in Malate, used to sneak into the National Science Development Board premises, where he would spend hours in a small museum.  "It just fascinated me. I just wanted to learn more about these things and what these people were doing there," Purruganan told GMA News Online.  "That was really what inspired me to become a scientist," said Purugganan, who is currently the Dean for Science at New York University and a world leader in evolutionary and ecological genomics.   With a new museum in the works, more young Filipinos may be inspired to become scientists. In a couple of years, the Philippines will have its own world class Museum of Natural History, showcasing endemic plants and animals that can be found in the country, according to a report on State of the Nation on January 23. Museums bridge the past and present, but the government believes these can also meet...