Example Assembler

This commit is contained in:
Paul Warren 2024-02-20 19:16:57 +11:00
parent 6eeb2ef28e
commit 0ef9f81dee
1 changed files with 59 additions and 2 deletions

View File

@ -88,8 +88,65 @@ WAIT : 0c 00001100
\ :
</pre>
<p> <a href="/hillbilly1/ADD16.asm">Here</a> is an example 16 bit adder program for the DAVIAC-1.</p>
<p> The Assembler produces the <a href="/hillbilly1/ADD16.hex">Hex</a> and a <a href="/hillbilly1/ADD16.lst">run list</a>.
<p> <a href="/hillbilly1/ADD16.asm">Here</a> is an example 16 bit adder program for the DAVIAC-1.</p>
<pre>
\ RAM Variables
ORG 0800H \RAM at 0800h
DEF X_Lo *1
DEF X_Hi *1
DEF Y_Lo *1
DEF Y_Hi *1
DEF Z_Lo *1
DEF Z_Hi *1
DEF Carry_Lo *1
DEF Carry_Hi *1
ORG 0400h
\
\ load some numbers
\
\ Put numbers in X and Y at 0800H by hand from Control Panel.
\
\
\ 16bit ADD X + Y -> Z + Carry_Hi
\
\
NOP
ADD16:
WAIT
STAZ Carry_Lo \Clear lo carry
LDAA X_Lo
LDAB Y_Lo
ADD \ADD lo bytes
STAC Z_Lo \store partial sum
BRNO ADD16J1: \test OVF bit to see if Carry required
LDIA 01h \must be OVF, set a Carry_Lo
STAA Carry_Lo
ADD16J1:
STAZ Carry_Hi \Clear hi carry
LDAA X_Hi
LDAB Y_Hi
ADD \ADD hi bytes
STAC Z_Hi \store hi partial sum
BRNO ADD16J2:
LDAA 01h \might be a hi carry
STAA Carry_Hi
ADD16J2:
MOVC,A
LDAB Carry_Lo \include any lo carry
ADD
STAC Z_Hi
BRNO ADD16J3:
LDAA 01h
STAA Carry_Hi \which may trigger a hi carry
ADD16J3:
\
BRA ADD16:
\
\ end of ADD16p
</pre>
<p> The Assembler produces the <a href="/hillbilly1/ADD16.hex">Hex</a> and a <a href="/hillbilly1/ADD16.lst">run list</a>.
</div>
<?php include("footer.php"); ?>