HP 9835A Programming Manual page 25

35 series desktop computer assembly development rom
Table of Contents

Advertisement

Getting Started
11
Now that the routine has been developed, it is necessary to get it into the memory of the
machine as a program. This is done by preceding each and every assembly language statement
with the keyword ISOURCE and entering it as a program line. The process of entering (with the
keyword included) is the same as with any other BASIC statement - so you can use EDIT or
AUTO and the
8
key in the same way you normally enter any BASIC statement. (This
process is fully described in the "Program Entry" section of this chapter.)
The final result of entering the routine would look something like -
;:::: C
I :::
otJ
F:' C E
:3i:::i
I ::;()!...!F:C[
12[1 jSOi...lF:CE::
.I,
,,::OJ::.'
I
::::;UU~:CE
1.
40 I :::;C)i,JF\:::E
i 50 I ::::OU
F:CE
i6~]
I'::::O!...H:;::C[
i ?Ci I :::OUF:CE
:!.f:~j
E;O:".iF:CE
: ! .
' : :+i
I ' : ::OU::;::C[:::
NAM Multipl ication
i
B8]inning of module
E>-::T [r'i""'or'"" . . ,e::,::
'j
t,
:::;,:::' t
',),:j,
' i ' . .
,i!:::'.
Put
',)d,! i,.j!:::'
!
!...it
j
' i
' 1 1:.
' !
e:::,
Integers:
H~~
ar8a for integers cr8ated
I
('lPi,..!t
i ::
Ii···!T
I npt.Jt
~2::
Cil...!tPi,..it ::
Multiply:
LDA =Integers
,.1"::::
rii :::; ' : :' t
',},3,
1
i)
e
L . .
DH :::
I l"';t~'e(;iei'-':::,+:L
L . . DB ::: I
nput
~:::
,J::::;I"1
(;,:::'t
'),:::;,
' i
ue
LDH Inte':;lei''''::::,
L.Ii A
=
I
t-1
t
E-
:;;~ ~:'
! .... ::::.
LI1I:;
=Cil ..
~'t. f:)t~t
Indicates 81try pJint follows
I nC!'i C.:::i.t
E':::·
it'j
( i t
~:'!;iE:'r"
r)::j. (' . :::!.
fl"let
E'r-':::·
·::i~·-·i:::·
f)::t::::·~::'i::'cj
' i ri t
1'''iE
Cit-·C!E:·!· .. · !~'i
i)!:::'r"i
!:::::)
t!·-!e~::.t-::·
statemefits and are
giv8~
n~~es
f:i
c t
iM.f.~i
' !
!:::'
I"'!
t
(.~)
1::::Ci ' i
i"' 1
t
( r-i,::j, rfi
E' :
I'll
!)
1
t
' i
I:)'j
~)
) ;:
r'()I...Jt
' !
n~:'
l:::,,:::' , ::) ' ! n::::, b::.!
'fe-t
<::
h
'j
(p;i ,:::I.C 'i:,
I .. ,~:i
' I
' ) .::1.1
i,..i
e ()
f
t
1' ' ' 1
e
i
i''',
pu
t
p::i
rOO, , : : : ; , r;'p:::"i:,
eT :::'
from
BASIC
and storing them where
the routine can use them
arithmetic accumulator and
f
'j
n,:::;.
'II::.!
i'fiU
'j
t
'j
i:) ':
'j
e:::, t j''',er;',
H
c hec
k
fOi,'"
O')':::'i''''f 'j 01 ..
.1
'j :::'
t:"::'
r"'t''(:'r'''rned
L.! ':..' ,
i' · ·'
ec k
i i";
(J
1:. :.", ,:::'
e::::,
i,,'; :
t
f ':)(" ,"' " ",
' i :. i''''
c ,,",""
~md
the
rc~tine
is aborted
!
The product is then returned to the
c! u
t.
~)i_,l
t
!,).::t.
r"
i
,:~,1::!
' 1
E-
i
i,Hi
:B
~::1
:::;
I C:
-~'j ~::.
t
E:'(]
among the arguments
END Multipl ication
This source code demonstrates the three critical items in assembly subprograms. First, a routine
has to be part of a module; modules are delimited with the NAM and END pseudo-instructions
(see lines 10 and 270 in the source). Second, a routine has to have an entry point; this consists
of a SUB pseudo-instruction (see line 40), any parameters (see lines 50 through 70), and a
name (the label used on the first machine instruction following the SUB, see line 80). Finally, a
routine must be able to return to the BASIC program which called it; this is accomplished with
the RET 1 instruction (see line 260).
The NAM, END, and SUB pseudo-instructions are discussed in Chapter 4. The RET 1 instruc-
tion is discussed in Chapter 3.

Advertisement

Table of Contents
loading

Table of Contents