home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug035.ark
/
SPIN.ASM
< prev
next >
Wrap
Assembly Source File
|
1984-04-29
|
1KB
|
50 lines
;SPIN : 7 SEPT,FIXING SETANGL.MOSHELL
; YET ANOTHER TRY TO UNDERSTAND MOD 24 ARITHMETIC.
;
; SPIN ADDS ITS SECOND ARGUMENT TO THE ORIENTATION
; VALUE OF THE OBJECT NAMED BY ITS FIRST ARG. IT
; REDUCES THAT VALUE TO A LEGITIMATE ONE (BETWEEN
; O AND 23 DECIMAL).
;
;
; CALLS: INPAR,OBJR,OBJW
;
ORG 54E0H
INPAR EQU 5030H
OBJR EQU 5006H
OBJW EQU 5009H
;
CALL INPAR
MOV H,E ;STASH OBJ.NAME
CALL INPAR
MOV L,E ;STASH ANGLE.INC.
MVI E,1
MOV D,H
CALL OBJR ;GET THETA INTO A
ADD L ;AND INCREMENT IT.
MOD24: JM NEGFIX ;LT.0...ADD 24 &COME BACK.
CPI 24
JC HOP
SUI 24 ;24>ANGLE?NO;SUBTRACT 24
JMP MOD24 ;AND TRY AGAIN.
HOP: CALL OBJW
RET
;
; SETANG - DIRECTLY SETS THE ANGLE OF THE NAMED
; OBJECT. PARAMS ARE AS IN SPIN.
;
ORG 5500H
CALL INPAR
MOV H,E ;STASH OBJ.NAME
CALL INPAR
MOV A,E
ORA A ;SET FLAGS
MOV D,H ;OBJECT NAME
MVI E,1 ;AND THETA:POSITION
JMP MOD24 ;SMOOTH UP THE SUGGESTED
;ANGLE,WRITE IT OUT.
;
NEGFIX: ADI 24
JMP MOD24
END