Figure 2-1. Sample Program Listing - HP 64793 Series User Manual

H8/338/329 emulator softkey interface
Table of Contents

Advertisement

.GLOBAL
.GLOBAL
.SECTION
Msgs
Msg_A
.SDATA
Msg_B
.SDATA
Msg_I
.SDATA
End_Msgs
.SECTION
;****************************************************
;*
Set up the Stack Pointer
;****************************************************
Init
MOV.W
;****************************************************
;* Clear previous command
;****************************************************
Clear
MOV.B
MOV.B
;****************************************************
;* Read command input byte.
;* entered, continue to scan for it.
;****************************************************
Scan
MOV.B
CMP.B
BEQ
;****************************************************
;* A command has been entered.
;* command A, command B, or invalid command.
;****************************************************
Exe_Cmd
CMP.B
BEQ
CMP.B
BEQ
BRA
;****************************************************
;* Command A is entered.
;* in message A.
R4 = location of the message.
;* Jump to the routine which writes the message.
;****************************************************
Cmd_A
MOV.B
MOV.W
BRA
;****************************************************
;* Command B is entered.
;****************************************************
Cmd_B
MOV.B
MOV.W
BRA
;****************************************************
;* An invalid command is entered.
;****************************************************
Cmd_I
MOV.B
MOV.W
Init,Msgs,Cmd_Input
Msg_Dest
Table,DATA
"THIS IS MESSAGE A"
"THIS IS MESSAGE B"
"INVALID COMMAND"
Prog,CODE
#Stack,R7
#H'00,R0L
R0L,@Cmd_Input
If no command has been
@Cmd_Input,R2L
#H'00,R2L
Scan
Check if it is
#H'41,R2L
Cmd_A
#H'42,R2L
Cmd_B
Cmd_I
R3L= the number of bytes
#Msg_B-Msg_A,R3L
#Msg_A,R4
Write_Msg
#Msg_I-Msg_B,R3L
#Msg_B,R4
Write_Msg
#End_Msgs-Msg_I,R3L
#Msg_I,R4

Figure 2-1. Sample Program Listing

Getting Started 2-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

64793a64793b

Table of Contents