Last active
September 19, 2015 12:26
-
-
Save norbekaiser/f5a610a19cbe367c4922 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bit_to_a_0: | |
bta_0: | |
cmp ch,9 | |
jg bta_1 | |
add ch,'0' | |
jmp bta_fin | |
bta_1: | |
sub ch,10 | |
add ch,'a' | |
bta_fin: | |
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execution: | |
mov bh,0x7f | |
mov [hex_string+0x7c00],bh | |
call print_hex_string | |
jmp infloop | |
times 510-($-$$) db 0 | |
dw 0xaa55 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jmp execution | |
hex_string: | |
db '0x00',0 | |
infloop: | |
jmp $ | |
print_string: | |
mov ah,0x0e | |
add bx,0x7c00 | |
ps_l: | |
mov al,[bx] | |
cmp al,0 | |
je psfin | |
int 0x10 | |
inc bx | |
jmp ps_l | |
psfin: | |
ret | |
print_hex_string: | |
mov [hex_string+0x7c00],bh | |
mov bl,0 | |
phs_B: | |
cmp bh,16 | |
jng phs_A | |
sub bh,16 | |
inc bl | |
jmp phs_B | |
phs_A: | |
;; Umrechnen in A oder 0 | |
mov ch,bl | |
call bit_to_a_0 | |
mov bl,ch | |
mov [hex_string+0x7c00+2],bl | |
mov ch,bh | |
call bit_to_a_0 | |
mov bh,ch | |
mov [hex_string+0x7c00+3],bh | |
mov bh,'0' | |
mov [hex_string+0x7c00],bh | |
mov bx,hex_string | |
call print_string | |
ret | |
bit_to_a_0: | |
bta_0: | |
cmp ch,9 | |
jg bta_1 | |
add ch,'0' | |
jmp bta_fin | |
bta_1: | |
sub ch,10 | |
add ch,'a' | |
bta_fin: | |
ret | |
execution: | |
mov bh,0x7f | |
mov [hex_string+0x7c00],bh | |
call print_hex_string | |
jmp infloop | |
times 510-($-$$) db 0 | |
dw 0xaa55 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print_hex_string: | |
mov [hex_string+0x7c00],bh | |
mov bl,0 | |
phs_B: | |
cmp bh,16 | |
jng phs_A | |
sub bh,16 | |
inc bl | |
jmp phs_B | |
phs_A: | |
mov ch,bl | |
call bit_to_a_0 | |
mov bl,ch | |
mov [hex_string+0x7c00+2],bl | |
mov ch,bh | |
call bit_to_a_0 | |
mov bh,ch | |
mov [hex_string+0x7c00+3],bh | |
mov bh,'0' | |
mov [hex_string+0x7c00],bh | |
mov bx,hex_string | |
call print_string | |
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print_hex_string: | |
mov [hex_string+0x7c00],bh | |
mov bl,0 | |
cmp bh,0 | |
jg phs_B | |
add bl,8 | |
add bh,128 | |
phs_B: | |
cmp bh,16 | |
jng phs_A | |
sub bh,16 | |
inc bl | |
jmp phs_B | |
phs_A: | |
mov ch,bl | |
call bit_to_a_0 | |
mov bl,ch | |
mov [hex_string+0x7c00+2],bl | |
mov ch,bh | |
call bit_to_a_0 | |
mov bh,ch | |
mov [hex_string+0x7c00+3],bh | |
mov bh,'0' | |
mov [hex_string+0x7c00],bh | |
mov bx,hex_string | |
call print_string | |
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Booting from Hard Disk... | |
0x7f | |
Booting from Hard Disk... | |
0x8f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment