Home » Personal collection » Acorn tapes » Electron_User » Electron_User_tape14b_acorn_eu_1990_september.wav » DecOut

DecOut

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn tapes » Electron_User » Electron_User_tape14b_acorn_eu_1990_september.wav
Filename: DecOut
Read OK:
File size: 04C7 bytes
Load address: FFFF1A00
Exec address: FFFF8023
Duplicates

There are 3 duplicate copies of this file in the archive:

File contents
   10 REM Decimal number output from
   20 REM 6502 assembly language
   30 REM by Pete Dawes
   40 REM (c) The Micro User
   50 REM September 1990
   60 MODE 7:hex=&80:work=&82
   70 decimal=&84:oswrch=&FFEE
   80 FOR pass=0 TO 2 STEP 2
   90 P%=&C00:[OPT pass
  100 .reset
  110 LDA #0
  120 STA decimal+0:STA decimal+1
  130 STA decimal+2:STA decimal+3
  140 STA decimal+4:STA decimal+5
  150 .convert
  160 LDA #0
  170 STA work:STA work+1
  180 CLC:LDX #16
  190 .loop
  200 ROL hex:ROL hex+1
  210 ROL work:ROL work+1
  220 SEC:LDA work
  230 SBC #10:TAY
  240 LDA work+1
  250 SBC #0:BCC less
  260 STY work:STA work+1
  270 .less
  280 DEX:BNE loop
  290 ROL hex:ROL hex+1
  300 CLC:LDA work
  310 ADC #48
  320 JSR concatenate
  330 LDA hex:ORA hex+1
  340 BNE convert
  350 LDX decimal
  360 LDY #1
  370 .print
  380 LDA decimal,Y
  390 JSR oswrch
  400 INY:DEX
  410 BNE print
  420 RTS
  430 .concatenate
  440 PHA:LDY decimal
  450 BEQ zero
  460 .move
  470 LDA decimal,Y
  480 STA decimal+1,Y
  490 DEY:BNE move
  500 .zero
  510 PLA
  520 STA decimal+1
  530 INC decimal
  540 RTS
  550 ]:NEXT pass
  560 REM Demonstration routine
  570 !hex=&FFFF:PROCdo
  580 !hex=&8000:PROCdo
  590 !hex=&0:PROCdo
  600 !hex=&E31D:PROCdo
  610 !hex=&730:PROCdo
  620 !hex=&C00:PROCdo
  630 END
  640 DEF PROCdo
  650 PRINT TAB(7)"Hexadecimal = &";STR$~!hex:PRINT"Decimal equivalent = ";
  670 CALL &C00
  680 PRINT:PRINT
  690 ENDPROC

! � Decimal number output from
 � 6502 assembly language
 � by Pete Dawes
