Difference between revisions of "Decode Opcodes"

From BeebWiki
Jump to: navigation, search
m (1 revision)
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:BASIC_ROM_Analysis_Programs]]
 
[[Category:BASIC_ROM_Analysis_Programs]]
  
This program decodes Assembly Mnemonics from the [[BBC_BASIC_(65)#BASIC_4.2C_HIBASIC_4.2C_1984|BASIC 4]] ROM.
+
This program decodes Assembly Mnemonics from the [[6502_BBC_BASIC#BASIC_4.2C_HIBASIC_4.2C_1984|BASIC 4]] ROM.
  
 
<pre>
 
<pre>

Latest revision as of 21:41, 8 March 2015


This program decodes Assembly Mnemonics from the BASIC 4 ROM.

   10 PRINT"NUM  MNE    OPCODE"'"---  ---    ------"
   20 FOR c%=0 TO &44
   30 b%=?(&8892+c%)
   40 b%=b% DIV 4
   50 b%=b% AND &1F
   60 b%=b% OR &40
   70 L1$=CHR$b%
   80 b%=?(&884D+c%)
   90 b%=b% DIV 32
  100 b%=b%+16*(ABS((?(&8892+c%) AND &02)=&02))
  110 b%=b%+8*(ABS((?(&8892+c%) AND &01)=&01))
  120 b%=b% AND &1F
  130 b%=b% OR &40
  140 L2$=CHR$b%
  150 b%=?(&884D+c%)
  160 b%=b% AND &1F
  170 b%=b% OR &40
  180 L3$=CHR$b%
  190 PRINT RIGHT$("0"+STR$~(c%),2);"   ";L1$;L2$;L3$;"    ";RIGHT$("0"+STR$~?(&88D7+c%),2);"  b1=";RIGHT$("0"+STR$~?(&884D+c%),2);"  b2=";~?(&8892+c%)
  200 NEXTc%