This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Program to calculate factorial using looping | |
| NUM: DW 0x6 ; calculate factorial of 6 | |
| RESULT: DW 0 ; place to store the reult | |
| ; actual entry point of the program | |
| start: | |
| MOV CX,word NUM ; move number into cx | |
| MOV AX, 0x1 ; initialize accumulator with 1 | |
| NOTZEROLOOP: ; label to jump back to | |
| MUL CX ; multiple by the number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Program to calculate LCM of two numbers | |
| no1: dw 0x6 ; number 1 | |
| no2: dw 0x12 ; number 2 | |
| gcd: dw 0 ; place to store gcd | |
| ; actual entry point of the program | |
| start: | |
| mov ax, word no1 ; move number 1 in accumulatore | |
| mov bx, word no2 ; move number 2 in register BX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Program to add two word length numbers | |
| OPR1: DW 0x6969 ; declare first number | |
| OPR2: DW 0x0420 ; declare second number | |
| RESULT: DW 0 ; declare place to store result | |
| ; actual entry point of the program | |
| start: | |
| MOV AX, word OPR1 ; move first number to AX | |
| MOV BX, word OPR2 ; move second number to BX | |
| CLC ; clear the carry flag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Program to calculate the factorial of a number i.e. n! | |
| ; Finally, factorial will be stored in register A | |
| ; Load number for which factorial will be calculated, into register B | |
| MOV B, 5 | |
| ; Initialize accumulator with 1 (as factorial calculation will go from 1 to number) | |
| MOV A, 1 | |
| ; LOOP to calculate factorial |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Program to compare two numbers and find the greater number | |
| ; Finally, greater number will be stored in register A | |
| ; Load first value in register A | |
| MOV A, 47 | |
| ; Load second value in register B | |
| MOV B, 32 | |
| ; Compare the values in registers A and B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; Program to calculate sum of two numbers | |
| ; Finally, sum will be stored in register A | |
| ; Load first value in register A | |
| MOV A, 10 | |
| ; Load second value in register B | |
| MOV B, 10 | |
| ; Add contents of registers A and B, store result in A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "client": "Thunder Client", | |
| "collectionName": "blockchain-interaction-commands", | |
| "dateExported": "2023-08-04T07:57:26.934Z", | |
| "version": "1.1", | |
| "folders": [], | |
| "requests": [ | |
| { | |
| "_id": "b395a4c2-2365-4a5e-ab7b-eebe61ff918f", | |
| "colId": "6ffd056b-4a07-42ed-894b-b8a43a517039", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import required libraries | |
| from django.http import HttpResponse | |
| from django.shortcuts import render | |
| from web3 import Web3 | |
| # Initialize web3 connection | |
| web3 = Web3(Web3.HTTPProvider('http://10.0.2.15:8545')) | |
| # Define contract address and ABI (Application Binary Interface) | |
| contract_address = '0x4235d917d3420BF5adf03aE5146701B87D179752' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>numberStore - Client Side</title> | |
| <script src="https://cdn.jsdelivr.net/npm/web3@1.5.2/dist/web3.min.js"></script> | |
| <script> | |
| const abi = [{"stateMutability": "nonpayable", "type": "function", "name": "setNumber", "inputs": [{"name": "_number", "type": "uint256"}], "outputs": []}, {"stateMutability": "nonpayable", "type": "function", "name": "getNumber", "inputs": [], "outputs": [{"name": "", "type": "uint256"}]}, {"stateMutability": "view", "type": "function", "name": "storedNumber", "inputs": [], "outputs": [{"name": "", "type": "uint256"}]}]; | |
| const address = '0x4235d917d3420BF5adf03aE5146701B87D179752'; | |
| // Connect to MetaMask on page load |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>numberStore - Server Side</title> | |
| <script src="https://cdn.jsdelivr.net/npm/web3@1.5.2/dist/web3.min.js"></script> | |
| <script> | |
| // Connect to MetaMask on page load | |
| window.addEventListener('load', async () => { | |
| // Modern dapp browsers... | |
| if (window.ethereum) { | |
| window.web3 = new Web3(window.ethereum); |
NewerOlder