# HG changeset patch # User boisy # Date 1081341655 0 # Node ID e6cc61505ca70df80a9c30af0097bd5d992ad417 # Parent 1c5a50add566f60e71ae9219f7565d4c8e5b508a Rodney does it again! diff -r 1c5a50add566 -r e6cc61505ca7 level1/cmds/asm.asm --- a/level1/cmds/asm.asm Wed Apr 07 01:43:41 2004 +0000 +++ b/level1/cmds/asm.asm Wed Apr 07 12:40:55 2004 +0000 @@ -19,6 +19,12 @@ * * 8 2003/07/28 Rodney V. Hamilton * Enabled underscore and lowercase in symbols. +* +* 9 2004/03/20 Rodney V. Hamilton +* Added support for LDQ immediate, TFM register modes +* Copied the W indexed addressing code from ASM6309 +* 0-register bug fixed, TFR now accepts R16->R8 xfers +* Added new IFDEF/IFNDF conditionals nam Asm ttl 6809/6309 Assembler @@ -30,9 +36,9 @@ tylg set Prgrm+Objct atrv set ReEnt+rev rev set $00 -edition set $08 +edition set $09 DOCASE equ 1 enable case-sensitive symbols - +NEWDEF equ 1 enable IFDEF/IFNDF conditionals mod eom,name,tylg,atrv,asm,size * u002B Bit flag meanings: (Default=00110101) @@ -45,7 +51,11 @@ PrintPC equ %00000001 Print PC flag DoNothng equ %00000000 Do nothing (no flags set) + IFNE NEWDEF +Numop equ 162 # of opcodes in table (including pseudo-ops) + ELSE Numop equ 160 # of opcodes in table (including pseudo-ops) + ENDC NEWDEF u0000 rmb 2 Ptr to source line input buffer (80 + CR) u0002 rmb 2 Ptr to header output buffer (132 + CR) @@ -54,11 +64,11 @@ u0008 rmb 2 Ptr to Title buffer (TTL, 79 chars + nul) u000A rmb 2 Ptr to Name buffer (NAM, 39 chars + nul) u000C rmb 1 temp postbyte storage for 6309 bit ops - IFNE DOCASE + IFNE DOCASE u000D rmb 1 symbol case mask (was unused) ELSE u000D rmb 1 unused - ENDC + ENDC DOCASE u000E rmb 2 Ptr to object code buffer (256 bytes) u0010 rmb 2 Ptr to symbol first letter index table u0012 rmb 2 Ptr to end of symbol table @@ -76,8 +86,8 @@ u0026 rmb 2 Total data bytes allocated u0028 rmb 2 Total errors u002A rmb 1 -u002B rmb 1 Bit flags -u002C rmb 1 +u002B rmb 1 Listing Print Control Bit flags +u002C rmb 1 Data space ops in current line u002D rmb 2 Ptr to last symbol found/added (scratch) u002F rmb 2 Ptr to start of current mnemonic u0031 rmb 2 Ptr to next field (or operand start) @@ -89,7 +99,7 @@ u003A rmb 2 page number u003C rmb 1 u003D rmb 1 -u003E rmb 1 Pass number +u003E rmb 1 Pass counter u003F rmb 1 u0040 rmb 2 Current code address ('*') u0042 rmb 2 Current data address ('.') @@ -150,11 +160,11 @@ std 16 always bad + lda 8 is OK + cmpa #$1F only if op=TFR + beq L0879 according to Motorola's asm +sizerr ldb #16 Otherwise, 'reg sizes' error + leas $02,s Eat copies of regs + bra L0854 and exit +* Create operand byte +* Entry: Stack contains Source & Destination register masks L0879 puls a Get back source register lsla Move into most significiant nibble lsla @@ -1390,12 +1603,13 @@ ora ,s+ Merge with destination register sta L156A - cmpb #$D3 EOF? + cmpb #E$EOF EOF? bne L1560 bsr L156C bcc L1549 @@ -3153,11 +3466,11 @@ * RVH add-on: accept tabs in source text by * converting them to spaces. X=inbuf,Y=count TabFix ldd #$0920 A=tab, B=space - cmpa ,x+ is it a tab? - bne *+4 +t.loop cmpa ,x+ is it a tab? + bne t.next stb -1,x yes, change to space - leay -1,y - bne *-8 scan to end of input +t.next leay -1,y + bne t.loop scan to end of input andcc #$FE error flag off bra L156A and return @@ -3173,7 +3486,7 @@ fcb $00 L1587 pshs b,a - lda #$24 '$' + lda #'$ sta ,x+ ldd ,s lbsr L1057 call OUT4HS @@ -3220,7 +3533,7 @@ bra L15EB L15F7 clrb os9 F$Exit -L15FB lda #$01 +L15FB lda #READ. open in READ mode os9 I$Open ldb #24 'can't open' error lbcs L1017 if open fails @@ -3233,18 +3546,18 @@ rts L1612 ldb L0012,pcr get sizeof drive tables -* confusion reigns supreme here, -* one source loaction says its number of drive tables, -* and the next says its the size of the table! And a 3rd -* says its D.TYP. + ldb #DRVMEM get sizeof drive tables +* confusion reigns supreme here - NO MORE! +* The data stored at L0012 *IS* the drive table sizeof. +* MY question is why this RBF constant is stored as a variable. +* Why would it need to be changed, and by who? mul calculate offset into drive tables addd V$STAT,u add start of static memory addd #DRVBEG add offset to drive tables