I am a newbie in ASM and my professor just skims over each topic so I am having some trouble. My program is supposed to compute a mean and a variance of a group of numbers. For now, I am just trying to get the mean to work. When I compile, it says I have no errors, but I get no output. We have to use the trap 15 method. My code is short, so here it is below. Any help on getting the output to work will be greatly appreciated. I wouldn't be at all surprised if I just wrote it wrong. This is my first program :stupid:
Thanks!
ORG $400
MOVEA.L DATA,A0
CLR.B D3
CLR.B D2
BRA LOOP
MOVE.W D2,MEAN
MOVE.W MEAN,D1
MOVE.B #3,D0
TRAP #15
LOOP MOVE.B (A0),D3
ADD.B D3,D2
SUB.B #7,D3
BEQ DIVE
BRA PLUS
PLUS ADDA.L #1,A0
BRA LOOP
DIVE DIVU #15,D2
RTS
STOP #$2700
*
ORG $1000
DATA DC.B 10,12,8,17,9,22,18,11,23,7,30,22,19,6,7
MEAN DS.L 1
VAR DS.L 1
END $400
Thanks!
ORG $400
MOVEA.L DATA,A0
CLR.B D3
CLR.B D2
BRA LOOP
MOVE.W D2,MEAN
MOVE.W MEAN,D1
MOVE.B #3,D0
TRAP #15
LOOP MOVE.B (A0),D3
ADD.B D3,D2
SUB.B #7,D3
BEQ DIVE
BRA PLUS
PLUS ADDA.L #1,A0
BRA LOOP
DIVE DIVU #15,D2
RTS
STOP #$2700
*
ORG $1000
DATA DC.B 10,12,8,17,9,22,18,11,23,7,30,22,19,6,7
MEAN DS.L 1
VAR DS.L 1
END $400
it seems to be running together. Here's a file. Sorry!
LavaLamp27,
Your code seems another cpu, asm language, not masm, right?
Seems easy, but i don't know about this language except for
my guess about some code, BRA may be "branch above" etc.
If you really want to get some help, you'd better attach docs
about your asm language, and compilers, etc...
regards.
Your code seems another cpu, asm language, not masm, right?
Seems easy, but i don't know about this language except for
my guess about some code, BRA may be "branch above" etc.
If you really want to get some help, you'd better attach docs
about your asm language, and compilers, etc...
regards.
This like 6800x asm opcodes. (i dont sure) But what platform? or OS ?
If your code was written by some common asm(such as masm),
you would get answer immeiately, i guess, most of this forum's
"code worriors" use that!
but as your asm, a few man knows that, i guess.
so If you really want to get some info, u should provide
some more infomation about yours...
then, someone would get answer...
you would get answer immeiately, i guess, most of this forum's
"code worriors" use that!
but as your asm, a few man knows that, i guess.
so If you really want to get some info, u should provide
some more infomation about yours...
then, someone would get answer...
All the prof has said and that I can see from the book etc, is it is 68000 Motorola Assembly for Windows platforms.
Thanks all for any help and sorry I didnt reply sooner!
Thanks all for any help and sorry I didnt reply sooner!