KEMBAR78
VUID Assembly Program Azeem | PDF
0% found this document useful (0 votes)
4 views2 pages

VUID Assembly Program Azeem

This document contains an assembly language program that processes a VUID by storing its numeric digits, calculating the sum of these digits, and then creating an array that contains the result of subtracting each digit from the sum. The program is written in TASM syntax and includes a main procedure for execution. Additionally, it mentions a screenshot of the results from Turbo Debugger showing memory values for `vuid_digits`, `sum`, and `result_array`.

Uploaded by

azeemyasin3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

VUID Assembly Program Azeem

This document contains an assembly language program that processes a VUID by storing its numeric digits, calculating the sum of these digits, and then creating an array that contains the result of subtracting each digit from the sum. The program is written in TASM syntax and includes a main procedure for execution. Additionally, it mentions a screenshot of the results from Turbo Debugger showing memory values for `vuid_digits`, `sum`, and `result_array`.

Uploaded by

azeemyasin3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assembly Language Program for VUID

Operations
Name: Azeem Ahmad

VUID: BC250222042

Numeric Part: 250222042

Assembly Code (TASM Syntax)


.model small
.stack 100h
.data
vuid_digits db 9 dup(?) ; Store digits of VUID
sum db 0 ; Store sum of digits
result_array db 9 dup(?) ; Store result of sum - digit

.code
main:
mov ax, @data
mov ds, ax

; Store numeric digits: 2 5 0 2 2 2 0 4 2


mov si, 0
mov al, 2
mov vuid_digits[si], al
inc si
mov al, 5
mov vuid_digits[si], al
inc si
mov al, 0
mov vuid_digits[si], al
inc si
mov al, 2
mov vuid_digits[si], al
inc si
mov al, 2
mov vuid_digits[si], al
inc si
mov al, 2
mov vuid_digits[si], al
inc si
mov al, 0
mov vuid_digits[si], al
inc si
mov al, 4
mov vuid_digits[si], al
inc si
mov al, 2
mov vuid_digits[si], al

; Sum the digits


mov si, 0
mov cx, 9
mov bl, 0

sum_loop:
mov al, vuid_digits[si]
add bl, al
inc si
loop sum_loop

mov sum, bl

; Subtract each digit from the sum


mov si, 0
mov di, 0
mov cx, 9
mov bh, sum

sub_loop:
mov al, bh
sub al, vuid_digits[si]
mov result_array[di], al
inc si
inc di
loop sub_loop

; End program
mov ah, 4Ch
int 21h
end main

Screenshot of Result
Insert the screenshot from Turbo Debugger showing the memory values for `vuid_digits`,
`sum`, and `result_array`.

You might also like