Home » Archimedes archive » Archimedes World » archimedes_world_volume_15_issue_2_scp.adf » !ARMwrest_ARMwrest » MRC_MCR
MRC_MCR
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 » Archimedes archive » Archimedes World » archimedes_world_volume_15_issue_2_scp.adf » !ARMwrest_ARMwrest |
Filename: | MRC_MCR |
Read OK: | ✔ |
File size: | 04E5 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10ERROR 0,"The MRC/MCR function library cannot be run. Use the LIBRARY command to include it in your code." 20 30DEF FNmrc(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%) : REM assembles an mrc instruction 40=FNmrc_mcr(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%,1) 50 60DEF FNmcr(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%) : REM assembles an mcr instruction 70=FNmrc_mcr(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%,0) 80 90DEFFNcondition_code(cond$) 100 REM converts a string containing a condition code (cond$) into the code for that condition 110 LOCAL t% 120 IF LEN(cond$) = 2 THEN 130 t%=ASC(MID$(cond$,1,1)) 140 IF t% < 97 THEN t%+=32:MID$(cond$,1,1)=CHR$(t%) 150 t%=ASC(MID$(cond$,2,1)) 160 IF t% < 97 THEN t%+=32:MID$(cond$,2,1)=CHR$(t%) 170 t%=INSTR("eq ne cs cc mi pl vs vc hi ls ge lt gt le al nv ",cond$) 180 IF t% > 0 THEN = ((t%-1)/3)<<28 190 ELSE 200 IF LEN(cond$) = 0 THEN =14<<28 : REM default to AL if no condition is specified 210 ENDIF 220 ERROR 0,"Unknown condition code." 230=-1 240 250DEF FNmrc_mcr(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%,read%) 260 read%=read% AND 1 270 cn%=cn% AND 15 280 exp1%=exp1% AND 7 290 cr1%=cr1% AND 15 300 cr2%=cr2% AND 15 310 exp2%=exp2% AND 7 320 [OPT pass% 330 DCD FNcondition_code(cond$) OR &0E000000 OR exp1%<<21 OR read%<<20 OR cr1%<<16 OR reg%<<12 OR cn%<<8 OR exp2%<<5 OR 16 OR cr2% 340 ] 350=0
i� 0,"The MRC/MCR function library cannot be run. Use the LIBRARY command to include it in your code." Q� �mrc(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%) : � assembles an mrc instruction (5=�mrc_mcr(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%,1) 2 <Q� �mcr(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%) : � assembles an mcr instruction F5=�mrc_mcr(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%,0) P Zݤcondition_code(cond$) d^ � converts a string containing a condition code (cond$) into the code for that condition n � t% x � �(cond$) = 2 � � t%=�(�cond$,1,1)) �, � t% < 97 � t%+=32:�cond$,1,1)=�(t%) � t%=�(�cond$,2,1)) �, � t% < 97 � t%+=32:�cond$,2,1)=�(t%) �E t%=�"eq ne cs cc mi pl vs vc hi ls ge lt gt le al nv ",cond$) �# � t% > 0 � = ((t%-1)/3)<<28 � � �O � �(cond$) = 0 � =14<<28 : � default to AL if no condition is specified � � �# � 0,"Unknown condition code." �=-1 � �:� �mrc_mcr(cond$,cn%,exp1%,reg%,cr1%,cr2%,exp2%,read%) read%=read% � 1 cn%=cn% � 15 exp1%=exp1% � 7 " cr1%=cr1% � 15 , cr2%=cr2% � 15 6 exp2%=exp2% � 7 @ [OPT pass% Jz DCD �condition_code(cond$) � &0E000000 � exp1%<<21 � read%<<20 � cr1%<<16 � reg%<<12 � cn%<<8 � exp2%<<5 � 16 � cr2% T ] ^=0 �
00000000 0d 00 0a 69 85 20 30 2c 22 54 68 65 20 4d 52 43 |...i. 0,"The MRC| 00000010 2f 4d 43 52 20 66 75 6e 63 74 69 6f 6e 20 6c 69 |/MCR function li| 00000020 62 72 61 72 79 20 63 61 6e 6e 6f 74 20 62 65 20 |brary cannot be | 00000030 72 75 6e 2e 20 55 73 65 20 74 68 65 20 4c 49 42 |run. Use the LIB| 00000040 52 41 52 59 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 |RARY command to | 00000050 69 6e 63 6c 75 64 65 20 69 74 20 69 6e 20 79 6f |include it in yo| 00000060 75 72 20 63 6f 64 65 2e 22 0d 00 14 04 0d 00 1e |ur code.".......| 00000070 51 dd 20 a4 6d 72 63 28 63 6f 6e 64 24 2c 63 6e |Q. .mrc(cond$,cn| 00000080 25 2c 65 78 70 31 25 2c 72 65 67 25 2c 63 72 31 |%,exp1%,reg%,cr1| 00000090 25 2c 63 72 32 25 2c 65 78 70 32 25 29 20 3a 20 |%,cr2%,exp2%) : | 000000a0 f4 20 61 73 73 65 6d 62 6c 65 73 20 61 6e 20 6d |. assembles an m| 000000b0 72 63 20 69 6e 73 74 72 75 63 74 69 6f 6e 0d 00 |rc instruction..| 000000c0 28 35 3d a4 6d 72 63 5f 6d 63 72 28 63 6f 6e 64 |(5=.mrc_mcr(cond| 000000d0 24 2c 63 6e 25 2c 65 78 70 31 25 2c 72 65 67 25 |$,cn%,exp1%,reg%| 000000e0 2c 63 72 31 25 2c 63 72 32 25 2c 65 78 70 32 25 |,cr1%,cr2%,exp2%| 000000f0 2c 31 29 0d 00 32 04 0d 00 3c 51 dd 20 a4 6d 63 |,1)..2...<Q. .mc| 00000100 72 28 63 6f 6e 64 24 2c 63 6e 25 2c 65 78 70 31 |r(cond$,cn%,exp1| 00000110 25 2c 72 65 67 25 2c 63 72 31 25 2c 63 72 32 25 |%,reg%,cr1%,cr2%| 00000120 2c 65 78 70 32 25 29 20 3a 20 f4 20 61 73 73 65 |,exp2%) : . asse| 00000130 6d 62 6c 65 73 20 61 6e 20 6d 63 72 20 69 6e 73 |mbles an mcr ins| 00000140 74 72 75 63 74 69 6f 6e 0d 00 46 35 3d a4 6d 72 |truction..F5=.mr| 00000150 63 5f 6d 63 72 28 63 6f 6e 64 24 2c 63 6e 25 2c |c_mcr(cond$,cn%,| 00000160 65 78 70 31 25 2c 72 65 67 25 2c 63 72 31 25 2c |exp1%,reg%,cr1%,| 00000170 63 72 32 25 2c 65 78 70 32 25 2c 30 29 0d 00 50 |cr2%,exp2%,0)..P| 00000180 04 0d 00 5a 1b dd a4 63 6f 6e 64 69 74 69 6f 6e |...Z...condition| 00000190 5f 63 6f 64 65 28 63 6f 6e 64 24 29 0d 00 64 5e |_code(cond$)..d^| 000001a0 20 20 f4 20 63 6f 6e 76 65 72 74 73 20 61 20 73 | . converts a s| 000001b0 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e 69 6e 67 |tring containing| 000001c0 20 61 20 63 6f 6e 64 69 74 69 6f 6e 20 63 6f 64 | a condition cod| 000001d0 65 20 28 63 6f 6e 64 24 29 20 69 6e 74 6f 20 74 |e (cond$) into t| 000001e0 68 65 20 63 6f 64 65 20 66 6f 72 20 74 68 61 74 |he code for that| 000001f0 20 63 6f 6e 64 69 74 69 6f 6e 0d 00 6e 0a 20 20 | condition..n. | 00000200 ea 20 74 25 0d 00 78 16 20 20 e7 20 a9 28 63 6f |. t%..x. . .(co| 00000210 6e 64 24 29 20 3d 20 32 20 8c 0d 00 82 19 20 20 |nd$) = 2 ..... | 00000220 20 20 74 25 3d 97 28 c1 63 6f 6e 64 24 2c 31 2c | t%=.(.cond$,1,| 00000230 31 29 29 0d 00 8c 2c 20 20 20 20 e7 20 74 25 20 |1))..., . t% | 00000240 3c 20 39 37 20 8c 20 74 25 2b 3d 33 32 3a c1 63 |< 97 . t%+=32:.c| 00000250 6f 6e 64 24 2c 31 2c 31 29 3d bd 28 74 25 29 0d |ond$,1,1)=.(t%).| 00000260 00 96 19 20 20 20 20 74 25 3d 97 28 c1 63 6f 6e |... t%=.(.con| 00000270 64 24 2c 32 2c 31 29 29 0d 00 a0 2c 20 20 20 20 |d$,2,1))..., | 00000280 e7 20 74 25 20 3c 20 39 37 20 8c 20 74 25 2b 3d |. t% < 97 . t%+=| 00000290 33 32 3a c1 63 6f 6e 64 24 2c 32 2c 31 29 3d bd |32:.cond$,2,1)=.| 000002a0 28 74 25 29 0d 00 aa 45 20 20 20 20 74 25 3d a7 |(t%)...E t%=.| 000002b0 22 65 71 20 6e 65 20 63 73 20 63 63 20 6d 69 20 |"eq ne cs cc mi | 000002c0 70 6c 20 76 73 20 76 63 20 68 69 20 6c 73 20 67 |pl vs vc hi ls g| 000002d0 65 20 6c 74 20 67 74 20 6c 65 20 61 6c 20 6e 76 |e lt gt le al nv| 000002e0 20 22 2c 63 6f 6e 64 24 29 0d 00 b4 23 20 20 20 | ",cond$)...# | 000002f0 20 e7 20 74 25 20 3e 20 30 20 8c 20 3d 20 28 28 | . t% > 0 . = ((| 00000300 74 25 2d 31 29 2f 33 29 3c 3c 32 38 0d 00 be 07 |t%-1)/3)<<28....| 00000310 20 20 cc 0d 00 c8 4f 20 20 20 20 e7 20 a9 28 63 | ....O . .(c| 00000320 6f 6e 64 24 29 20 3d 20 30 20 8c 20 3d 31 34 3c |ond$) = 0 . =14<| 00000330 3c 32 38 20 3a 20 f4 20 64 65 66 61 75 6c 74 20 |<28 : . default | 00000340 74 6f 20 41 4c 20 69 66 20 6e 6f 20 63 6f 6e 64 |to AL if no cond| 00000350 69 74 69 6f 6e 20 69 73 20 73 70 65 63 69 66 69 |ition is specifi| 00000360 65 64 0d 00 d2 07 20 20 cd 0d 00 dc 23 20 20 85 |ed.... ....# .| 00000370 20 30 2c 22 55 6e 6b 6e 6f 77 6e 20 63 6f 6e 64 | 0,"Unknown cond| 00000380 69 74 69 6f 6e 20 63 6f 64 65 2e 22 0d 00 e6 07 |ition code."....| 00000390 3d 2d 31 0d 00 f0 04 0d 00 fa 3a dd 20 a4 6d 72 |=-1.......:. .mr| 000003a0 63 5f 6d 63 72 28 63 6f 6e 64 24 2c 63 6e 25 2c |c_mcr(cond$,cn%,| 000003b0 65 78 70 31 25 2c 72 65 67 25 2c 63 72 31 25 2c |exp1%,reg%,cr1%,| 000003c0 63 72 32 25 2c 65 78 70 32 25 2c 72 65 61 64 25 |cr2%,exp2%,read%| 000003d0 29 0d 01 04 15 20 20 72 65 61 64 25 3d 72 65 61 |).... read%=rea| 000003e0 64 25 20 80 20 31 0d 01 0e 12 20 20 63 6e 25 3d |d% . 1.... cn%=| 000003f0 63 6e 25 20 80 20 31 35 0d 01 18 15 20 20 65 78 |cn% . 15.... ex| 00000400 70 31 25 3d 65 78 70 31 25 20 80 20 37 0d 01 22 |p1%=exp1% . 7.."| 00000410 14 20 20 63 72 31 25 3d 63 72 31 25 20 80 20 31 |. cr1%=cr1% . 1| 00000420 35 0d 01 2c 14 20 20 63 72 32 25 3d 63 72 32 25 |5..,. cr2%=cr2%| 00000430 20 80 20 31 35 0d 01 36 17 20 20 65 78 70 32 25 | . 15..6. exp2%| 00000440 3d 65 78 70 32 25 20 80 20 37 20 20 0d 01 40 10 |=exp2% . 7 ..@.| 00000450 20 20 5b 4f 50 54 20 70 61 73 73 25 0d 01 4a 7a | [OPT pass%..Jz| 00000460 20 20 44 43 44 20 a4 63 6f 6e 64 69 74 69 6f 6e | DCD .condition| 00000470 5f 63 6f 64 65 28 63 6f 6e 64 24 29 20 84 20 26 |_code(cond$) . &| 00000480 30 45 30 30 30 30 30 30 20 84 20 65 78 70 31 25 |0E000000 . exp1%| 00000490 3c 3c 32 31 20 84 20 72 65 61 64 25 3c 3c 32 30 |<<21 . read%<<20| 000004a0 20 84 20 63 72 31 25 3c 3c 31 36 20 84 20 72 65 | . cr1%<<16 . re| 000004b0 67 25 3c 3c 31 32 20 84 20 63 6e 25 3c 3c 38 20 |g%<<12 . cn%<<8 | 000004c0 84 20 65 78 70 32 25 3c 3c 35 20 84 20 31 36 20 |. exp2%<<5 . 16 | 000004d0 84 20 63 72 32 25 0d 01 54 07 20 20 5d 0d 01 5e |. cr2%..T. ]..^| 000004e0 06 3d 30 0d ff |.=0..| 000004e5