File:  [Research Unix] / researchv10dc / cmd / icon / setup / unixpc / rover.s
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 3 months ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

	file "arith.s"

	global	runerr
	global	ckadd
	global	cksub
	global	ckmul

 text
 even
ckadd:
        link    %a6,&0
        mov.l   8(%a6),%d0      # Perform addition
        add.l   12(%a6),%d0     #  " " "
        #jvs     oflow           # Branch if overflow
	trapv			# This trap untested!!
        unlk    %a6
        rts                     # Return result in d0

 even
cksub:
        link    %a6,&0
        mov.l   8(%a6),%d0      # Perform subtraction
        sub.l   12(%a6),%d0     #  " " "
        #jvs     oflow           # Branch if overflow
	trapv
        unlk    %a6
        rts                     # Return result in d0

 even
ckmul:
        link    %a6,&0
        mov.l   8(%a6),%d0     # Perform multiplication
        muls.w  12(%a6),%d0    #  " " "
	trapv
        #jvs     oflow           # Branch if overflow
        unlk    %a6
        rts                    # Return result in d0

oflow:                         # Got overflow on an operation
        pea     0
        pea     203
        jsr    runerr          # runerr(203,0)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.