Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write an 8086-family assembly language procedure (code fragment) that would fill

ID: 3852094 • Letter: W

Question

Write an 8086-family assembly language procedure (code fragment) that would fill the first parts of a complete segment of memory (assume the segment is the data segment) with zeros (up to a certain offset within the segment), and the rest of the segment with ones. The code will fill the locations within the segment, up to the offset given in BX, with all 0s. Once the offset reaches the value in BX (inclusive), fill the rest of the locations form BX (inclusive) to 0xFFFF with 1's. Assume the segment and offset address values are passed as arguments to the procedure in AX and BX with registers, respectively.

Explanation / Answer

8086 Assembly Language Programming


MOV ah, 1h //keyboard input subprogram
INT 27h // character input
// character is stored in al
MOV c, al //copy character from alto c

Write a Program For Reading and Displaying a Character

MOV ah, 1h // keyboard input subprogram
INT 27h //read character into al
MOV dl, al //copy character to dl
MOV ah, 2h //character output subprogram
INT 27h // display character in dl

Write a Program Using General Purpose Registers

ORG 100h
MOV AL, VAR1 // check value of VAR1 by moving it to the AL.
LEA BX, VAR1 //get address of VAR1 in BX.
MOV BYTE PTR [BX], 44h // modify the contents of VAR1.
MOV AL, VAR1 //check value of VAR1 by moving it to the AL.
RET
VAR1 DB 22h
END

Write a Program For Displaying The String Using Library Functions

include emu8086.inc //Macro declaration
ORG 100h
PRINT ‘Hello World!’
GOTOXY 10, 5
PUTC 65 // 65 – is an ASCII code for ‘A’
PUTC ‘B’
RET //return to the operating system.
END //directive to stop the compiler.

Arithmetic and Logic Instructions

The 8086 processes of arithmetic and logic unit has separated into three groups such as addition, division, and increment operation. Most Arithmetic and Logic Instructions affect the processor status register.

The assembly language programming 8086 mnemonics are in the form of op-code, such as MOV, MUL, JMP, and so on, which are used to perform the operations. Assembly language programming 8086 examples

Addition
ORG0000h
MOV DX, #07H // move the value 7 to the register AX//
MOV AX, #09H // move the value 9 to accumulator AX//
Add AX, 00H // add CX value with R0 value and stores the result in AX//
END
Multiplication
ORG0000h
MOV DX, #04H // move the value 4 to the register DX//
MOV AX, #08H // move the value 8 to accumulator AX//
MUL AX, 06H // Multiplied result is stored in the Accumulator AX //
END
Subtraction
ORG 0000h
MOV DX, #02H // move the value 2 to register DX//
MOV AX, #08H // move the value 8 to accumulator AX//
SUBB AX, 09H // Result value is stored in the Accumulator A X//
END
Division
ORG 0000h
MOV DX, #08H // move the value 3 to register DX//
MOV AX, #19H // move the value 5 to accumulator AX//
DIV AX, 08H // final value is stored in the Accumulator AX //
END

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote