2’s Complement of number in Assembly – masm 8086

2’s Complement of number in Assembly – masm 8086

org 100h
.stack 100h
.data
var DW 1111111100001111b
.code
;Intilization of Data Segment
mov ax,@DATA
mov DS,ax
;First find 1's complement
not var
;Add 1 to 1's complement of number
inc var
;to terminate program
mov ah,4ch
int 21h
ret

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s