Lost Password?


Go Back   CodeCall Programming Forum > Software Development > General Programming

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-2006, 01:56 PM
Jonas Jonas is offline
Newbie
 
Join Date: Jul 2006
Posts: 25
Rep Power: 9
Jonas is on a distinguished road
Default 6502 Machine Language

I was waxing a bit nostaligc to my early computer days. My first real programming came in basic, but then from there I was engrossed in the apple II 6502 machine language. Writing code in hexadecimal was amazingly fun.

Just curious if anyone else here had any experience with the old apple 6502 machine language.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-13-2006, 06:16 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,232
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

I've never heard of this language. Got any code you can paste in?
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-13-2006, 10:47 PM
Nightracer's Avatar   
Nightracer Nightracer is offline
Programmer
 
Join Date: Jun 2006
Posts: 131
Rep Power: 9
Nightracer is on a distinguished road
Default

I have no experience with this and Im sure the code looks very alien!
It would really be very complex and probably take 100x the time it takes to complete programming tasks with modern languages.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-14-2006, 04:25 PM
DevilsCharm's Avatar   
DevilsCharm DevilsCharm is offline
Programming God
 
Join Date: Jul 2006
Posts: 887
Rep Power: 14
DevilsCharm is on a distinguished road
Default

What's the deal with this "hexadecimal" thing? I have no idea what that means, and it sounds incredibly complex.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-15-2006, 08:13 PM
Jonas Jonas is offline
Newbie
 
Join Date: Jul 2006
Posts: 25
Rep Power: 9
Jonas is on a distinguished road
Default

You guys are so lucky. I used to own this book back in the day. Now it is online for free. I think the last publication was 1983.

http://www.atariarchives.org/mlb/

Here is part of the code from a game called microchess:

