|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1764 (0x6e4) Types: TextFile Notes: UNIX file Names: »dpmath.s«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code └─⟦2d53db1df⟧ UNIX Filesystem └─⟦this⟧ »hr/src/desk/dpmath.s«
.shri .globl addptr_ .globl subptr_ .globl incptr_ .globl decptr_ addptr_: sub r3, r3 ldl rr0, SS|4(r15) ld r2, SS|8(r15) add r1, r2 adcb rh0, rh3 ret un subptr_: sub r3, r3 ldl rr0, SS|4(r15) ld r2, SS|8(r15) sub r1, r2 sbcb rh0, rh3 ret un incptr_: ldl rr4, SS|4(r15) / fetch pointer to srcw pointer ldl rr2, (rr4) / fetch the srcw pointer exb rh2, rl2 / move seg number down slll rr2, $3 / shift whole thing over three ldl rr4, SS|8(r15) / get address of bit position add r3, (rr4) / add current bit position ldl rr0, SS|12(r15) / get increment value addl rr2, rr0 / add the increment to current ld r0, r3 / get copy of low word and r0, $0xf ld rr4, SS|8(r15) / get address of bit pointer ld (rr4), r0 / save off new bit position srll rr2, $3 / shift back to remove bitpos andb rl3, $0xFE / eliminate lowest bit position exb rh2,rl2 / put segno back in place ldl rr4, SS|4(r15) / get address of word pointer ldl (rr4), rr2 / and save it back ret un decptr_: ldl rr4, SS|4(r15) / fetch pointer to srcw pointer ldl rr2, (rr4) / fetch the srcw pointer exb rh2, rl2 / move seg number down slll rr2, $3 / shift whole thing over three ldl rr4, SS|8(r15) / get address of bit position add r3, (rr4) / add current bit position ldl rr0, SS|12(r15) / get increment value subl rr2, rr0 / add the increment to current ld r0, r3 / get copy of low word and r0, $0xf ld rr4, SS|8(r15) / get address of bit pointer ld (rr4), r0 / save off new bit position srll rr2, $3 / shift back to remove bitpos andb rl3, $0xFE / eliminate lowest bit position exb rh2,rl2 / put segno back in place ldl rr4, SS|4(r15) / get address of word pointer ldl (rr4), rr2 / and save it back ret un