From dc7bf2f47d6f97407e3b50ae0b8ab59fd51079e5 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Thu, 14 May 2015 10:44:00 +0200 Subject: moving unused files folder --- boot2/common_pm.asm | 86 ----------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 boot2/common_pm.asm (limited to 'boot2/common_pm.asm') diff --git a/boot2/common_pm.asm b/boot2/common_pm.asm deleted file mode 100644 index c96e1a8..0000000 --- a/boot2/common_pm.asm +++ /dev/null @@ -1,86 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; -;print_string_pm -;print_hex_pm -; -; -; - -[bits 32] - -VIDEO_MEM equ 0xb8000 -WHITE_ON_BLACK equ 0x0f - -;global data -STR_HEX_OUT_PM: - db "0x0000",0 - -; print [ebx] at ecx -print_string_pm: - pusha - mov edx, VIDEO_MEM - add edx,ecx - print_string_pm_loop: - mov al,[ebx] - mov ah, WHITE_ON_BLACK - cmp al,0 - je print_string_pm_done - mov [edx],ax - add ebx,1 - add edx,2 - jmp print_string_pm_loop - -print_string_pm_done: - popa - ret - -;print_hex_pm routine (dx) at ecx -;will print the value of the bx register as hex to the screen -print_hex_pm: - - pusha - - - ;begin with last hex val (hex_out[5]) - mov bx,STR_HEX_OUT_PM+5 - - ;lets loop throuth all 4 'digits' - print_hex_pm_loop: - - ;get least significan hex digit to cx - mov cx,dx - and cx,0x000F - - ;check range (0-9 vs a-f) - cmp cx,10 - jl print_hex_pm_setnum - - ;set hex a-f - mov al,'A'-10 - add al,cl - jmp print_hex_pm_al - - ;set hex 0-9 - print_hex_pm_setnum: - mov al,'0' - add al,cl - - ; set hex_out[bx] to al - print_hex_pm_al: - mov [bx],al - - ;proceed with the next significant hex 'digit' - dec bx - shr dx,4 - - ;check if finished (otherwise loop) - cmp bx,STR_HEX_OUT_PM+1 - jne print_hex_pm_loop - - ;output complete hex string and return to caller - popa - mov bx,STR_HEX_OUT_PM - call print_string_pm - ret -- cgit v1.2.3