×
Samples Blogs Make Payment About Us Reviews 4.9/5 Order Now

Perform Operations On Different Data Sizes (Using Irvine Library In Windows) Assembly Language, X86 Assembly Assignment Solution.

July 09, 2024
Rehana Magnus
Rehana Magnus
🇨🇦 Canada
Assembly Language
Rehana Magnus, PhD in Computer Science from the esteemed Acadia Institute of Technology, Canada. With 6 years of experience, specializes in assembly language programming. Proficient in low-level coding, optimizing performance, and enhancing system functionality.
Key Topics
  • Instructions
  • Requirements and Specifications
Tip of the day
Use Python libraries effectively by importing only what you need. For example, if you're working with data, using libraries like pandas and numpy can save time and simplify complex tasks like data manipulation and analysis.
News
In 2024, the Biden-Harris Administration has expanded high-dosage tutoring and extended learning programs to boost academic achievement, helping programming students and others recover from pandemic-related setbacks. These initiatives are funded by federal resources aimed at improving math and literacy skills​

Instructions

Objective

Write an Assembly language assignment program to perform operations on different data sizes (using Irvine library in Windows), x86 Assembly.

Requirements and Specifications

Assembly language with operations on different data sizes Assembly language
Assembly language with operations on different data sizes Assembly language1

Source Code

INCLUDE Irvine32.inc .data bNum01 byte 64 bNum02 byte 32 bNum03 byte 16 bSum byte ? bDiff byte ? bResult byte ? wNum01 word 64 wNum02 word 32 wNum03 word 16 wSum word ? wDiff word ? wResult word ? dwNum01 dword 64 dwNum02 dword 32 dwNum03 dword 16 dwSum dword ? dwDiff dword ? dwResult dword ? dwTotal dword ? .code main PROC movzx eax, BYTE PTR[bNum01] ; load first byte value movzx ebx, BYTE PTR[bNum02] ; load second byte value add eax, ebx ; add the two numbers movzx ebx, BYTE PTR[bNum03] ; load third byte value add eax, ebx ; add the three numbers mov [bSum], al ; save result movzx eax, WORD PTR[wNum01] ; load first word value movzx ebx, WORD PTR[wNum02] ; load second word value add eax, ebx ; add the two numbers movzx ebx, WORD PTR[wNum03] ; load third word value add eax, ebx ; add the three numbers mov [wSum], ax ; save result mov eax, [dwNum01] ; load first dword value add eax, [dwNum02] ; add second dword value add eax, [dwNum03] ; add third dword value mov [dwSum], eax ; save result movzx eax, BYTE PTR[bNum02] ; load second byte value movzx ebx, BYTE PTR[bNum03] ; load third byte value add eax, ebx ; add the two numbers movzx ebx, BYTE PTR[bNum01] ; load first byte value sub eax, ebx ; subtract the first from the sum of the first mov [bDiff], al ; save result movzx eax, WORD PTR[wNum02] ; load second word value movzx ebx, WORD PTR[wNum03] ; load third word value add eax, ebx ; add the two numbers movzx ebx, WORD PTR[wNum01] ; load first word value sub eax, ebx ; subtract the first from the sum of the first mov [wDiff], ax ; save result mov eax, [dwNum02] ; load second dword value add eax, [dwNum03] ; add third word value sub eax, [dwNum01] ; subtract first word value from sum mov [dwDiff], eax ; save result movzx eax, BYTE PTR [bSum] ; load byte sum movzx ebx, BYTE PTR [bDiff] ; load byte difference add eax, ebx ; load sum and difference mov [bResult], al ; save result movzx eax, WORD PTR [wSum] ; load word sum movzx ebx, WORD PTR [wDiff] ; load word difference add eax, ebx ; load sum and difference mov [wResult], ax ; save result mov eax, [dwSum] ; load dword sum add eax, [dwDiff] ; add dword difference mov [dwResult], eax ; save result ; Dump variables mov esi, OFFSET bSum ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE BYTE ; byte format call DumpMem mov esi, OFFSET bDiff ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE BYTE ; byte format call DumpMem mov esi, OFFSET bResult ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE BYTE ; byte format call DumpMem mov esi, OFFSET wSum ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE WORD ; byte format call DumpMem mov esi, OFFSET wDiff ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE WORD ; byte format call DumpMem mov esi, OFFSET wResult ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE WORD ; byte format call DumpMem mov esi, OFFSET dwSum ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE DWORD ; byte format call DumpMem mov esi, OFFSET dwDiff ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE DWORD ; byte format call DumpMem mov esi, OFFSET dwResult ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE DWORD ; byte format call DumpMem movzx eax, BYTE PTR [bSum] ; load byte sum movzx ebx, WORD PTR [wSum] ; load word sum add eax, ebx ; add byte and word sums add eax, [dwSum] ; add dword sum mov [dwTotal], eax ; save result ; Dump total mov esi, OFFSET dwtotal ; starting OFFSET mov ecx, 1 ; number of units mov ebx, TYPE DWORD ; byte format call DumpMem call CrLf ; jump to new line call WaitMsg ; pause the screen until a key is pressed exit ; Terminate the program main ENDP END main

Related Samples

At ProgrammingHomeworkHelp.com, we provide exceptional support for students needing assistance with Assembly Language assignments. Our website features a dedicated section with related samples of Assembly Language assignments, showcasing expertly crafted solutions. These samples serve as a valuable resource for students to understand complex concepts and improve their coding skills. By exploring our samples, students can gain insights into best practices and effective techniques. Trust ProgrammingHomeworkHelp.com to help you excel in your Assembly Language assignments with comprehensive support and expertly developed resources.