Image Map Image Map
Results 1 to 5 of 5

Thread: 6801 assembler question

  1. #1

    Default 6801 assembler question

    I'm trying to understand the 6801 assembler source code below from an old 8-bit computer. The code is supposed to read 8 bits from a Manchester encoded data stream and build the decoded byte in the A register.

    I understand the 6801 has an 8-bit A and B register and a 16-bit D register which is a combination of A and B.

    I can't seem to find a lot of documentation on assembler for the 6801 so I'm not clear on what the <opcode> <operand>,D command does. eg. EORB LAST_SEEN,D

    In the code below STATUS is the incoming bit.

    Any insight would be helpful, thanks.

    Code:
    SYN		EQU 016H
    STATUS		EQU 007H	;port 4 data
    BITCOUNT	RMB 1
    MOTION_BIT	RMB 1
    LAST_SEEN	RMB 1
    
    	LDAA #8
    	STAA BITCOUNT,D
    	CLRA		;SET TO NON-SYNC
    RS_SYNC
    	LDAB STATUS	;3 GET INITIAL INPUT STATE
    RS_CLQCK1
    	CMPB STATUS	;3 COMPARE TO CURRENT STATE
    	BEQ RS_CLOCK1	;3 LOOP UNTIL WE SEE CLOCK EDGE OR MOTION CHANGE
    ;MAKE SURE WE SPEND AT LEAST 42 uSEC BEFORE WE GO BACK TO RS_SYNC AGAIN
    
    	EORB LAST_SEEN,D	;3 6 GRAB THE PREVIOUS DATA BIT
    	LSLD			        ;3 9 STORE IT AWAY
    	LDAB STATUS		;3 12 DID WE STALL?
    	STAB LAST_SEEN,D
    	BITB MOTION_BIT,D
    	BEQ RS_STALLED		;3 21 IF SO, SIGNAL ERROR
    	NOP			;2 23 WE CAN'T LEAVE LOOP UNTIL AT LEAST
    	NOP			;2 25 42 uSEC HAVE GONE BY
    	NOP			;2 27
    	NOP			;2 29
    	NOP			;2 31
    	NOP			;2 33
    	NOP			;2 35
    	NOP			;2 37
    	BRN $			;3 40
    	CMPA #SYN
    	BNE RS_SYNC
    	RTS

  2. #2
    Join Date
    Feb 2011
    Location
    NorthWest England (East Pondia)
    Posts
    2,228
    Blog Entries
    10

    Default

    Whilst there are plenty of chip manuals around with details of the internals, e.g.

    http://www.bitsavers.org/components/...nual_May84.pdf

    I suspect you don't fine a lot on programming the 6801 because its really a 6800 with on chip IO and extra instructions to allow AB ro be used as a 16-but register so mostly normal 6800 manuals are ok...
    There were a number of different 68xx assemblers and I suspect in this case ",D" forces short addressing so expects LAST_SEEN to be in the first 256 bytes of memory.
    The standard Motorola assembler mentioned in the reference manual does not have the option to force direct addressing so I can't be sure..
    ... but on the other hand the programmer expects the "EORB LAST_SEEN,D" to take three clock cycles, and only the "direct" form of that instruction takes three clock cycles. (page 4-8 or 99 in the above manual...
    Dave
    G4UGM

    Looking for Analog Computers, Drum Plotters, and Graphics Terminals

  3. #3

    Default

    Thanks Dave! That was helpful. Good idea looking at the number of cycles to determine the type of addressing.

  4. #4

    Default

    The Tandy MC10 is 6801/3 so that is one place and group to look for 6801 information. The 6801 is actually way better than the 6800 because it fixed a whole bunch of 'doh should have had an instruction for that' cases. As well as the 16bit maths you can for example push and pop the index register, and add b to x (which is really useful for compilers).

    The 6801/3 manual lists the extra instructions specifically and then there are a few more in the even nicer HD6303 series processors.

    There is a Leventhal book on the 6800 like every other period processor in the universe

    Alan

  5. #5

    Default

    I have 2 MC10s and discovered that I like the 6801/6803 assembly language. Not too far off the 6809 (my favorite processor). I have HUMBUG for the CoCo and the MC10 but the MC10 code is actual just 6800 code with a few changes. Probably based on HUMBUG for the SWTPC 6800 boards.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •