According to the documentation you need to put the selector in D0 and the actual value in D1.
Change:
MOVE P,D0 Move P into D0
EXT.L D0
TRAP #15 Display D0 in decimal
to:
MOVE P,D1 Move P into D1
EXT.L D1
MOVE.B #3,D0 Put required TRAP #15 selector (3) in D0
TRAP #15 Display D0 in decimal
Some further clarification: TRAP #15
is a general mechanism for performing various tasks supported by the easy68k environment. In order to specify which task to perform you pass the task selector in D0. Then, depending on which selector you are using, the other parameters also need to be loaded into the correct register(s), typically D1
or A1
.
There's a comprehensive list of selectors on the easy68k web site - the first few selectors are:
TRAP #15 is used for I/O. Put the task number in D0.
Task
0 Display string at (A1), D1.W bytes long (max 255) with carriage return and line feed (CR, LF). (see task 13)
1 Display string at (A1), D1.W bytes long (max 255) without CR, LF. (see task 14)
2 Read string from keyboard and store at (A1), NULL terminated, length retuned in D1.W (max 80)
3 Display signed number in D1.L in decimal in smallest field. (see task 15 & 20)
...