Hi everyone! I'm new here and I'm very new at this language so here it goes:

I am writing a little program that converts a decimal input to a 16 bit binary number, and it will keep asking for input until the user types in zero. I have already written a good portion of this, but I am not sure how to handle the case if the input is a negative number and I am also not sure how to output it in 16 bits...I think it has something to do with shifting??? If anyone could help it would be greatly appreciated. Thanks in advance....I am using PEP/8 to do this as well:

begin: stro prompt, d
deci num, d
lda num, d
sta num, d
getBin: lda num, d
cpa 0, i
breq stop
anda 1, i
sta bin, d
deco bin, d
lda num, d
asra
sta num, d
lda num, d
cpa 0, i
br getBin
stop: STOP
bin: .block 2
num: .block 2
num2:.block 2
prompt: .ascii " Please enter a decimal number:\x00"
.end