Code:
;***********************************************************************
;
;  MicroChess (c) 1996-2002 Peter Jennings, peterj@benlo.com 
;
;***********************************************************************
; I have been given permission to distribute this program by the
; author and copyright holder, Peter Jennings.  Please get his 
; permission if you wish to re-distribute a modified copy of 
; this file to others.  He specifically requested that his 
; copyright notice be included in the source and binary images.
; Thanks! 
;
; modified by Daryl Rictor to work over a serial terminal connection, August 2002.
;
; 6551 I/O Port Addresses
;
ACIADat	= 	$7F70
ACIASta	=	$7F71
ACIACmd	=	$7F72
ACIACtl	=	$7F73
;
; page zero variables
;
BOARD   =	$50 
BK      =	$60 
PIECE   =	$B0 
SQUARE  =	$B1 
SP2     =	$B2 
SP1     =	$B3 
INCHEK  =	$B4 
STATE   =	$B5 
MOVEN   =	$B6 
REV	=       $B7
OMOVE   =	$DC 
WCAP0   =	$DD 
COUNT   =	$DE 
BCAP2   =	$DE 
WCAP2   =	$DF 
BCAP1   =	$E0 
WCAP1   =	$E1 
BCAP0   =	$E2 
MOB     =	$E3 
MAXC    =	$E4 
CC      =	$E5 
PCAP    =	$E6 
BMOB    =	$E3 
BMAXC   =	$E4 
BMCC    =	$E5 		; was BCC (TASS doesn't like it as a label)
BMAXP   =	$E6 
XMAXC   =	$E8 
WMOB    =	$EB 
WMAXC   =	$EC 
WCC     =	$ED 
WMAXP   =	$EE 
PMOB    =	$EF 
PMAXC   =	$F0 
PCC     =	$F1 
PCP     =	$F2 
OLDKY   =	$F3 
BESTP   =	$FB 
BESTV   =	$FA 
BESTM   =	$F9 
DIS1    =	$FB 
DIS2    =	$FA 
DIS3    =	$F9 
temp    =       $FC
;
;
;
		*=$1000			; load into RAM @ $1000-$15FF

		LDA     #$00		; REVERSE TOGGLE
		STA     REV
                JSR     Init_6551
CHESS		CLD			; INITIALIZE
		LDX	#$FF		; TWO STACKS
		TXS	
		LDX	#$C8
		STX	SP2
;		
;       ROUTINES TO LIGHT LED
;       DISPLAY AND GET KEY
;       FROM KEYBOARD
;		
OUT		JSR	pout		; DISPLAY AND
		JSR	KIN		; GET INPUT   *** my routine waits for a keypress
;		CMP	OLDKY		; KEY IN ACC  *** no need to debounce
;		BEQ	OUT		; (DEBOUNCE)
;		STA	OLDKY
;		
		CMP	#$43		; [C]
		BNE	NOSET		; SET UP
		LDX	#$1F		; BOARD
WHSET		LDA	SETW,X		; FROM
		STA	BOARD,X		; SETW
		DEX	
		BPL	WHSET
		LDX	#$1B		; *ADDED
		STX	OMOVE		; INITS TO $FF
		LDA	#$CC		; Display CCC
		BNE	CLDSP
;		
NOSET		CMP	#$45		; [E]
		BNE	NOREV		; REVERSE
		JSR	REVERSE        	; BOARD IS
		SEC
		LDA	#$01
		SBC	REV
		STA	REV		; TOGGLE REV FLAG
		LDA	#$EE            ; IS
		BNE	CLDSP
;		
NOREV		CMP	#$40			; [P]
		BNE	NOGO           	; PLAY CHESS
		JSR	GO
CLDSP		STA	DIS1          	; DISPLAY
		STA	DIS2         	; ACROSS
		STA	DIS3          	; DISPLAY
		BNE	CHESS
;		
NOGO		CMP	#$0D            ; [Enter]
		BNE	NOMV          	; MOVE MAN
		JSR	MOVE          	; AS ENTERED
		JMP	DISP
NOMV		CMP     #$41		; [Q] ***Added to allow game exit***
		BEQ     DONE		; quit the game, exit back to system.  
		JMP	INPUT		; process move
DONE		JMP     $FF00		; *** MUST set this to YOUR OS starting address
;		
;       THE ROUTINE JANUS DIRECTS THE
;       ANALYSIS BY DETERMINING WHAT
;       SHOULD OCCUR AFTER EACH MOVE
;       GENERATED BY GNM
;		
;		
;
JANUS		LDX	STATE
		BMI	NOCOUNT
;		
;       THIS ROUTINE COUNTS OCCURRENCES
;       IT DEPENDS UPON STATE TO INDEX
;       THE CORRECT COUNTERS
;		
COUNTS		LDA	PIECE
		BEQ	OVER           	; IF STATE=8
		CPX 	#$08           	; DO NOT COUNT
		BNE	OVER          	; BLK MAX CAP
		CMP	BMAXP        	; MOVES FOR
		BEQ	XRT           	; WHITE
; 		
OVER		INC	MOB,X          	; MOBILITY
		CMP 	#$01           	;  + QUEEN
		BNE	NOQ           	; FOR TWO
		INC	MOB,X
;		
NOQ		BVC	NOCAP
		LDY	#$0F           	; CALCULATE
		LDA	SQUARE       	; POINTS
ELOOP		CMP	BK,Y           	; CAPTURED
		BEQ	FOUN          	; BY THIS
		DEY			; MOVE
		BPL	ELOOP
FOUN		LDA	POINTS,Y
		CMP	MAXC,X
		BCC	LESS          	; SAVE IF
		STY	PCAP,X         	; BEST THIS
		STA	MAXC,X         	; STATE
;		
LESS		CLC	
		PHP			; ADD TO
		ADC	CC,X           	; CAPTURE
		STA	CC,X           	; COUNTS
		PLP	
;		
NOCAP		CPX	#$04
		BEQ	ON4
		BMI	TREE          	;(=00 ONLY)
XRT		RTS	
;		
;      GENERATE FURTHER MOVES FOR COUNT
;      AND ANALYSIS	
;		
ON4		LDA	XMAXC        	; SAVE ACTUAL 
		STA	WCAP0         	; CAPTURE
		LDA	#$00           	; STATE=0
		STA	STATE
		JSR	MOVE          	; GENERATE
		JSR	REVERSE       	; IMMEDIATE
		JSR	GNMZ         	; REPLY MOVES  
		JSR	REVERSE
;		
		LDA	#$08       	; STATE=8
		STA	STATE        	; GENERATE
;		JSR	OHM          	; CONTINUATION
		JSR	UMOVE         	; MOVES
;		
		JMP	STRATGY       	; FINAL EVALUATION
NOCOUNT	CPX	#$F9
		BNE	TREE
;		
;      DETERMINE IF THE KING CAN BE
;      TAKEN, USED BY CHKCHK
;		
		LDA	BK           	; IS KING
		CMP	SQUARE       	; IN CHECK?
		BNE	RETJ          	; SET INCHEK=0
		LDA	#$00           	; IF IT IS
		STA	INCHEK
RETJ		RTS	
;		
;      IF A PIECE HAS BEEN CAPTURED BY
;      A TRIAL MOVE, GENERATE REPLIES &
;      EVALUATE THE EXCHANGE GAIN/LOSS
;		
TREE		BVC	RETJ          	; NO CAP
		LDY	#$07           	; (PIECES)
		LDA	SQUARE
LOOPX		CMP	BK,Y
		BEQ	FOUNX
		DEY	
		BEQ	RETJ          	; (KING)
		BPL	LOOPX         	; SAVE
FOUNX		LDA	POINTS,Y       	; BEST CAP
		CMP	BCAP0,X        	; AT THIS
		BCC	NOMAX         	; LEVEL
		STA	BCAP0,X
NOMAX		DEC	STATE
		LDA	#$FB           	; IF STATE=FB
		CMP	STATE        	; TIME TO TURN
		BEQ	UPTREE        	; AROUND
		JSR	GENRM         	; GENERATE FURTHER
UPTREE		INC	STATE        	; CAPTURES
		RTS	
;		
;      THE PLAYER'S MOVE IS INPUT
;		
INPUT		CMP	#$08           	; NOT A LEGAL
		BCS	ERROR      	; SQUARE #
		JSR	DISMV
DISP		LDX	#$1F
SEARCH		LDA	BOARD,X
		CMP	DIS2
		BEQ	HERE          	; DISPLAY
		DEX			; PIECE AT    
		BPL	SEARCH        	; FROM
HERE		STX	DIS1         	; SQUARE
		STX	PIECE
ERROR		JMP	CHESS
;		
;      GENERATE ALL MOVES FOR ONE
;      SIDE, CALL JANUS AFTER EACH
;      ONE FOR NEXT STE?
;		
;
<snip>
;
; end of file
It is scary that I can understand most of that without having touched it for 20 plus years.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-19-2006, 05:16 PM
Kaabi's Avatar   
Kaabi Kaabi is offline
Programming God
 
Join Date: Jul 2006
Posts: 884
Rep Power: 14
Kaabi is on a distinguished road
Default

Is that some kind of chess program or something? I saw it mentioning a lot of things relating to chess so I assume it is.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-19-2006, 10:48 PM
icepack's Avatar   
icepack icepack is offline
Programmer
 
Join Date: Jul 2006
Location: North Carolina
Posts: 115
Rep Power: 9
icepack is on a distinguished road
Send a message via AIM to icepack
Default

^ MicroChess (c) 1996-2002 Peter Jennings, peterj@benlo.com
first line
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 07-20-2006, 07:47 PM
Crane's Avatar   
Crane Crane is offline
Programming Expert
 
Join Date: Nov 2005
Posts: 399
Rep Power: 14
Crane is on a distinguished road
Default

Wow, that is hard looking code Jonas! So that is what you use to do for a job?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
new C-like programming language kenna Software Development Tools 14 09-03-2008 03:34 PM
Choosing the right language Athene General Programming 30 09-01-2008 04:12 PM
Best Language to Learn? icepack General Programming 38 07-30-2008 07:29 PM
D Programming Language. R-G General Programming 2 04-12-2007 12:22 PM
What language to Learn? mevets General Programming 20 12-20-2006 10:04 AM


All times are GMT -5. The time now is 06:44 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads