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