Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Archive » net.micro.cbm » roman numerals contest entry (where is ...!looking!... ??)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
roman numerals contest entry (where is ...!looking!... ??) [message #78803] Sun, 02 June 2013 22:53
Anonymous
Karma:
Originally posted by: aaz@pucc-k (Marc Mengel)
Message-ID: <617@pucc-k>
Date: Sun, 25-Nov-84 22:59:34 EST
Article-I.D.: pucc-k.617
Posted: Sun Nov 25 22:59:34 1984
Date-Received: Tue, 27-Nov-84 03:45:21 EST
Organization: Undue Purversity
Lines: 32


; roman numerals print routine for contest
; 6502 version by Marc Mengel &
;		  Kevin Braunsdorf
;	Purdue University {ihnp4|decvax}pur-ee!pucc-i!aaz
;	25 Nov 1984

table0	dfb	1 ,4 ,5 ,9 ,10 ,40 		; values
	dfb	45 ,49, 50 ,90 ,95 ,99 ,100

table1	txt	'iivixxvilxvic'			; first characters

table2	dfb	00,'v',00,'x',00,'l'		; second characters
	dfb	'll',00,'ccc', 00
 
roman	ldx	#12				; length of table
loop1	cmp	table0,x			; >= table value?
	bcc	nosub
	sbc	table0,x			; yes !!
	pha					; save decremented value
	lda	table1,x
	jsr	PRINT				; print letters
	lda	table2,x			; ascii 0 does nothing
	jsr	PRINT
	pla					; recover value
	bne	loop1				; looks better as jmp...
nosub	dex					; bottom of table??
	bpl	loop1
stop	rts					; yes!! go home
	end	roman			; total number of byte 66
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Software for B128
Next Topic: MSD disk drive query
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Apr 19 12:10:42 EDT 2024

Total time taken to generate the page: 0.02235 seconds