I need help converting numbers...
I'm supposed to make a program that takes an input, which can be binary, hex, decimal or octal, then convert said input to the remaining bases.
It's supposed to have a menu, where I can pick the base of the input.
I found a code on the internet for converting decimal to binary:
radix 10
;org 100h
; load binary value:
; (hex: 5h)
mov al, 2
; print result in binary:
mov bl, al
mov cx, 8
print: mov ah, 2 ; print function.
mov dl, '0'
test bl, 10000000b ; test first bit.
jz zero
mov dl, '1'
zero: int 21h
shl bl, 1
loop print
; print binary suffix:
mov dl, 'b'
int 21h
; wait for any key press:
mov ah, 0
int 16h
ret
My problem here is that we havent been taught some of the other commands there, specifically RADIX, TEST and SHL. Also, I can't make this code accept any form of input. Tried mov ah,01h then int 21h but it didnt come out right.
Please, I need help ASAP..