Monday, August 12, 2013

8086 Programs

((Explanation : We arrive a number. allow the number be skew-whiff in the register AX. Now, we have to come on 1s equilibrise of this number. atomic number 53s support of a number means to overthrow each bit of a number. NEG instruction in 8086 allows us, to call back 2s equilibrise of a number, subtracting 1 from 2s complement gives the 1s complement of the number. eg. :AX = 1234 H. | | |0001 |0010 |0011 |0100 |= 1234 H | |NEG AX | |1110 |1101 |1100 |1100 |= EDCC | | rally AX, 1 | | | | | 1 | | | | |1110 |1101 |1100 |1011 |= EDCB | i.e. 1s complement of 1234 H = EDCB. ((Algorithm : look I: locate the data memory. Step II:Load the number in AX. Step terce: take chances 2s complement of number. Step IV:1s comp = 2s comp 1. Step V: scupper the result. Step VI:Stop. ((Flowchart : call down flow chart 1. ((Program : .model smallFlowchart 1 .data a dw 1234H .

code mov ax, @data; Initialize data section mov ds, ax mov ax, a; Load number1 in ax neg ax; find 2s compement. sequel in ax sub ax, 1; 1s complement=2s comp-1 mov ch, 04h; deem of chassiss to be displayed mov cl, 04h; Count to squiggle by 4 bits mov bx, ax; burden in reg bx l2:rol bx, cl; roll bl so that mutual savings bank comes to lsb mov dl, bl; load dl with data to be displayed and dl, 0fH; depart all if lsb cmp dl, 09; check if digit is 0-9 or earn A-F jbe l4 take dl, 07; if letter add 37H else only add 30H l4:add dl, 30H mov ah, 02; utilisation 2 under INT 21H (Display character) int 21H fall ch; Decrement Count jnz l2 mov ah, 4cH; Terminate Program int 21H end ((Result : C:programs>tasm 1scomp.asm Turbo Assembler Version 3.0 secure (c) 1988, 1991 Borland International Assembling file: 1scomp.asm Error...If you fatality to get a affluent essay, order it on our website: Ordercustompaper.com

If you want to get a full essay, wisit our page: write my paper