Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- format PE Console 4.0
- entry start
- include 'win32a.inc'
- include 'win_macros.inc'
- section '.text' code readable executable
- start:
- clrscr
- mov ecx,0
- mov edx,0
- ustaw_kursor 10,2
- wyswietl txt
- pobierzznak:
- cmp ecx,4
- je bin
- pob_znak
- cmp al,'0'
- jb pobierzznak
- cmp al,'9'
- jbe liczbahex
- cmp al,'A'
- jb pobierzznak
- cmp al,'F'
- jbe literahex
- cmp al,'F'
- ja pobierzznak
- literahex:
- wysw_znak al
- inc edx
- inc ecx
- shl bx,4
- sub al,55
- add bl,al
- jmp pobierzznak
- liczbahex:
- wysw_znak al
- inc edx
- inc ecx
- shl bx,4
- sub al,30h
- add bl,al
- jmp pobierzznak
- bin:
- ustaw_kursor 12,2
- mov ax,bx
- mov ecx,16
- bin1:
- push ecx
- rcl ax,1
- jc bin2
- mov dl,'0'
- jmp bin3
- bin2:
- mov dl,'1'
- bin3:
- pop ecx
- loop bin1
- wyswoct:
- ustaw_kursor 15,2
- wyswietl txt1
- mov ax,bx
- shr ax,15
- add al,30h
- wysw_znak al
- mov ax,bx
- shl ax,1
- shr ax,13
- add al,30h
- wysw_znak al
- mov ax,bx
- shl ax, 4
- shr ax, 13
- add al,30h
- wysw_znak al
- mov ax, bx
- shl ax,7
- shr ax,13
- add al,30h
- wysw_znak al
- mov ax,bx
- shl ax,10
- shr ax,13
- add al,30h
- wysw_znak al
- mov ax,bx
- shl ax, 13
- shr ax, 13
- add al,30h
- wysw_znak al
- koniec:
- ustaw_kursor 17,2
- pob_znak
- je start
- jmp koniec
- zakoncz:
- end_prog
- section '.data' data readable writeable
- txt db 'zmienna Hex = ', NULL
- txt1 db 'zmienna Oct = ', NULL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement