allow me to ask again. coz im really don't know how to write a program to my trainning kit.
my lecture show me the 7 segment program, such as:-
* 7 segment interface-one digit counter
begin org $080c00
move.b #$80,$10000d * set PACR to mode 1x
move.b #$ff,$100005 * set PADDR to output
move.b #$80,$10000f * set PBCR to mode 1x
move.b #$ff,$100007 * set PBDDR to output
ddd clr d0 *clear the first digit of 7-segment
eee bsr display *brand to display sub-routine
move.l d0,d1 *copy the content of d0, to d1 register
cmpi #$09,d1 *compare value 9 with d1
beq ddd *if equal branch to ddd sub-routine
addi #$01,d1 *else then add one to d1 which mean d1=d1+1
move.l d1,d0 *then copy the register d1 data to d0 register
bra eee *loop to routine eee
display: *display routine
move.l #$00ff,d5 *store $FF to d5 register as a temp. counter
repeat move.b #$fe,$100011 *activate the lsb digit (the first 7-seg digit)
move.b d0,$100013 *display the d0 data to port B
bsr delay *branch to delay routine
subq.l #$1,d5 *d5 = d5 -1
bne repeat *check d5 value =0? If not equal branch to repeat
rts *else return to sub-routine
delay move.l #$01ff,d6 *delay sub-routine
del1 subq.l #1,d6
bne del1
rts
end begin *end of program
and also the input switch code:-
begin org $080C00
move.b #$80,$10000d
move.b #$00,$100005
move.b #$80,$10000f
move.b #$ff,$100007
move.b #$00,$100013
read move.b $100011,d0 *get data from input switches
move.w #0,d3 *exit service routine
trap #0
end begin
my class trainer gv me this 2 mnemonic code and ask me to study my self then write a program that:
press the 1st button, 7 segment will show out the number increase,
press the 2nd button, 7 segment will show out the number decrease.
he never teach me any thing,
can anybody teach me how to write the programme?