OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fp/] [implementation/] [mmix/] [halves.mms] - Blame information for rev 54

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 15 hellwig
% Example program ... 2^-n in decimal
2
%
3
       LOC #2000000000000000 % Data segment
4
HALF   BYTE '5'
5
       LOC  @+'0'-1
6
       BYTE "0011223344"     % Table of half-digits
7
DATA   BYTE '1',0
8
%
9
       GREGTOP $g250
10
pbase  GREG DATA-1
11
half   GREG HALF
12
p      GREG 0
13
starp  GREG 0
14
carry  GREG 0
15
acc    GREG 0
16
       LOC  #1000
17
Main   OR   p,pbase,0        % p = &DATA-1.
18
       SETL carry,0          % carry = 0.
19
       JMP  1F
20
Loop   ADD  acc,acc,carry    % acc += carry.
21
       ZSOD carry,starp,5    % carry = 5[*p odd].
22
       STB  acc,p,0          % *p = acc.
23
1H     LDB  starp,p,1
24
       INCL p,1              % p++.
25
       LDB  acc,half,starp  % acc = half[*p].
26
       PBNZ starp,Loop       % repeat until *p='\0'.
27
       STB  acc,p,0          % *p = '5'.
28
       JMP  Main             % repeat indefinitely.
29
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.