.model small
.data
var1 db 25,32,49,10,81
var2 db 30 dup(0)
.code
mov ax,@data
mov ds,ax
mov cl,05h
mov dl,02h
lea si,var1
lea di,var2
l2: mov al,[si]
l1:mov ah,00h
div dl
mov [di+4],ah
dec di
cmp al,00h
jne l1
inc di
inc di
inc di
inc di
inc si
dec cl
jnz l2
mov ah,4ch
int 21
end
Chat with our AI personalities
because 9 is a lucky number for bcd..............ha ha ha
1111 can't be used for Binary Coded Decimal (BCD) because 1111=15 which is made of 2 digits 1 and 5. In BCD a 4-digit binary number is used for every decimal digit. ex. 1111 is incorrect 1 = 0001 5 = 0101 Answer: 0001 0101
sdfsdfsfsggbcvbg
In Cobol, they had a serious concern for memory size. So they came up with a method known as BCD (Binary Coded Decimal), where a decimal value was converted to binary to save space. Check this link out. It will break down the details.
to implement operations on binary heap in c