6 Replies - 8369 Views - Last Post: 23 May 2009 - 10:00 AM

#1 jay2009   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 14-May 09

printing A-Z on the screen -- 6800 project

Post icon  Posted 14 May 2009 - 04:07 AM

has anyone here program a program call 6800....

i have trouble of getting my code to work..

here is my code...
;this program fills the screen with A-Z
; across the screen

; Print "A-Z" to the screen

; using the start Of Screen as a constant
screen 	.equ $FB00

; Find the start of the screen
; Use the 16bit index register
 		ldx #screen

; Prepare 'A' for printing
reset 	 ldaa #'A'

; Print 'A' at position 
; start of screen 
start	  staa 0,x

 		inx
		
	 	inca
	 

			jmp start

;compare X
 		cpx #$FF38		

		.end


i want to fill the screen with A-Z.. not sure what i need to do to make it fill the screen....it said i need two loop to make it work but i dont know how to make two loop.....


thanks

This post has been edited by jay2009: 14 May 2009 - 04:15 AM


Is This A Good Question/Topic? 0
  • +

Replies To: printing A-Z on the screen -- 6800 project

#2 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: printing A-Z on the screen -- 6800 project

Posted 14 May 2009 - 08:17 AM

First off let me warn you that I have never written a line of 6800 code before and I don't have any way to test (I downloaded an emulator but have no idea how to use it).

Basically you need to use conditional branching. You increase accumulator A until you reach past 'Z' and then you reset it to 'A' -- You also need to check to see if you have reach end end of the screen, if so, then end the program.


So this is an attempt to show what I mean in 6800. I have no idea if it is correct syntax:
;THIS PROGRAM FILLS THE SCREEN WITH A-Z
; ACROSS THE SCREEN

; PRINT "A-Z" TO THE SCREEN

; USING THE START OF SCREEN AS A CONSTANT
SCREEN	 .EQU $FB00

; FIND THE START OF THE SCREEN
; USE THE 16BIT INDEX REGISTER
			LDX #SCREEN

; PREPARE 'A' FOR PRINTING
RESET	   LDAA #'A'

;WRITE A TO SCREEN LOCATION
START	   STAA 0,X

;INCREASE X TO NEXT SCREEN LOCATION
			INX
;INCREASE A TO NEXT LETTER
			INCA
;TEST TO SEE IF X == END OF SCREEN
			CPX #$FF38
;IF X == END OF SCREEN THEN END PROGRAM
			BEQ END
;TEST TO SEE IF A > 'Z'
			CMPA #'Z'
;IF A > 'Z' THEN JUMP TO START
			BGT RESET
;ELSE JUMP TO START TO WRITE NEXT CHAR.
			BRA START
;WE SHOULD ONLY GET HERE WITH X == FF38
;I.E. AFTER ALL CHARS HAVE BEEN WRITTEN
END   

		.END

Was This Post Helpful? 0
  • +
  • -

#3 ken09   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 19
  • Joined: 02-April 09

Re: printing A-Z on the screen -- 6800 project

Posted 18 May 2009 - 04:32 AM

if u want to dl the emulator to test the code u should dl it from here...

6800 emulator
http://www.hvrsoftware.com/6800emu.htm

correct me if i'm wrong....... i have use 6800 before...but i find it hard to program...........


i think to test the program u need to enter the code and then hit the button Run.

this will test if ur code are working or no.......

This post has been edited by ken09: 18 May 2009 - 05:07 AM

Was This Post Helpful? 1
  • +
  • -

#4 jay2009   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 14-May 09

Re: printing A-Z on the screen -- 6800 project

Posted 18 May 2009 - 05:14 AM

i tested the program and there is like some error "label End"..

i cant seem to find the problem.........

thanks

This post has been edited by jay2009: 18 May 2009 - 05:14 AM

Was This Post Helpful? 0
  • +
  • -

#5 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: printing A-Z on the screen -- 6800 project

Posted 18 May 2009 - 08:09 AM

So now that I have an emulator that makes sense:
screen	 .equ $fb00
			ldx #screen
reset	   ldaa #'a'
start	   staa 0,x
			inx
			inca
			cpx #$ff38
			beq theend
			cmpa #'z'
			bgt reset
			bra start
theend		nop  
			.end


seems to work for me in the emulator posted above.
Was This Post Helpful? 0
  • +
  • -

#6 jay2009   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 14-May 09

Re: printing A-Z on the screen -- 6800 project

Posted 18 May 2009 - 10:18 PM

thanks alot for ur time and ur help ..........ur good

the program now work...........now i spotted the error....end should of be theend lol...


thanks
Was This Post Helpful? 0
  • +
  • -

#7 Dk786   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 20-May 09

Re: printing A-Z on the screen -- 6800 project

Posted 23 May 2009 - 10:00 AM

lower .equ '1
upper .equ '9
ldx #$FFFF
wai
ldab #'0 ;counter
ldaa 0,x
ldx #$FB00
cmpa #lower
blt finish
cmpa #upper
bgt finish
loop staa 0,x Key
inx
incb
cba
bne loop
loopx dex
cpx #$FB00
bne loopx
staa 54,x
ldaa Key
Key .byte 0
finish .end


Hi, Soory Last time I did not post the code becoz I did not read instructions. I made this code but it prints a number instead of X and it is showing in only two 2 by 2.
For example: In this program when I press 5, so It should print 5 by 5 "X" . Please help me to resolve this problem.


Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1