Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;działanie (2+a)^3+(1+b)^3-(c+2*(a+8)*3)*b/4-6-17
- jmp start
- db a
- db 00
- db 10
- ;-------Hardware Timer--------------------------------------------------------------------
- org a
- nop
- nop
- nop
- nop
- nop
- iret
- ;-----------------------------------------------------------------------------------------
- ;-----Keyboard Handler--------------------------------------------------------------------
- org 10
- cmp dl, 0
- jz obliczenia
- CLI
- push al
- pushf
- in 08
- sub al, 30
- out 01
- out 05
- add cl, 1
- mov [cl], al
- nop
- nop
- nop
- nop
- nop
- popf
- pop al
- dec dl
- STI
- iret
- ;-----------------------------------------------------------------------------------------
- start:
- mov al, 24
- out 01 ;światła
- mov al, 10
- out 05 ;karuzela
- mov dl, 3
- mov cl, 05
- in 00
- cmp al, 38
- jz nope
- jmp koniec
- ;----------PĘTLA--------------------------------------------------------------------------
- nope:
- STI
- out 08
- idle:
- nop
- nop
- nop
- jmp idle
- ;------------------------------------------------------------------------------------------
- obliczenia:
- ;-------przekładam sobie wartości z tablicy------------------------------------------------
- mov al, [06]
- add al, 2
- mov bl, [07]
- inc bl
- mov cl, [08]
- call 68
- ;-------pierwszy nawias do potęgi 3--------------------------------------------------------
- org 68
- push al
- pop dl
- mul al, dl
- mul al, dl
- out 01
- out 05
- ;-------drugi nawias do potęgi 3-----------------------------------------------------------
- push bl
- pop dl
- mul bl, dl
- mul bl, dl
- ;-------------------------------------------------------------------------------------------
- add al, bl
- push al
- ret
- ;-----na stosie teraz jest wynik pierwszej części działania--------------------------------
- ;------liczenie (c+2*(a+8)*3)*b/4----------------------------------------------------------
- mov al, [06]
- add al, 8 ;(a+8)
- mul al, 3 ;(a+8)*3
- mul al, 2 ;(2*(a+8)*3)
- add al, cl ;(c+2*(a+8)*3)
- mov dl, [07]
- div dl, 4
- mul al, dl ;(c+2*(a+8)*3)*b/4
- ;-----zrzucenie ze stosu wyniku pierwszej części-------------------------------------------
- pop bl
- sub bl, al ;(2+a)^3+(1+b)^3-(c+2*(a+8)*3)*b/4
- push bl
- ;------------------------------------------------------------------------------------------
- ;------tutaj wróci program po skończeniu procedury-----------------------------------------
- jmp koniec
- ;koniec programu----zmiana gier------------------------------------------------------------
- koniec:
- ;------DALSZA CZĘŚĆ PROGRAMU----------------------------------------------------------------
- pop al
- sub al, 6
- add al, ef ;-17
- out 01
- out 05
- push al
- pop bl ;wynik działania w BL!
- call c0
- ;-----DEFINITYWNY KONIEC PROGRAMU----------------------------------------------------------
- org c0
- mov al, 90
- out 01
- mov al, f9
- add al, 6
- out 05
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement