My 6502 chip runs & stops

For discussing the 65xx hardware itself or electronics projects.
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Post by 8BIT »

No, there is no linker needed.

:? However, my last post was in error. Here is the help screen from TASS.

Code: Select all

Syntax:  TASS [options] source [object] [listing]
/?, /h   Display this help screen
/w       Ignore warning messages
/n       Generate nonlinear output file
/c       Allow 65C02 mnemonics
/a       Convert ASCII to PETASCII
/m       Don't put monitor code into listing
/s       Don't put source code into listing
/l<name> Generate a file with all labels
The /L switch adds a label file, not an assembly listing.

My standard TASS command line looks something like this:

Code: Select all

TASS source.asm source.obj source.lst
where source.asm is the source file, the binary object file is source.obj, and the assembly listing is source.lst

I use a batch file to call TASS (thats why I was wrong in my earlier post...I didn't have my working TASS computer running and I tried to use my memory... I must remember to expand it from 1kx8 to a 2kx8 :) )

Here is the batch file:

Code: Select all

c:
cd\design\tass
tass %1 tass.obj tass.lst
This way, I can drag a source file from Windows Explorer and drop it on the batch file. The output files are labeled "tass.obj" and "tass.lst" Those get overwritten each time I call TASS.

Hope this clears things up!

Daryl
folorunsoa
Posts: 15
Joined: 11 Oct 2005

NO DIFFERENCE

Post by folorunsoa »

The situation is still the same with the downloaded TASS assembler. Both the OBJ and the LST files are trash. The command:

tass source.asm source.obj source.lst command did not work for the three.
It worked for two that is either tass source.asm source.obj or
tass source.asm source.lst. However both the obj and lst files were trash. Could it be that it was not working properly because the TASS software was not registered for commercial use as prompted below?

C:\design\tass>tass testprox.asm
6502 Turbo Assembler Shareware Version Copyright (c) 1997 Taboo Productions
This program HASN'T BEEN REGISTERED for use in commercial purposes!

Assembling file: testprox.asm
Error messages: None
Warning messages: None
Passes: 2
Range: $f000-$fffd
Remaining memory: 481k
folorunsoa
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Post by 8BIT »

the only issue with not registering is that you cannot use the CMOS instruction set. In other words, the "/c" option is disabled.

I'm not sure why your output files are being corrupted.

Daryl
folorunsoa
Posts: 15
Joined: 11 Oct 2005

Post by folorunsoa »

How I wished things had worked out positively for me so I can smile. Instead, I am now at my wit's end. In despiration I went on to download TASM28 from www.programmersheaven.com. It generated list file alright but it was all errors (44 Errors). Can you please help? The TESTPRO.ASM file is attached below.

Thank you.


;T-Junction SIGNALLISATION

CODE1=$F800 ;LIGHTING SEQUENCE
CODE2=$F810 ;LIGHTING SEQUENCE
TIME =$F820 ;TIMING SEQUENCE
DDRA =$A003 ;DATA DIRECTION REG.A
DDRB =$A002 ;DATA DIRECTION REG.B
IOPA =$A001 ;O/P PORT A
IOPB =$A002 ;O/P PORT B
T1CL =$A005 ;T1 COUNTER LOW
T1CH =$A006 ;T1 COUNTER HIGH
IFR =$A00D ;INTERRUPT FLAG REG.
MEM1 =$0100 ;TEMPORARY MEMORY
MEM2 =$0101 ;TEMPORARY MEMORY
MEM3 =$0102 ;TEMPORARY MEMORY

.ORG $F800
.BYTE $92,$51,$30,$30,$28,$25,$26,$26,$6E
.ORG $F810
.BYTE $12,$12,$96,$99,$95,$B3,$43,$22,$12
.ORG $F820
.BYTE $0F,$05,$03,$0B,$05,$03,$09,$05,$03

.ORG $F000
START
LDA #$ff ;INITIALISE DDRA
STA DDRA ;AND DDRB AS
STA DDRB ;OUTPUT REGISTERS
L1 LDX #$08 ;LOAD REG.X WITH SEQUENCE VALUE
L2 LDA $F800,X ;LOAD ACC. WITH CODE1 INDEX X
STA IOPA ;STORE IN I/O PORT PA
LDA $F810,X ;LOAD ACC. WITH CODE2 INDEX X
STA IOPB ;STORE IN I/O PORT PB
JSR TIMER ;CALL DELAY
DEX ;DECREMENT REG.X
BPL L2 ;IF PLUS REPEAT
JMP L1 ;BEGIN AGAIN

;TIMER SUBROUTINE

TIMER LDA $F820,X ;LOAD ACC. WITH TIMING INDEX X
STA MEM1 ;STORE IN TEMPORARY MEMORY 1
JSR INTVL ;CALL 1.00-SEC INTERVAL
L3 DEC MEM1 ;DECREMENT MEMORY 1
BPL L3 ;IF PLUS REPEAT
RTS ;RETURN FROM SUBROUTINE

;1.00-SEC INTERVAL SUBROUTINE

INTVL LDY #$14 ;LOAD REG. Y WITH 20
L4 LDA #$50 ;INITIALISE VIA TIMER
STA T1CL ;COUNTER LOW & HIGH
LDA #$C3 ;TO OBTAIN A VALUE
STA T1CH ;OF 0.05 SEC.
TIMUT LDA IFR ;CHECK FOR
AND #$20 ;END OF
BEQ TIMUT;COUNT
DEY ;DECREMENT REG. Y TO COUNTDOWN
BNE L4 ;IF NOT REPEAT
RTS ;RETURN FROM SUBROUTINE
.ORG $FFFC ;RESET VECTOR
.BYTE $00,$F0
.END
folorunsoa
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Post by 8BIT »

OK. I downloaded the TASM28 and tried it on your code.

I initially got 66 errors but was able to correct those.
It now compiles correctly.

This is the command line I used (my source file was named "test.asm")

TASM -65 test.asm

Here is the source code:

Code: Select all

;T-Junction SIGNALLISATION 

CODE1 =$F800 ;LIGHTING SEQUENCE 
CODE2 =$F810 ;LIGHTING SEQUENCE 
TIME =$F820 ;TIMING SEQUENCE 
DDRA =$A003 ;DATA DIRECTION REG.A 
DDRB =$A002 ;DATA DIRECTION REG.B 
IOPA =$A001 ;O/P PORT A 
IOPB =$A002 ;O/P PORT B 
T1CL =$A005 ;T1 COUNTER LOW 
T1CH =$A006 ;T1 COUNTER HIGH 
IFR =$A00D ;INTERRUPT FLAG REG. 
MEM1 =$0100 ;TEMPORARY MEMORY 
MEM2 =$0101 ;TEMPORARY MEMORY 
MEM3 =$0102 ;TEMPORARY MEMORY 

.ORG $F800 
.BYTE $92,$51,$30,$30,$28,$25,$26,$26,$6E 
.ORG $F810 
.BYTE $12,$12,$96,$99,$95,$B3,$43,$22,$12 
.ORG $F820 
.BYTE $0F,$05,$03,$0B,$05,$03,$09,$05,$03 

.ORG $F000 
START 
 LDA #$ff ;INITIALISE DDRA 
 STA DDRA ;AND DDRB AS 
 STA DDRB ;OUTPUT REGISTERS 
L1 LDX #$08 ;LOAD REG.X WITH SEQUENCE VALUE 
L2 LDA $F800,X ;LOAD ACC. WITH CODE1 INDEX X 
 STA IOPA ;STORE IN I/O PORT PA 
 LDA $F810,X ;LOAD ACC. WITH CODE2 INDEX X 
 STA IOPB ;STORE IN I/O PORT PB 
 JSR TIMER ;CALL DELAY 
 DEX ;DECREMENT REG.X 
 BPL L2 ;IF PLUS REPEAT 
 JMP L1 ;BEGIN AGAIN 

;TIMER SUBROUTINE 

TIMER LDA $F820,X ;LOAD ACC. WITH TIMING INDEX X 
 STA MEM1 ;STORE IN TEMPORARY MEMORY 1 
 JSR INTVL ;CALL 1.00-SEC INTERVAL 
L3 DEC MEM1 ;DECREMENT MEMORY 1 
 BPL L3 ;IF PLUS REPEAT 
 RTS ;RETURN FROM SUBROUTINE 

;1.00-SEC INTERVAL SUBROUTINE 

INTVL LDY #$14 ;LOAD REG. Y WITH 20 
L4 LDA #$50 ;INITIALISE VIA TIMER 
 STA T1CL ;COUNTER LOW & HIGH 
 LDA #$C3 ;TO OBTAIN A VALUE 
 STA T1CH ;OF 0.05 SEC. 
TIMUT LDA IFR ;CHECK FOR 
 AND #$20 ;END OF 
 BEQ TIMUT;COUNT 
 DEY ;DECREMENT REG. Y TO COUNTDOWN 
 BNE L4 ;IF NOT REPEAT 
 RTS ;RETURN FROM SUBROUTINE 

.ORG $FFFC ;RESET VECTOR 
.BYTE $00,$F0 
.END
Two things that I did were to indent the lines without labels so that the OP codes are not in the first column. I also added a space after the label names CODE1 and CODE2. It did not like the equals sign (=) next to the label name.

Give this one a try....

Daryl
folorunsoa
Posts: 15
Joined: 11 Oct 2005

"ZERO ERROR ASSEMBLY"

Post by folorunsoa »

Thank you Daryl. I can now assemble with zero error. I think a little smile is not a bad idea. Now the next step is to load the generated object file on to the EPROM (I have 2716 and 2732 Eproms). Remember I once mentioned that I have an EXPRO-80 Eprom Programmer. Can I have a step by step procedure please. The PC82 software has been installed and running but there is no README file for a green horn like me to rely upon for a tutorial.
Thanks once again.
folorunsoa
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Post by 8BIT »

I am not familiar with your programmer or the software.

The usual steps involve installing the part, verifying its blank, loading the source file, then programming and verifying the burn.

There should be some choices for loading the source file. Binary and Intel HEX are the two I have used.

If you use binary, then your object file should work. One note on that. You will need to get the assembler to fill-in the unused locations so that the object file is the same size as your address map. in other words, if you write your code to start at $C000 and you need the vectors at $FFFA-FFFF, then your object file should end up being 16,384 bytes.

I do not know the TASM assembler, so you may need to read the help resources in order to set the proper flags or add the right macros.

Good luck!

Daryl
leeeeee
In Memoriam
Posts: 347
Joined: 30 Aug 2002
Location: UK
Contact:

Re: "ZERO ERROR ASSEMBLY"

Post by leeeeee »

Quote:
Can I have a step by step procedure please. The PC82 software has been installed and running but there is no README file for a green horn like me to rely upon for a tutorial.
Glad to see the software worked.

The manual is available for download from here ..

http://www.danbbs.dk/~rmadrm/expro_m.pdf

.. but the programmer software is fairly simple. Use the cursor keys to highlight menus or menuitems and the enter key to select them. ESC will get you back to the main screen.

Lee.
folorunsoa
Posts: 15
Joined: 11 Oct 2005

"HEX - TO - BINARY CONVERSION"

Post by folorunsoa »

Dear Forum Members,

The original object file after a successful assembly exercise is in HEX format. Will the EPROM work if it is programmed using the HEX format? Or is it a MUST that the HEX format be converted to the BINARY format before programming the EPROM?

Thank you.
folorunsoa
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Post by GARTHWILSON »

Intel Hex format is plain text, so you can even write, view, and edit it in a text editor (although it's certainly not practical to write it by hand). Each line starts with a colon (":"), then has a pair of digits telling the record length (ie, how much program data) in that line, then four digits telling the beginning address of the data in that line, a pair of digits telling the data type, then the data itself (usually $10 or $20 pairs of hex digits), and then two digits of checksum. The last line of this text file has no program data but only tells the programmer that the transfer is finished and it should not expect any more data before it begins programming. These extra bytes don't go into the EPROM at all. They're info for the device programmer, not the target computer that uses the EPROM. All the bytes in the text of the Hex file will be in the range of $30 to $3A and $41 to $46, because it's just ASCII, hex digits and the colon (":"). As you can see, that leaves out an awful lot of op codes and operand bytes you'll want. So yes, the EPROM programmer must convert to binary, using the housekeeping bytes to program the binary data into the right locations, check for transfer errors, and know when the end of the data has been reached.
Post Reply