Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- int main()
- {
- char result, result2;
- printf("(b2*w4+d2)-w1*(w2/b1+d1/w3)");
- _asm {
- //1- b2*w4
- Multiplication b2, w4
- //2- (1+d2)
- Addition mw1, d2 //храниться в cw1
- //3- w2/b1
- Division w2, b1
- //4- d1/w3
- Division2 d1, w3
- //5- (3+4)
- Addition2 dw1, result
- //6- w1*5
- Multiplication w1, result2
- //7- (2-6)
- Subtraction cw1, result2
- _add macro
- pop ax
- pop bx
- add ax, bx
- push ax
- endm
- _sub macro
- pop ax
- pop bx
- sub ax, bx
- push ax
- endm
- _div macro
- pop ax
- cwd
- pop bx
- div bx
- push ax
- endm
- _mul macro
- pop ax
- pop bx
- mul bx
- push ax
- endm
- Addition macro cw1, cw2
- push cw1
- push cw2
- _add
- pop cw1
- endm
- Addition2 macro cw1, cw2
- push cw1
- push cw2
- _add
- pop result2
- endm
- Subtraction macro rw, sw
- push sw
- push rw
- _sub
- pop rw
- endm
- Division macro dw1, dw2
- push dw2
- push dw1
- _div
- pop dw1
- endm
- Division2 macro dw1, dw2
- push dw2
- push dw1
- _div
- pop result
- endm
- Multiplication macro mw1, mw2
- push mw2
- push mw1
- _mul
- pop mw1
- endm
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment