Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1186 | savelij | 1 | cpu mn1610alt |
| 2 | page 0 |
||
| 3 | |||
| 4 | DIGIT equ x'7D' |
||
| 5 | AUTB equ x'67' |
||
| 6 | |||
| 7 | org x'122d' |
||
| 8 | |||
| 9 | clear x1 |
||
| 10 | mvi x1,x'3' ; X1 <--- X'3' |
||
| 11 | clear x0 ; X0 <--- X'0' |
||
| 12 | ; |
||
| 13 | mv r0,r0,m ; If R0 is not negative, |
||
| 14 | b BTA1 |
||
| 15 | mvi r1,x'2D' ; then set the sign '-' first |
||
| 16 | st r1,DIGIT(x0) |
||
| 17 | ai x0,x'1' |
||
| 18 | ; |
||
| 19 | clear r1 |
||
| 20 | s r1,r0 |
||
| 21 | mv r0,r1 ; R0 <--- (-1)*R0 |
||
| 22 | BTA1 equ * |
||
| 23 | L r1,(AUTB)(x1) ; R1 <--- Unit of each Figure |
||
| 24 | clear r2 |
||
| 25 | BTA2 equ * |
||
| 26 | C r0,r1,pz ; if binary number >= unit, then |
||
| 27 | b BTA3 |
||
| 28 | s r0,r1 ; subtract unit from binary number & |
||
| 29 | ai r2,x'1' ; count the subtraction. |
||
| 30 | b BTA2 |
||
| 31 | BTA3 equ * |
||
| 32 | mv r2,r2,nz ; if counter is not zero |
||
| 33 | b BTA6 |
||
| 34 | sbit str,x'f' ; then set flag |
||
| 35 | BTA4 equ * |
||
| 36 | sbit r2,x'a' |
||
| 37 | sbit r2,x'b' ; get ASCII code |
||
| 38 | st r2,DIGIT(x0) ; & set it into buffer |
||
| 39 | ai x0,x'1' |
||
| 40 | BTA5 equ * |
||
| 41 | |||
| 42 | ; |
||
| 43 | ; |
||
| 44 | org x'1262' |
||
| 45 | BTA6 equ * |