FORMAL REPORT 1: Use of the 8086 Assembler

Type in the following programme using EMU8086 and include your Name, Class, Group, Year and Date. Save this programme as file: report_1.asm.

; TITLE Formal Report 1

; NAME

; DATE

; CLASS

; GROUP

Copy and Paste the following code into the .EXE template in the EMU8086. Emulate and single-step through the programme and note the contents of the registers after each step. Show manually how each hex and binary result is obtained for each of the instructions.

mov ax,00A5h

shl al,1

rcl al,1

not al

neg al

sar al,1

mov ah,al

inc ax

dec ah

mov cx,ax

shr ah,1

mov si,ax

xchg si,cx

mov ax,cx

mov cl,4

ror ax,cl

shl al,1

rcr ax,1

mov di,ax

inc di

xchg di,ax

; return to operating system:

MOV AH, 4Ch

INT 21h

Register value after execution

Instruction Binary Hex Carry

mov ax,00A5h AX = 0000 0000 1010 0101 00A5 ____

shl al,1 ______AL = ______

rcl al,1 ______AL = ______

not al ______AL = ______

neg al ______AL = ______

sar al,1 ______AL = ______

mov ah,al ______AX = ______

inc ax ______AX = ______

dec ah ______AX = ______

mov cx,ax ______CX = ______

shr ah,1 ______AX = ______

mov si,ax ______SI = ______

xchg si,cx ______SI = ______

mov ax,cx ______AX = ______

mov cl,4 ______CX = ______

ror ax,cl ______AX = ______

shl al,1 ______AX = ______

rcr ax,1 ______AX = ______

mov di,ax ______DI = ______

inc di ______DI = ______

xchg di,ax ______AX = ______

Structure of an 8086 Assembly Language Programme

title <programme title>

stack segment para stack

db <nn> dup(?)

stack ends

data segment

<name> <size> <value>

:

:

data ends

extrn <external declarations, if any>

: :

code segment public

assume cs:code, ds:data

main proc far

mov ax, data

mov ds, ax

:

:

main endp

<subr1> proc near

:

:

ret

<subr1> endp

<subr2> proc near

:

:

ret

<subr2> endp

:

:

code ends

end main