Masks Higher Nibble
Write meeting packages to Masks Higher Nibble for that quantity needs to be loaded into the register and operation needs to be applied on that loaded quantity .
- Calculated consequence needs to be displayed within the output .
Algorithm for Masks Higher Nibble:
Step I : Load the quantity in AL.
Step II : Masks the higher nibble.
Step III : Show consequence.
Step IV : Cease.
Program for Masks Higher Nibble:
1 |
.mannequin small <br/> .knowledge <br/> a dw 0012H <br/> .code <br/> mov ax, @knowledge ; Initialize knowledge part <br/> mov ds, ax <br/> mov ax, a ; Load number1 in ax <br/> and al, 0fh ; masks higher nibble.End in al <br/> mov ch, 02h ; Depend of digits to be displayed <br/> mov cl, 04h ; Depend to roll by 4 bits <br/> mov bh, al ; End in reg bh <br/> l2: rol bh, cl ; roll bl in order that msb involves lsb <br/> mov dl, bh ; load dl with knowledge to be displayed <br/> and dl, 0fH ; get solely lsb <br/> cmp dl, 09 ; test if digit is 0-9 or letter A-F <br/> jbe l4 <br/> add dl, 07 ; if letter add 37H else solely add 30H <br/> l4: add dl, 30H <br/> mov ah, 02 ; Perform 2 below INT 21H (Show character) <br/> int 21H <br/> dec ch ; Decrement Depend <br/> jnz l2 <br/> mov ah, 4ch <br/> int 21h <br/> finish |
Meeting packages
C:packages>tasm upnib.asm
Turbo Assembler Model 3.0 Copyright (c) 1988, 1991 Borland Worldwide
Assembling file: upnib.asm
Passes: 1
Remaining reminiscence: 438ok
C:packages>tlink upnib
Turbo Hyperlink Model 3.Zero Copyright (c) 1987, 1990 Borland Worldwide
Warning: No stack
C:packages>upnib
Supply projectgeek.com