home *** CD-ROM | disk | FTP | other *** search
/ Tiger Disk 13 / Tiger_Disk_013_19xx_Tiger-Crew-Disk_de_Side_A.d64 / hexdec.seq < prev    next >
Text File  |  2023-02-26  |  1KB  |  60 lines

  1.          *= $1000
  2.  
  3. ;***************************************
  4. ;*  hexdec-routine (w) 1994 by madrom  *
  5. ;***************************************
  6. ;* routine wird mit - jsr hexdec -     *
  7. ;* aufgerufen. in x- und y-reg zeigen  *
  8. ;* auf die 16bit hexzahl, die sich im  *
  9. ;* speicher im ascii-format befinden   *
  10. ;* muss. nach dem aufruf steht in x-reg*
  11. ;* und akku die in dezimale format     *
  12. ;* umgewandelte zahl ...  mdr/t-c/crm  *
  13. ;***************************************
  14.  
  15.  
  16.  
  17. hexdec
  18.  
  19.          lda #4
  20.          sta 251
  21.          stx 252
  22.          sty 253
  23.          ldy #0
  24. hd1
  25.          lda (252),y
  26.          cmp #$41
  27.          bcs hd3
  28.          sec
  29.          sbc #48
  30.          jmp hd2
  31. hd3
  32.          sec
  33.          sbc #55
  34. hd2
  35.          sta hd4,y
  36.          iny
  37.          cpy 251
  38.          bne hd1
  39.          lda hd4
  40.          asl a
  41.          asl a
  42.          asl a
  43.          asl a
  44.          clc
  45.          adc hd4+1
  46.          sta 254
  47.          lda hd4+2
  48.          asl a
  49.          asl a
  50.          asl a
  51.          asl a
  52.          adc hd4+3
  53.          sta 255
  54.          ldx 255
  55.          lda 254
  56.          rts
  57. hd4
  58.          .text "0000"
  59.  
  60.