Monday, 10 April 2017

Assembly Language Programming : Emu8086 Overview, Using Emulator, Virtual Drives

Everything for learning assembly language in one pack! 

Before Emu8086 I used to program in TASM. I write my assembly language codes and assemble and run them in TASM. You can write your program in any format, whether in TASM, NASM, MASM format, they are all compatible in emu8086. Also, in emu8086, you can see the REAL and ACTUAL steps that an assemble does. It means that you can simulate every interrupts in your program :)

Emu8086 combines an advanced source editor, assembler, disassembler, software emulator (Virtual PC) with debugger, and step by step tutorials.

This program is extremely helpful for those who just begin to study assembly language. It compiles the source code and executes it on emulator step by step.

Visual interface is very easy to work with. You can watch registers, flags and memory while your program executes.

Arithmetic & Logical Unit (ALU) shows the internal work of the central processor unit (CPU).

Emulator runs programs on a Virtual PC, this completely blocks your program from accessing real hardware, such as hard-drives and memory, since your assembly code runs on a virtual machine, this makes debugging much easier.

8086 machine code is fully compatible with all next generations of Intel's micro-processors, including Pentium II and Pentium 4, I'm sure Pentium 5 will support 8086 as well. This makes 8086 code very portable, since it runs both on ancient and on the modern computer systems. Another advantage of 8086 instruction set is that it is much smaller, and thus easier to learn.

Emu8086 has a much easier syntax than any of the major assemblers, but will still generate a program that can be executed on any computer that runs 8086 machine code; a great combination for beginners!

Note: If you don't use Emu8086 to compile the code, you won't be able to step through your actual source code while running it.

Where to start?

  1. Start Emu8086 by selecting its icon from the start menu, or by running Emu8086.exe.

  2. Select "Samples" from "File" menu.

  3. Click [Compile and Emulate] button (or press F5 hot key).

  4. Click [Single Step] button (or press F8 hot key), and watch how the code is being executed.

  5. Try opening other samples, all samples are heavily commented, so it's a great learning tool.

  6. This is the right time to see the tutorials.

Using Emulator

If you want to load your code into the emulator, just click "Emulate" button .
But you can also use emulator to load executables even if you don't have the original source code. Select "Show Emulator" from "Emulator" menu.

Try loading files from "MyBuild" folder. If there are no files in "MyBuild" folder return to source editor, select Samples from File menu, load any sample, compile it and then load into the emulator:

[Single Step] button executes instructions one by one stopping after each instruction.

[Run] button executes instructions one by one with delay set by step delay between instructions.

Double click on register text-boxes opens "Extended Viewer" window with value of that register converted to all possible forms. You can modify the value of the register directly in this window.

Double click on memory list item opens "Extended Viewer" with WORD value loaded from memory list at selected location. Less significant byte is at lower address: LOW BYTE is loaded from selected position and HIGH BYTE from next memory address. You can modify the value of the memory word directly in the "Extended Viewer" window,

You can modify the values of registers on runtime by typing over the existing values.

[Flags] button allows you to view and modify flags on runtime.

Virtual Drives

Emulator supports up to 4 virtual floppy drives. By default there is a FLOPPY_0 file that is an image of a real floppy disk (the size of that file is exactly 1,474,560 bytes).

To add more floppy drives select [Create new floppy drive] from [Virtual Drive] menu. Each time you add a floppy drive emulator creates a FLOPPY_1, FLOPPY_2, and FLOPPY_3 files.
Created floppy disks are images of empty IBM/MS-DOS formatted disk images. Only 4 floppy drives are supported (0..3)!
To delete a floppy drive you should close the emulator, delete the required file manually and restart the emulator.

You can determine the number of attached floppy drives using INT 11h this function returns AX register with BIOS equipment list. Bits 7 and 6 define the number of floppy disk drives (minus 1):

Bits 7-6 of AX:
          00 single floppy disk.
          01 two floppy disks.
          10 three floppy disks.
          11 four floppy disks.
Emulator starts counting attached floppy drives from starting from the first, in case file FLOPPY_1 does not exist it stops the check and ignores FLOPPY_2 and FLOPPY_3 files.

To write and read from floppy drive you can use INT 13h function, see list of supported interrupts for more information.

Ever wanted to write your own operating system?

You can write a boot sector of a virtual floppy via menu in emulator:
[Virtual Drive] -> [Write 512 bytes at 7C00 to Boot Sector]
First you should compile a ".boot" file and load it in emulator (see "micro-os_loader.asm" and "micro-os_kernel.asm" in "Samples" for more info).

Then select [Virtual Drive] -> [Boot from Floppy] menu to boot emulator from a virtual floppy.

Then, if you are curious, you may write the virtual floppy to real floppy and boot your computer from it, I recommend using "RawWrite for Windows" from:
(note that "micro-os_loader.asm" is not using MS-DOS compatible boot sector, so it's better to use and empty floppy, although it should be IBM (MS-DOS) formatted).

Compiler directive ORG 7C00h should be added before the code, when computer starts it loads first track of a floppy disk at the address 0000:7C00.
The size of a .BOOT file should be less then 512 bytes (limited by the size of a disk sector).

 emu8086 is better than NASM, MASM or TASM

Tag: assembly language, assembly instruction, assembly programming, assembly code, assembly guide, emu8086, 8086 microprocessors instruction, instruction sets, instruction sets for 8086, instruction complete set, instruction set complete for 8086, assembly language instruction set, complete 8086 instruction sets microprocessors, complete instruction timing and instruction sets for 8086 microprocessors, 8086 Assembler, Tutorial

Assembly Language : 8086 Assembler Tutorial Part 12

Assembly Language : 8086 Assembler Tutorial Part 11

Assembly Language : 8086 Assembler Tutorial Part 10

Assembly Language : 8086 Assembler Tutorial Part 9

Assembly Language : 8086 Assembler Tutorial Part 8

Assembly Language : 8086 Assembler Tutorial Part 7

Assembly Language : 8086 Assembler Tutorial Part 6

Assembly Language : 8086 Assembler Tutorial Part 5

Assembly Language : 8086 Assembler Tutorial Part 4

Assembly Language : 8086 Assembler Tutorial Part 3

Assembly Language : 8086 Assembler Tutorial Part 2

Assembly Language : 8086 Assembler Tutorial Part 1

Assembly Language Programming : Complete 8086 instruction sets

Assembly Language Programming : I/O ports - IN/OUT instructions 

Assembly Language programming : Emu8086 Assembler Compiling and MASM / TASM compatibility

Assembly Language - string convert - Lowercase , Uppercase

for programming : the language of Number

Assembly Language - Complete Instruction Set and Instruction Timing of 8086 microprocessors

Assembly Language programming : A list of emulator supported interrupts

Assembly Language Programming : Emu8086 Overview, Using Emulator, Virtual Drives

Assembly Language Programming : All about Memory - Global Memory Table and Custom Memory Map

buy me  a cup of coffee

My Paypal Account is :

Send me any small amount of money is welcome.
buy me  a cup of coffee


Need More Detail ?   contact me !!

My Paypal Account is :
buy me  a cup of coffee
Send me any small amount of money is welcome.


Don't know how to send money ?   Click here for detail about Paypal account.
About PayPal Payment Methods

What type of PayPal accounts is better.

Don't have money? OK! Here is another way to get the program.
how to get my program - Free of charge

No comments:

Post a Comment