Figure 2-1. Sample Program Listing - HP H8/3003 User Manual

Emulator terminal interface
Table of Contents

Advertisement

002000
002000
002000 5448495320495320
002008 4D45535341474520
002010 41
002011 5448495320495320
002019 4D45535341474520
002021 42
002022 494E56414C494420
00202A 434F4D4D414E44
002031
001000
001000 7A07000FF904
001006 7A01000FF800
00100C F800
00100E 6AA8000FF800
001014 6A2A000FF800
00101A AA00
00101C 47F6
00101E AA41
001020 5870000A
001024 AA42
001026 58700010
00102A 58000018
00102E FB11
001030 7A0400002000
001036 58000014
00103A FB11
00103C 7A0400002011
001042 58000008
1
2
Msgs
3
Msg_A
4
Msg_B
5
Msg_I
6
End_Msgs
7
8
9
;****************************************************
10
;* Set up the Pointers.
11
;****************************************************
12
Init
13
14
;****************************************************
15
;* Clear previous command.
16
;****************************************************
17
Clear
18
19
;****************************************************
20
;* Read command input byte.
21
;* entered, continue to scan for it.
22
;****************************************************
23
Scan
24
25
26
;****************************************************
27
;* A command has been entered.
28
;* command A, command B, or invalid command.
29
;****************************************************
30
Exe_Cmd
31
32
33
34
35
;****************************************************
36
;* Command A is entered.
37
;* in message A.
38
;* Jump to the routine which writes the message.
39
;****************************************************
40
Cmd_A
41
42
43
;****************************************************
44
;* Command B is entered.
45
;****************************************************
46
Cmd_B
47
48

Figure 2-1. Sample Program Listing

.SECTION
Table,DATA,LOCATE=H'2000
.SDATA
"THIS IS MESSAGE A"
.SDATA
"THIS IS MESSAGE B"
.SDATA
"INVALID COMMAND"
.SECTION
Prog,CODE,LOCATE=H'1000
MOV.L
#Stack,ER7
MOV.L
#Cmd_Input,ER1
MOV.B
#H'00,R0L
MOV.B
R0L,@Cmd_Input
If no command has been
MOV.B
@Cmd_Input,R2L
CMP.B
#H'00,R2L
BEQ
Scan
Check if it is
CMP.B
#H'41,R2L
BEQ
Cmd_A
CMP.B
#H'42,R2L
BEQ
Cmd_B
BRA
Cmd_I
R3L = the number of bytes
R4 = location of the message.
MOV.B
#Msg_B-Msg_A,R3L
MOV.L
#Msg_A,ER4
BRA
Write_Msg
MOV.B
#Msg_I-Msg_B,R3L
MOV.L
#Msg_B,ER4
BRA
Write_Msg
Getting Started 2-5

Advertisement

Table of Contents
loading

Table of Contents