( � (c) The Micro User
2 � September 1990
< � 7:hex=&80:work=&82
F decimal=&84:oswrch=&FFEE
P � pass=0 � 2 � 2
Z P%=&C00:[OPT pass
d .reset
n LDA #0
x  STA decimal+0:STA decimal+1
�  STA decimal+2:STA decimal+3
�  STA decimal+4:STA decimal+5
�
 .convert
� LDA #0
� STA work:STA work+1
� CLC:LDX #16
�
 .loop
� ROL hex:ROL hex+1
� ROL work:ROL work+1
� SEC:LDA work
� SBC #10:TAY
� LDA work+1
� SBC #0:BCC less
 STY work:STA work+1

 .less
 DEX:BNE loop
" ROL hex:ROL hex+1
, CLC:LDA work
6 ADC #48
@ JSR concatenate
J LDA hex:�A hex+1
T BNE convert
^ LDX decimal
h LDY #1
r .print
| LDA decimal,Y
� JSR oswrch
� INY:DEX
� BNE print
� RTS
� .concatenate
� PHA:LDY decimal
�
 BEQ zero
�
 .move
� LDA decimal,Y
� STA decimal+1,Y
� DEY:BNE move
�
 .zero
� PLA
 STA decimal+1
 INC decimal
 RTS
&
 ]:� pass
0 � Demonstration routine
: !hex=&FFFF:�do
D !hex=&8000:�do
N !hex=&0:�do
X !hex=&E31D:�do
b !hex=&730:�do
l !hex=&C00:�do
v �
�
 � �do
�< � �7)"Hexadecimal = &";�~!hex:�"Decimal equivalent = ";
� � &C00
� �:�
� �
�
00000000  0d 00 0a 21 20 f4 20 44  65 63 69 6d 61 6c 20 6e  |...! . Decimal n|
00000010  75 6d 62 65 72 20 6f 75  74 70 75 74 20 66 72 6f  |umber output fro|
00000020  6d 0d 00 14 1d 20 f4 20  36 35 30 32 20 61 73 73  |m.... . 6502 ass|
00000030  65 6d 62 6c 79 20 6c 61  6e 67 75 61 67 65 0d 00  |embly language..|
00000040  1e 14 20 f4 20 62 79 20  50 65 74 65 20 44 61 77  |.. . by Pete Daw|
00000050  65 73 0d 00 28 19 20 f4  20 28 63 29 20 54 68 65  |es..(. . (c) The|
00000060  20 4d 69 63 72 6f 20 55  73 65 72 0d 00 32 15 20  | Micro User..2. |
00000070  f4 20 53 65 70 74 65 6d  62 65 72 20 31 39 39 30  |. September 1990|
00000080  0d 00 3c 19 20 eb 20 37  3a 68 65 78 3d 26 38 30  |..<. . 7:hex=&80|
00000090  3a 77 6f 72 6b 3d 26 38  32 0d 00 46 1d 20 64 65  |:work=&82..F. de|
000000a0  63 69 6d 61 6c 3d 26 38  34 3a 6f 73 77 72 63 68  |cimal=&84:oswrch|
000000b0  3d 26 46 46 45 45 0d 00  50 15 20 e3 20 70 61 73  |=&FFEE..P. . pas|
000000c0  73 3d 30 20 b8 20 32 20  88 20 32 0d 00 5a 16 20  |s=0 . 2 . 2..Z. |
000000d0  50 25 3d 26 43 30 30 3a  5b 4f 50 54 20 70 61 73  |P%=&C00:[OPT pas|
000000e0  73 0d 00 64 0b 20 2e 72  65 73 65 74 0d 00 6e 0b  |s..d. .reset..n.|
000000f0  20 4c 44 41 20 23 30 0d  00 78 20 20 53 54 41 20  | LDA #0..x  STA |
00000100  64 65 63 69 6d 61 6c 2b  30 3a 53 54 41 20 64 65  |decimal+0:STA de|
00000110  63 69 6d 61 6c 2b 31 0d  00 82 20 20 53 54 41 20  |cimal+1...  STA |
00000120  64 65 63 69 6d 61 6c 2b  32 3a 53 54 41 20 64 65  |decimal+2:STA de|
00000130  63 69 6d 61 6c 2b 33 0d  00 8c 20 20 53 54 41 20  |cimal+3...  STA |
00000140  64 65 63 69 6d 61 6c 2b  34 3a 53 54 41 20 64 65  |decimal+4:STA de|
00000150  63 69 6d 61 6c 2b 35 0d  00 96 0d 20 2e 63 6f 6e  |cimal+5.... .con|
00000160  76 65 72 74 0d 00 a0 0b  20 4c 44 41 20 23 30 0d  |vert.... LDA #0.|
00000170  00 aa 18 20 53 54 41 20  77 6f 72 6b 3a 53 54 41  |... STA work:STA|
00000180  20 77 6f 72 6b 2b 31 0d  00 b4 10 20 43 4c 43 3a  | work+1.... CLC:|
00000190  4c 44 58 20 23 31 36 0d  00 be 0a 20 2e 6c 6f 6f  |LDX #16.... .loo|
000001a0  70 0d 00 c8 16 20 52 4f  4c 20 68 65 78 3a 52 4f  |p.... ROL hex:RO|
000001b0  4c 20 68 65 78 2b 31 0d  00 d2 18 20 52 4f 4c 20  |L hex+1.... ROL |
000001c0  77 6f 72 6b 3a 52 4f 4c  20 77 6f 72 6b 2b 31 0d  |work:ROL work+1.|
000001d0  00 dc 11 20 53 45 43 3a  4c 44 41 20 77 6f 72 6b  |... SEC:LDA work|
000001e0  0d 00 e6 10 20 53 42 43  20 23 31 30 3a 54 41 59  |.... SBC #10:TAY|
000001f0  0d 00 f0 0f 20 4c 44 41  20 77 6f 72 6b 2b 31 0d  |.... LDA work+1.|
00000200  00 fa 14 20 53 42 43 20  23 30 3a 42 43 43 20 6c  |... SBC #0:BCC l|
00000210  65 73 73 0d 01 04 18 20  53 54 59 20 77 6f 72 6b  |ess.... STY work|
00000220  3a 53 54 41 20 77 6f 72  6b 2b 31 0d 01 0e 0a 20  |:STA work+1.... |
00000230  2e 6c 65 73 73 0d 01 18  11 20 44 45 58 3a 42 4e  |.less.... DEX:BN|
00000240  45 20 6c 6f 6f 70 0d 01  22 16 20 52 4f 4c 20 68  |E loop..". ROL h|
00000250  65 78 3a 52 4f 4c 20 68  65 78 2b 31 0d 01 2c 11  |ex:ROL hex+1..,.|
00000260  20 43 4c 43 3a 4c 44 41  20 77 6f 72 6b 0d 01 36  | CLC:LDA work..6|
00000270  0c 20 41 44 43 20 23 34  38 0d 01 40 14 20 4a 53  |. ADC #48..@. JS|
00000280  52 20 63 6f 6e 63 61 74  65 6e 61 74 65 0d 01 4a  |R concatenate..J|
00000290  15 20 4c 44 41 20 68 65  78 3a 84 41 20 68 65 78  |. LDA hex:.A hex|
000002a0  2b 31 0d 01 54 10 20 42  4e 45 20 63 6f 6e 76 65  |+1..T. BNE conve|
000002b0  72 74 0d 01 5e 10 20 4c  44 58 20 64 65 63 69 6d  |rt..^. LDX decim|
000002c0  61 6c 0d 01 68 0b 20 4c  44 59 20 23 31 0d 01 72  |al..h. LDY #1..r|
000002d0  0b 20 2e 70 72 69 6e 74  0d 01 7c 12 20 4c 44 41  |. .print..|. LDA|
000002e0  20 64 65 63 69 6d 61 6c  2c 59 0d 01 86 0f 20 4a  | decimal,Y.... J|
000002f0  53 52 20 6f 73 77 72 63  68 0d 01 90 0c 20 49 4e  |SR oswrch.... IN|
00000300  59 3a 44 45 58 0d 01 9a  0e 20 42 4e 45 20 70 72  |Y:DEX.... BNE pr|
00000310  69 6e 74 0d 01 a4 08 20  52 54 53 0d 01 ae 11 20  |int.... RTS.... |
00000320  2e 63 6f 6e 63 61 74 65  6e 61 74 65 0d 01 b8 14  |.concatenate....|
00000330  20 50 48 41 3a 4c 44 59  20 64 65 63 69 6d 61 6c  | PHA:LDY decimal|
00000340  0d 01 c2 0d 20 42 45 51  20 7a 65 72 6f 0d 01 cc  |.... BEQ zero...|
00000350  0a 20 2e 6d 6f 76 65 0d  01 d6 12 20 4c 44 41 20  |. .move.... LDA |
00000360  64 65 63 69 6d 61 6c 2c  59 0d 01 e0 14 20 53 54  |decimal,Y.... ST|
00000370  41 20 64 65 63 69 6d 61  6c 2b 31 2c 59 0d 01 ea  |A decimal+1,Y...|
00000380  11 20 44 45 59 3a 42 4e  45 20 6d 6f 76 65 0d 01  |. DEY:BNE move..|
00000390  f4 0a 20 2e 7a 65 72 6f  0d 01 fe 08 20 50 4c 41  |.. .zero.... PLA|
000003a0  0d 02 08 12 20 53 54 41  20 64 65 63 69 6d 61 6c  |.... STA decimal|
000003b0  2b 31 0d 02 12 10 20 49  4e 43 20 64 65 63 69 6d  |+1.... INC decim|
000003c0  61 6c 0d 02 1c 08 20 52  54 53 0d 02 26 0d 20 5d  |al.... RTS..&. ]|
000003d0  3a ed 20 70 61 73 73 0d  02 30 1c 20 f4 20 44 65  |:. pass..0. . De|
000003e0  6d 6f 6e 73 74 72 61 74  69 6f 6e 20 72 6f 75 74  |monstration rout|
000003f0  69 6e 65 0d 02 3a 13 20  21 68 65 78 3d 26 46 46  |ine..:. !hex=&FF|
00000400  46 46 3a f2 64 6f 0d 02  44 13 20 21 68 65 78 3d  |FF:.do..D. !hex=|
00000410  26 38 30 30 30 3a f2 64  6f 0d 02 4e 10 20 21 68  |&8000:.do..N. !h|
00000420  65 78 3d 26 30 3a f2 64  6f 0d 02 58 13 20 21 68  |ex=&0:.do..X. !h|
00000430  65 78 3d 26 45 33 31 44  3a f2 64 6f 0d 02 62 12  |ex=&E31D:.do..b.|
00000440  20 21 68 65 78 3d 26 37  33 30 3a f2 64 6f 0d 02  | !hex=&730:.do..|
00000450  6c 12 20 21 68 65 78 3d  26 43 30 30 3a f2 64 6f  |l. !hex=&C00:.do|
00000460  0d 02 76 06 20 e0 0d 02  80 0a 20 dd 20 f2 64 6f  |..v. ..... . .do|
00000470  0d 02 8a 3c 20 f1 20 8a  37 29 22 48 65 78 61 64  |...< . .7)"Hexad|
00000480  65 63 69 6d 61 6c 20 3d  20 26 22 3b c3 7e 21 68  |ecimal = &";.~!h|
00000490  65 78 3a f1 22 44 65 63  69 6d 61 6c 20 65 71 75  |ex:."Decimal equ|
000004a0  69 76 61 6c 65 6e 74 20  3d 20 22 3b 0d 02 9e 0b  |ivalent = ";....|
000004b0  20 d6 20 26 43 30 30 0d  02 a8 08 20 f1 3a f1 0d  | . &C00.... .:..|
000004c0  02 b2 06 20 e1 0d ff                              |... ...|
000004c7
DecOut.m0
DecOut.m1
DecOut.m2
DecOut.m4
DecOut.m5