home *** CD-ROM | disk | FTP | other *** search
- *
- * Convert Binary to Decimal
- * By The Cracker of Triangle
- * Binary Value in D0 (Word)
- * Result in B_OUTPUT
- *
- b_bindec:
- lea b_output,a0
- move.b #$20,d1
- tst.w d0
- bpl b_notneg
- move.b #$2d,d1
- neg.w d0
- b_notneg:
- move.b d1,(a0)+
- addi.l #5,a0
- move.w #4,d1
- b_loop:
- ext.l d0
- divs #10,d0
- swap d0
- move.b d0,-(a0)
- add.b #$30,(a0)
- swap d0
- dbra d1,b_loop
- rts
- b_output: dc ' '