Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Evaluate Expression
sys_exit equ 1 sys_read equ 3 sys_write equ 4 stdin equ 0 stdout equ 1 section .data endl db 0xA section .bss arg1: resb 1 arg2: resb 2 operator: resb 1 char: resb 1 section .text global _start _start: beginReadingLoop: ; read a single character mov eax, sys_read mov ebx, stdout mov ecx, char mov edx, 1 int 0x80 ; store character inside al register for using cmp mov al, [char] ; check what the character is and go to corresponding tag ; read arg1, then read the operator, then read the arg2 before evaluation cmp al, '.' je end cmp al, ' ' je beginReadingLoop cmp al, 10 ; LF (Line Feed) je beginReadingLoop cmp al, '0' jge readArgument readArgument: cmp al, '9' jg beginReadingLoop ; make sure it is actually something from 0 to 9. mov al, [arg1] cmp al, '+' je addition cmp al, '-' je subtraction cmp al, '*' je multiplication cmp al, '/' je division cmp al, '\' je division addition: subtraction: multiplication: division: end: int 0x80 mov eax, sys_exit xor ebx, ebx int 0x80
run
|
edit
|
history
|
help
0
Group Lab 1
accept and display 16 digit
text.asm
Joker
helloworldgroup1
mpl01.asm
Fib
Что нужно знать Java программисту
CMSC313 First Program Group Lab
dsafdfdsfds