English
Language : 

HD6475368CP Datasheet, PDF (23/108 Pages) Agilent(Hewlett-Packard) – H8/536 Emulator PC Interface
Msgs
Msg_A
Msg_B
Msg_I
End_Msgs
.GLOBAL
.GLOBAL
.SECTION
.SDATA
.SDATA
.SDATA
Init,Msgs,Cmd_Input
Msg_Dest
Table,DATA
"Command A entered "
"Entered B command "
"Invalid Command "
.SECTION Prog,CODE
;***********************************************
;* Sets up the stack pointer.
;***********************************************
Init
MOV:G.W
#Stack,R7
;***********************************************
;* Clear previous command.
;***********************************************
Read_Cmd
MOV:G.B
#0,@Cmd_Input
;***********************************************
;* Read command input byte. If no command has
;* been entered, continue to scan for input.
;***********************************************
Scan
MOV:G.B
@Cmd_Input,R0
BEQ
Scan
;***********************************************
;* A command has been entered. Check if it is
;* command A, command B, or invalid.
;***********************************************
Exe_Cmd
CMP:E.B
#H’41,R0
BEQ
Cmd_A
CMP:E.B
#H’42,R0
BEQ
Cmd_B
BRA
Cmd_I
;***********************************************
;* Command A is entered. R1 = the number of
;* bytes in message A. R4 = location of the
;* message. Jump to the routine which writes
;* the messages.
;***********************************************
Cmd_A
MOV:I.W
#Msg_B-Msg_A-1,R1
MOV:I.W
#Msg_A,R4
BRA
Write_Msg
;***********************************************
;* Command B is entered.
;***********************************************
Cmd_B
MOV:I.W
#Msg_I-Msg_B-1,R1
MOV:I.W
#Msg_B,R4
BRA
Write_Msg
Figure 2-2. Sample Program Listing
Getting Started 2-25