fork download
  1. use16 ;Генерировать 16-битный код
  2. org 100h ;Программа начинается с адреса 100h
  3.  
  4. mov al,[a] ;Загружаем значение a в AL
  5. mov ah,[b] ;Загружаем значение b в AH
  6. add ah,[c] ;AH = AH + c = b+c
  7. dec ah ;AH = AH - 1 = b+c-1
  8. sub al,ah ;AL = AL - AH = a-(b+c-1)
  9. mov cl,[d] ;CL = d
  10. neg cl ;CL = -CL = -d
  11. add al,cl ;AL = AL + CL = a-(b+c-1)+(-d)
  12. mov [e],al ;Сохраняем результат в e
  13.  
  14. mov ax,4C00h ;\
  15. int 21h ;/ Завершение программы
  16. ;-------------------------------------------------------
  17. a db 2
  18. b db 3
  19. c db 5
  20. d db -8
  21. e db ?
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.s: Assembler messages:
prog.s: Warning: end of file not at end of a line; newline inserted
prog.s:1: Error: no such instruction: `use16'
prog.s:1: Error: invalid character (0xd0) in mnemonic
prog.s:2: Error: no such instruction: `org 100h'
prog.s:2: Error: invalid character (0xd0) in mnemonic
prog.s:4: Error: invalid char '[' beginning operand 2 `[a]'
prog.s:4: Error: invalid character (0xd0) in mnemonic
prog.s:5: Error: invalid char '[' beginning operand 2 `[b]'
prog.s:5: Error: invalid character (0xd0) in mnemonic
prog.s:6: Error: invalid char '[' beginning operand 2 `[c]'
prog.s:6: Error: junk at end of line, first unrecognized character is `='
prog.s:7: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
prog.s:7: Error: junk at end of line, first unrecognized character is `='
prog.s:8: Error: too many memory references for `sub'
prog.s:8: Error: junk at end of line, first unrecognized character is `='
prog.s:9: Error: invalid char '[' beginning operand 2 `[d]'
prog.s:10: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
prog.s:10: Error: junk at end of line, first unrecognized character is `='
prog.s:11: Error: too many memory references for `add'
prog.s:11: Error: junk at end of line, first unrecognized character is `='
prog.s:12: Error: invalid char '[' beginning operand 1 `[e]'
prog.s:12: Error: invalid character (0xd0) in mnemonic
prog.s:14: Error: too many memory references for `mov'
prog.s:14: Error: junk at end of line, first unrecognized character is `\'
prog.s:15: Error: junk `h' after expression
prog.s:15: Error: operand size mismatch for `int'
prog.s:16: Error: junk at end of line, first unrecognized character is `-'
prog.s:17: Error: no such instruction: `a db 2'
prog.s:18: Error: no such instruction: `b db 3'
prog.s:19: Error: no such instruction: `c db 5'
prog.s:20: Error: no such instruction: `d db -8'
prog.s:21: Error: no such instruction: `e db?'
prog.s: Error: symbol definition loop encountered at `AH'
prog.s: Error: invalid operands (*GAS `expr' section* and *UND* sections) for `+' when setting `AH'
prog.s: Error: Invalid operation on symbol
prog.s: Error: can't resolve value for symbol `AH'
prog.s: Error: symbol definition loop encountered at `AL'
prog.s: Error: symbol definition loop encountered at `CL'
prog.s: Error: invalid operand (*GAS `expr' section* section) for `-' when setting `CL'
stdout
Standard output is empty