home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Syzygy Magazine 3
/
Syzygy_Magazine_3_19xx___pl_Side_A.atr
/
lekcja2.arc
/
INTSTR.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-09-01
|
2KB
|
1 lines
* Integer(inta)<>string(X,Y-adress)¢* by Charlie/AR/AwS¢¢* You also have to include 'INTOP.ASM'!¢¢ipnt equ $f7 (2) word at page 0!¢icnt brk¢ihlp brk¢¢¢* integer>string¢¢istr stx ipnt¢ sty ipnt+1¢ lda <10¢ sta intb¢ lda >10¢ sta intb+1¢ lda inta+1¢ and #$80¢ sta ihlp¢ beq _sr1¢ sec¢ lda #0¢ sbc inta¢ sta inta¢ lda #0¢ sbc inta+1¢ sta inta+1¢_sr1 lda #5¢ sta icnt¢_sr2 jsr idiv¢ ldx intc¢ ldy intc+1¢ jsr iadd¢ lda intc¢ pha¢ stx inta¢ sty inta+1¢ dec icnt¢ bne _sr2¢ ldy #0¢ lda ihlp¢ beq _sr3¢ lda #'-'¢ sta (ipnt),y¢ sty ihlp¢ iny¢_sr3 lda #5¢ sta icnt¢_sr4 pla¢ tax¢ ora ihlp¢ beq _sr5¢ sta ihlp¢ txa¢ ora #'0'¢ sta (ipnt),y¢ iny¢_sr5 dec icnt¢ bne _sr4¢ lda ihlp¢ bne _sr6¢ lda #'0'¢ sta (ipnt),y¢ iny¢_sr6 lda #$9b¢ sta (ipnt),y¢ rts¢¢¢* integer<string¢¢ival stx ipnt¢ sty ipnt+1¢ ldy #0¢ sty inta+1¢ sty intb+1¢ lda (ipnt),y¢ cmp #'-'¢ php¢ bne _vl1¢ iny¢ lda (ipnt),y¢_vl1 and #$f¢ sta inta¢_vl2 iny¢ lda (ipnt),y¢ sty icnt¢ cmp #$9b¢ beq _vl3¢ and #$f¢ pha¢ lda <10¢ sta intb¢ jsr imul¢ pla¢ clc¢ adc intc¢ sta inta¢ lda intc+1¢ adc #0¢ sta inta+1¢ ldy icnt¢ bne _vl2 (jmp)¢_vl3 plp¢ bne _vl4¢ lda #0¢ sbc inta¢ sta inta¢ lda #0¢ sbc inta+1¢ sta inta+1¢_vl4 rts¢¢