Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bits 16
- segment data
- s dw -15 ; short s = -15
- us dw 25 ; unsigned short us = 25
- c db -8 ; char c = -8
- uc db 0; unsigned char uc = 0
- segment code
- ..start:
- mov ax,[s] ; ax = s
- cmp ax,0 ; porovnam
- jl else_s
- neg ax ; s = -s
- jmp konec_podm_s
- else_s:
- imul word 15 ; ax = ax * 15
- konec_podm_s:
- ; zavolame fci pro vypis cisla
- push ax ; jeji parametr bude mit hodnotu ax
- call far printNumber ; zavolame fci
- ; v ax bude stale stejna hodnota
- mov dx,[us] ; dx = us
- zacatek_cyklu:
- cmp dx,10
- ja konec_while
- sub dx,2
- imul word 4 ; ax = ax * 4
- jmp zacatek_cyklu
- konec_while:
- mov bl,[c] ; bx = c
- zacatek_do_while:
- add bl,4 ; bx = bx + 4
- add dx,ax ; dx = dx + ax
- cmp bl,0
- jbe zacatek_do_while
- mov cl,129
- zacatek_for: ; budu opakovat dokud cx == 0
- sub ax,[uc]; s = s - uc
- loop zacatek_for
- mov bl,'r' ; c(bl) = 'r'
- zacatek_switch:
- case_H:
- cmp bl,'H'
- jne case_65
- mov bl,10
- jmp konec_switch ; == break
- case_65:
- cmp bl,65
- jne case_default
- mov bl,'a' ; bl(c) = 'a'
- jmp konec_switch
- case_default:
- mov bl,0
- konec_switch:
- epilogue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement