Character Counting? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Character Counting?

Hi all,
Here is a 86k Motorola ASM program I have written. What it does is
accept keystrokes, echos them to the screen and stores them at memory
position $2400. It also should display the character count. As far
as can tell everything works except the character count isnt
displayed. But I dont get any errors. So I think I have set-up my
traps wrong in the finished section? Any help appreciated!

org $1000
move.l #$7ffe,sp
move.l #string,a6
clr.w d0 * zero the counter
next_key move.b #247,d7
trap #14
cmp.b #cr,d0
beq finished
move.b d0,(a6)+
move.b #248,D7
trap #14
add.w #1,d0 * bump count
bra next_key
finished move.b #228,d7
trap #14
move.w #248,d7 * display count
trap #14
data org $2400
string ds.b 100
cr equ $0d
end
Sign In or Register to comment.