AWork In Progress (ASM)

This commit is contained in:
Rémy GIBERT 2015-10-16 17:35:11 +02:00
parent a9b7399902
commit 2ec85716eb
5 changed files with 1749 additions and 278 deletions

View File

@ -3,262 +3,366 @@ PREFIX /A2OSX.SRC
NEW NEW
INC 1 INC 1
AUTO 6 AUTO 6
.TF /A2OSX.BOOT/BIN/ASM.T.6502 .LIST OFF
.OR $2000 .OR $2000
.TF /A2OSX.BOOT/BIN/ASM.T.6502
*--------------------------------------- *---------------------------------------
.MA AMS AMSID,"Pattern" .MA PSTR
.DA #]1 .DA #:1-*-1
.AS ]2 .AS "]1"
.DA #0 :1 .EQ *
.AS ]3
.DA #0
.AS ]4
.DA #0
.EM .EM
*--------------------------------------- *---------------------------------------
.DA T.ADDR.MODES.SYNTAX .MA AM
.DA ]1
>PSTR "]2"
.EM
*---------------------------------------
.DA T.ADDR.MODES
.DA T.REGISTERS
.DA T.OPCODES .DA T.OPCODES
*--------------------------------------- *---------------------------------------
T.ADDR.MODES.SYNTAX .AS "1 Implicit T.ADDR.MODES .EQ *
>AMS 2,"#?1",$1","" Imm8 >PSTR "(a),Y"
>AMS 3,"$2","$1=$2-@+1","-127,128" rel8 >PSTR "(a,X)"
>AMS 4,"$1","$1","" abs8 >PSTR "a"
>AMS 5,"$1,X","$1","" abs8,x >PSTR "a,X"
>AMS 6,"$2","$2","" abs16 >PSTR "aa"
>AMS 7,"$2,X","$2","" abs16,x >PSTR "aa,X"
>AMS 8,"$2,Y","$2","" abs16,y >PSTR "aa,Y"
>AMS 9,"($2)","$2","" (abs16) >PSTR "i"
>AMS 10,"($1)","$1","" (abs8) >PSTR "r"
>AMS 11,"($1,X)","$1","" (abs8,x) >PSTR "(aa)"
>AMS 12,"($1),Y","$1","" (abs8),y >PSTR "a,Y"
.HS 0 .HS 00
*--------------------------------------- *---------------------------------------
T.OPCODES .AS "ADC" T.REGISTERS .EQ *
.HS 0 >PSTR "Y"
.HS 2,$69,4,$65,5,$75,6,$6D,7,$7D,8,$79,11,$61,12,$71 >PSTR "X"
.HS 0 .HS 00
.AS "AND" *---------------------------------------
.HS 0 T.OPCODES .EQ *
.HS .DA #E.ADC-*
.HS 0 >PSTR "ADC"
.AS "ASL" >AM 0,"71a"
.HS 0 >AM 1,"61a"
.HS >AM 2,"65a"
.HS 0 >AM 3,"75a"
.AS "BCC" >AM 4,"6Daa"
.HS 0 >AM 5,"7Daa"
.HS 3,$90 >AM 6,"79aa"
.HS 0 >AM 7,"69i"
.AS "BCS" E.ADC .HS 00
.HS 0 .DA #E.AND-*
.HS 3,$B0 >PSTR "AND"
.HS 0 >AM 0,"31a"
.AS "BEQ" >AM 1,"21a"
.HS 0 >AM 2,"25a"
.HS >AM 3,"35a"
.HS 0 >AM 4,"2Daa"
.AS "BIT" >AM 5,"3Daa"
.HS 0 >AM 6,"39aa"
.HS >AM 7,"29i"
.HS 0 E.AND .HS 00
.AS "BMI" .DA #E.ASL-*
.HS 0 >PSTR "ASL"
.HS >AM 2,"06a"
.HS 0 >AM 3,"16a"
.AS "BNE" >AM 4,"0Eaa"
.HS 0 >AM 5,"1Eaa"
.HS >AM 255,"0A"
.HS 0 E.ASL .HS 00
.AS "BPL" .DA #E.BCC-*
.HS 0 >PSTR "BCC"
.HS >AM 8,"90r"
.HS 0 E.BCC .HS 00
.AS "BRK" .DA #E.BCS-*
.HS 0 >PSTR "BCS"
.HS >AM 8,"B0r"
.HS 0 E.BCS .HS 00
.AS "BVC" .DA #E.BEQ-*
.HS 0 >PSTR "BEQ"
.HS >AM 8,"F0r"
.HS 0 E.BEQ .HS 00
.AS "BVS" .DA #E.BIT-*
.HS 0 >PSTR "BIT"
.HS >AM 2,"24a"
.HS 0 >AM 4,"2Caa"
.AS "CLC" E.BIT .HS 00
.HS 0 .DA #E.BMI-*
.HS >PSTR "BMI"
.HS 0 >AM 8,"30r"
.AS "CLD" E.BMI .HS 00
.HS 0 .DA #E.BNE-*
.HS >PSTR "BNE"
.HS 0 >AM 8,"D0r"
.AS "CLI" E.BNE .HS 00
.HS 0 .DA #E.BPL-*
.HS >PSTR "BPL"
.HS 0 >AM 8,"10r"
.AS "CLV" E.BPL .HS 00
.HS 0 .DA #E.BRK-*
.HS >PSTR "BRK"
.HS 0 >AM 255,"00"
.AS "CMP" E.BRK .HS 00
.HS 0 .DA #E.BVC-*
.HS >PSTR "BVC"
.HS 0 >AM 8,"50r"
.AS "CPX" E.BVC .HS 00
.HS 0 .DA #E.BVS-*
.HS >PSTR "BVS"
.HS 0 >AM 8,"70r"
.AS "CPY" E.BVS .HS 00
.HS 0 .DA #E.CLC-*
.HS >PSTR "CLC"
.HS 0 >AM 255,"18"
.AS "DEC" E.CLC .HS 00
.HS 0 .DA #E.CLD-*
.HS >PSTR "CLD"
.HS 0 >AM 255,"D8"
.AS "DEX" E.CLD .HS 00
.HS 0 .DA #E.CLI-*
.HS >PSTR "CLI"
.HS 0 >AM 255,"58"
.AS "DEY" E.CLI .HS 00
.HS 0 .DA #E.CLV-*
.HS >PSTR "CLV"
.HS 0 >AM 255,"B8"
.AS "EOR" E.CLV .HS 00
.HS 0 .DA #E.CMP-*
.HS >PSTR "CMP"
.HS 0 >AM 0,"D1a"
.AS "INC" >AM 1,"C1a"
.HS 0 >AM 2,"C5a"
.HS >AM 3,"D5a"
.HS 0 >AM 4,"CDaa"
.AS "INX" >AM 5,"DDaa"
.HS 0 >AM 6,"D9aa"
.HS >AM 7,"C9i"
.HS 0 E.CMP .HS 00
.AS "INY" .DA #E.CPX-*
.HS 0 >PSTR "CPX"
.HS >AM 2,"E4a"
.HS 0 >AM 4,"Ecaa"
.AS "JMP" >AM 7,"E0i"
.HS 0 E.CPX .HS 00
.HS .DA #E.CPY-*
.HS 0 >PSTR "CPY"
.AS "JSR" >AM 2,"C4a"
.HS 0 >AM 4,"Ccaa"
.HS >AM 7,"C0i"
.HS 0 E.CPY .HS 00
.AS "LDA" .DA #E.DEC-*
.HS 0 >PSTR "DEC"
.HS >AM 2,"C6a"
.HS 0 >AM 3,"D6a"
.AS "LDX" >AM 4,"Ceaa"
.HS 0 >AM 5,"Deaa"
.HS E.DEC .HS 00
.HS 0 .DA #E.DEX-*
.AS "LDY" >PSTR "DEX"
.HS 0 >AM 255,"CA"
.HS E.DEX .HS 00
.HS 0 .DA #E.DEY-*
.AS "LSR" >PSTR "DEY"
.HS 0 >AM 255,"88"
.HS E.DEY .HS 00
.HS 0 .DA #E.EOR-*
.AS "NOP" >PSTR "EOR"
.HS 0 >AM 0,"51a"
.HS >AM 1,"41a"
.HS 0 >AM 2,"45a"
.AS "NOP" >AM 3,"55a"
.HS 0 >AM 4,"4Daa"
.HS >AM 5,"5Daa"
.HS 0 >AM 6,"59aa"
.AS "ORA" >AM 7,"49i"
.HS 0 E.EOR .HS 00
.HS .DA #E.INC-*
.HS 0 >PSTR "INC"
.AS "PHA" >AM 2,"E6a"
.HS 0 >AM 3,"F6a"
.HS >AM 4,"Eeaa"
.HS 0 >AM 5,"Feaa"
.AS "PHP" E.INC .HS 00
.HS 0 .DA #E.INX-*
.HS >PSTR "INX"
.HS 0 >AM 255,"E8"
.AS "PLA" E.INX .HS 00
.HS 0 .DA #E.INY-*
.HS >PSTR "INY"
.HS 0 >AM 255,"C8"
.AS "ROL" E.INY .HS 00
.HS 0 .DA #E.JMP-*
.HS >PSTR "JMP"
.HS 0 >AM 9,"6Caa"
.AS "ROR" >AM 4,"4Caa"
.HS 0 E.JMP .HS 00
.HS .DA #E.JSR-*
.HS 0 >PSTR "JSR"
.AS "RTI" >AM 4,"20aa"
.HS 0 E.JSR .HS 00
.HS .DA #E.LDA-*
.HS 0 >PSTR "LDA"
.AS "RTS" >AM 0,"B1a"
.HS 0 >AM 1,"A1a"
.HS >AM 2,"A5a"
.HS 0 >AM 3,"B5a"
.AS "SBC" >AM 4,"Adaa"
.HS 0 >AM 5,"Bdaa"
.HS >AM 6,"B9aa"
.HS 0 >AM 7,"A9i"
.AS "SEC" E.LDA .HS 00
.HS 0 .DA #E.LDX-*
.HS >PSTR "LDX"
.HS 0 >A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eaa"
>AM 255,"6A"
E.ROR .HS 00
.DA #E.RTI-*
>PSTR "RTI"
>AM 255,"40"
E.RTI .HS 00
.DA #E.RTS-*
>PSTR "RTS"
>AM 255,"60"
E.RTS .HS 00
.DA #E.SBC-*
>PSTR "SBC"
>AM 0,"F1a"
>AM 1,"E1a"
>AM 2,"E5a"
>AM 3,"F5a"
>AM 4,"Edaa"
>AM 5,"Fdaa"
>AM 6,"F9aa"
>AM 7,"E9i"
E.SBC .HS 00
.DA #E.SEC-*
>PSTR "SEC"
>AM 255,"38"
E.SEC .HS 00
.DA #E.SED-*
>PSTR "SED"
>AM 255,"F8"
E.SED .HS 00
.DA #E.SEI-*
>PSTR "SEI"
>AM 255,"78"
E.SEI .HS 00
.DA #E.STA-*
>PSTR "STA"
>AM 0,"91a"
>AM 1,"81a"
>AM 2,"85a"
>AM 3,"95a"
>AM 4,"8Daa"
>AM 5,"9Daa"
>AM 6,"99aa"
E.STA .HS 00
.DA #E.STX-*
>PSTR "STX"
>AM 2,"86a"
>AM 10,"96a"
>AM 4,"8Eaa"
E.STX .HS 00
.DA #E.STY-*
>PSTR "STY"
>AM 2,"84a"
>AM 3,"94a"
>AM 4,"8Caa"
E.STY .HS 00
.DA #E.TAX-*
>PSTR "TAX"
>AM 255,"AA"
E.TAX .HS 00
.DA #E.TAY-*
>PSTR "TAY"
>AM 255,"A8"
E.TAY .HS 00
.DA #E.TSX-*
>PSTR "TSX"
>AM 255,"BA"
E.TSX .HS 00
.DA #E.TXA-*
>PSTR "TXA"
>AM 255,"8A"
E.TXA .HS 00
.DA #E.TXS-*
>PSTR "TXS"
>AM 255,"9A"
E.TXS .HS 00
.DA #E.TYA-*
>PSTR "TYA"
>AM 255,"98"
E.TYA .HS 00
.HS 00
*--------------------------------------- *---------------------------------------
.HS 0
MAN MAN
SAVE BIN/ASM.T.6502.S SAVE BIN/ASM.T.6502.S
ASM ASM

0
BIN/ASM.T.65816.S.txt Normal file
View File

102
BIN/ASM.T.65R02.S.txt Normal file
View File

@ -0,0 +1,102 @@
PR#3
PREFIX /A2OSX.SRC
NEW
INC 1
AUTO 6
.TF /A2OSX.BOOT/BIN/ASM.T.65R02
.OR $2000
*---------------------------------------
.MA AMS AMSID,"Syntax",0,"Operand",0,"Rule",0
.DA #]1
.AS ]2
.DA #0
.AS ]3
.DA #0
.AS ]4
.DA #0
.EM
*---------------------------------------
T.ADDR.MODES.SYNTAX >AMS 1,"","","" Implicit
>AMS 2,"#$1",$1","" Immediate
>AMS 3,"$2","$1=$2-@+1","-127<$1<128" rel
>AMS 4,"$1","$1","" zp
>AMS 5,"$1,X","$1","" zp,x
>AMS 6,"$2","$2","" abs
>AMS 7,"$2,X","$2","" abs,x
>AMS 8,"$2,Y","$2","" abs,y
>AMS 9,"($2)","$2","" (abs)
>AMS 10,"($1)","$1","" (zp)
>AMS 11,"($1,X)","$1","" (zp,x)
>AMS 12,"($1),Y","$1","" (zp),y
T.OPCODES .AS "ADC"
.HS 0
.HS 2,$69,4,$65,5,$75,6,$6D,7,$7D,8,$79,11,$61,12,$71
.HS 0
.AS "AND"
.AS "ASL"
.AS "BCC"
.HS 0
.HS 3,$90
.HS 0
.AS "BCS"
.HS 0
.HS 3,$B0
.HS 0
.AS "BEQ"
.AS "BIT"
.AS "BMI"
.AS "BNE"
.AS "BPL"
.AS "BRK"
.AS "BVC"
.AS "BVS"
.AS "CLC"
.AS "CLD"
.AS "CLI"
.AS "CLV"
.AS "CMP"
.AS "CPX"
.AS "CPY"
.AS "DEC"
.AS "DEX"
.AS "DEY"
.AS "EOR"
.AS "INC"
.AS "INX"
.AS "INY"
.AS "JMP"
.AS "JSR"
.AS "LDA"
.AS "LDX"
.AS "LDY"
.AS "LSR"
.AS "NOP"
.AS "NOP"
.AS "ORA"
.AS "PHA"
.AS "PHP"
.AS "PLA"
.AS "ROL"
.AS "ROR"
.AS "RTI"
.AS "RTS"
.AS "SBC"
.AS "SEC"
.AS "SED"
.AS "SEI"
.AS "STA"
.AS "STX"
.AS "STY"
.AS "TAX"
.AS "TAY"
.AS "TSX"
.AS "TXA"
.AS "TXS"
.AS "TYA"
*---------------------------------------
.HS 0
MAN
SAVE BIN/ASM.T.65R02.S
ASM

File diff suppressed because it is too large Load Diff

BIN
BIN/ASM.T.xlsm Normal file

Binary file not shown.