Calculation of Pi approximation by dividing 355 to 113.
Program outputs digits (one by one) of the result into the register S, which can be observed by the user.
Executed program listing:
; var a
MOVI A, 1 ; 00: 10000000 00000001
MOVI B, 99 ; 01: 10000001 01100011
; var b
MOVI M, 113 ; 02: 10000100 01110001
Main:
Div:
MOVI L, 0 ; 03: 10000110 00000000
Loop:
SUB D, B, M ; 04: 01011011 00011100
SBC C, A, 0 ; 05: 01010010 10001000
JMP C, Exit ; 06: 10110111 00001011
ADD L, L, 1 ; 07: 01001110 11101001
MOV B, D ; 08: 00011001 00110000
MOV A, C ; 09: 00011000 00100000
JMP Loop ; 0a: 10000111 00000100
Exit:
; Display next digit in S
MOV S, L ; 0b: 00011101 01100000
; rem * 2 still less than 256
ADD D, B, B ; 0c: 01001011 00011001
; rem * 4
ADD B, D, D ; 0d: 01001001 00111011
ADC A, A, A ; 0e: 01000000 00001000
; rem * 8
ADD B, B, B ; 0f: 010
1 view
197
50
4 weeks ago 00:02:41 1
Mufasa: The Lion King | Visionary Storyteller | Only In Theaters December 20
2 months ago 00:16:57 1
Клон ZX Spectrum “Азбука“ - Обзор и разбор
3 months ago 00:03:26 1
Mission: Impossible/Best scene/Brian De Palma/Tom Cruise/Jon Voight/Emmanuelle Béart
3 months ago 00:03:26 1
Cctv installation course chennai | sk computer technologies
3 months ago 00:02:35 2
Mufasa: The Lion King | Official Trailer
4 months ago 00:04:31 1
Crypto Nodes | How to Buy Crypto Node | Passive Income Ideas
4 months ago 00:02:36 1
COGNITIVE RESEARCHERS are targeting ORGANS OF CONTROL for TRAINING, RESEARCH & DEVELOPMENT
5 months ago 00:17:53 1
Начал собирать ламповый компьютер!
5 months ago 00:14:27 8
“ GUNNERY IN THE B-29 “ ANIMATED B-29 SUPERFORTRESS CREW TURRET COMPUTER TRAINING FILM 19584
5 months ago 00:46:40 1
РИН-609 Самый редкий терминал темной эпохи советских ЭВМ!
6 months ago 00:09:32 1
Wargames (1983) Part 2 WOPR Gets the iCBM Launch Codes HD Global Thermonuclear War