CS401 assignment 1 solution of question 1
#1
CS401 Assignment Solution:
[org 0x0100]
mov ax, [NUM1]
mov bx, [NUM2]
mov cx, [NUM3]
mov dx, [NUM4]
mov ds, [NUM5]
mov cs, [NUM6]
mov es, [NUM7]
mov ss, [NUM8]
mov si, [NUM9]
mov sp, [NUM10]
mov bp, [NUM11]
mov di, [NUM12]


add [bx+di], cx
mov ax, 0x4c00
int 0x21
NUM1: dw 0x0150
NUM2: dw 0xab5d
NUM3: dw 0xff0a
NUM4: dw 0x1234
NUM5: dw 0xcc20
NUM6: dw 0xef10
NUM7: dw 0x225f
NUM8: dw 0xe25f
NUM9: dw 0x1212
NUM10: dw 0xcd0f
NUM11: dw 0x95f8
NUM12: dw 0xbdef
 
section .text global _start ;must be declared for using gcc _start: ;tell linker entry point mov eax,'3' sub eax, '0' mov ebx, '4' sub ebx, '0' add eax, ebx add eax, '0' mov [sum], eax mov ecx,msg mov edx, len mov ebx,1 ;file descriptor (stdout) mov eax,4 ;system call number (sys_write) int 0x80 ;call kernel mov ecx,sum mov edx, 1 mov ebx,1 ;file descriptor (stdout) mov eax,4 ;system call number (sys_write) int 0x80 ;call kernel mov eax,1 ;system call number (sys_exit) int 0x80 ;call kernel section .data msg db "The sum is:", 0xA,0xD len equ $ - msg segment .bss sum resb 1


Attached Files
.docx   CS401 Q#1 Solution.docx (Size: 12.31 KB / Downloads: 4)
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  CS601 Data Communication Assignment Solution Rana 0 520 11-26-2016, 03:27 PM
Last Post: Rana
Lightbulb Need CS502 Assignment no 1 solution Adorable Pakhtoon 3 249 11-17-2016, 04:21 PM
Last Post: Rubaisha(Moody Girl)
  CS502 assignment 1 Solution 2016 Rubaisha(Moody Girl) 0 702 11-17-2016, 04:18 PM
Last Post: Rubaisha(Moody Girl)
  CS602 assignment solution idea 2016 Rubaisha(Moody Girl) 0 250 11-16-2016, 10:49 AM
Last Post: Rubaisha(Moody Girl)
  MGT101 assignment solution 2016 Rubaisha(Moody Girl) 0 245 11-16-2016, 10:39 AM
Last Post: Rubaisha(Moody Girl)
  CS614 complete solution of assignment 1 2016 Rubaisha(Moody Girl) 0 239 11-16-2016, 10:22 AM
Last Post: Rubaisha(Moody Girl)
  CS302 Assignment Solution Rana 8 755 11-15-2016, 05:28 PM
Last Post: Rana
  CS304 Assignment 1 Solution - Fall 2016 Rana 1 522 11-10-2016, 08:45 AM
Last Post: Lahori
  Cs610 assignment solution Rubaisha(Moody Girl) 0 174 11-07-2016, 08:22 PM
Last Post: Rubaisha(Moody Girl)
  CS401 All Current Final Term Papers 20 August 2016 to 02 September 2016 Rubaisha(Moody Girl) 2 280 08-27-2016, 01:08 PM
Last Post: Rubaisha(Moody Girl)



Users browsing this thread:
1 Guest(s)