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 05-25-2008, 11:14 PM
trevordunstan trevordunstan is offline
Newbie
 
Join Date: May 2008
Posts: 3
Rep Power: 0
trevordunstan is on a distinguished road
Default program to display student number

Hey there guys, how is everyone,

I am doing a computer engineering module at uni and have an assignement to produce a program on thrsim11 software to display my student number 1 digit at a time on a seven segment display. I have written a basic test program to do this but I am having trouble getting the numbers to display correctly. I know the hexpat data is correct as I have tested it but when i run the program all the segments on the LED light up and then turn off after the loop has finished. Would someone look over my code and tell me if I am going about this the right way or am I totally off course. Any advice or help would be greatly appreciated

Cheers guys !! sorry for the bad formatting
Code:
prb equ $1004 Peripheral port B
ddrb equ $1006 Data direction register B
prc equ $1003 Peripheral port C
ddrc equ $1007 Data direction register C
delay equ $bd4 value for 1 second time delay
program equ $00a0 start address of program
reset equ $fffe reset vector
eod equ $23 end of data


org $0000
hexpat fcb $3f,$03 hexpat 0-9
fcb $5b,$4f
fcb $66,$6d
fcb $7d,$07
fcb $7f,$6f
studnumber fcc '0085755#'


org program
start
ldaa #$ff all port B line output
staa ddrb set port B lines
ldaa #$01 pc0 line output
staa ddrc set port C lines

ldy #studnumber point index register Y to first student number digit
next ldab 00,y load first digit into Accum B
cmpb #eod compare EOD marker
beq stop if EOD stop program
andb $0f convert to binary
ldx #hexpat point indx reg X to hexpat
abx add offset ie add accum B to index reg X
ldaa 00,x get hexpat into accum a

staa prb output display word
ldaa #$00 get enable word
staa prc enable the display
ldab #$01 counter for loop 2
loop2 ldx #delay counter for 1 second delay
loop1 dex decrement counter 1
bne loop1
decb decrement counter 2
bne loop2 display (1 X 10 sec)
ldaa #$01 get disable word
staa prc disable display
iny increment index Y to point to next digit
bra next repeat process until EOD
stop jmp stop end of program

org reset
fdb start set reset vector to start

Last edited by WingedPanther; 05-27-2008 at 12:22 PM. Reason: add code blocks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
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
Tutorial: Starting C# with C# 2008 Express Edition Jordan CSharp Tutorials 19 08-08-2008 01:48 PM
Windows Shortcut List - Saves Time 2stamlers The Lounge 6 04-10-2008 07:58 AM
Help with Square root and calculator program!!! 123456789asdf C and C++ 10 12-02-2007 05:35 PM


All times are GMT -5. The time now is 06:25 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