Jump to content

mul in 16 bit

- - - - -

  • Please log in to reply
3 replies to this topic

#1
mIXpRo

mIXpRo

    Newbie

  • Members
  • PipPip
  • 11 posts
hii,
if anyone is familiar with pdp11 (don't ask why it's for a homework:mad:), the registers are r0,r1,r2,r3,r4,r5,sp,pc
this is my problem :
r0 = 10000

why when doing :
mul #100,r0
the result :
r0 = 000004
r1 = 000000

#2
Firebird_38

Firebird_38

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
well, not quite sure what's up here. But it seems your #100 may be 100b, as in binary, which equals 4. Then when you mul 10000h by this, you get 40000h. If you now have a 16bit limit, this may be split into 4h in one register and 0000h in another.
This seems to be the case. :)

#3
¥ Brutus ¥

¥ Brutus ¥

    Newbie

  • Members
  • Pip
  • 7 posts
Oh, you're right! This is the only explanation!
;)

#4
bobdark

bobdark

    Programmer

  • Members
  • PipPipPipPip
  • 164 posts
judging from pdp11 and your location being Haifa, I conclude you study in Technion. Isnt it a bit late for homework??:)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users