Code: Select all
SECTION .text
start:
mov ax, 0x07C0
mov ds, ax
mov es, ax
mov sp, stack_end
Code: Select all
.calc:
.calcloop:
mov si, math_prompt
call print_string
mov di, buffer
call get_string
mov si, buffer
mov di, math_plus
call strcmp
jc .plus
jmp mainloop
.plus:
mov si, math_prompt_fnum
call print_string
mov di, buffer
call get_string
mov si, buffer
push stack_end
mov si, math_prompt_num2
call print_string
mov di, buffer
call get_string
pop stack_begin
mov si, di
mov di, buffer
add si, di
call print_string
jmp .done
.done:
ret
Code: Select all
SECTION .bss
stack_begin:
resb 4096
stack_end: