2 Replies - 1628 Views - Last Post: 19 February 2010 - 12:08 PM

#1 carltech   User is offline

  • What did you call me?
  • member icon

Reputation: 28
  • View blog
  • Posts: 997
  • Joined: 19-October 07

OS Color Spin Loop

Posted 24 November 2009 - 12:05 AM

Description: Using NASM compile this into a bin and boot from it using either a floppy or virtual machine. I made a bootable iso with UltraIso and booted it in a VM using VirtualBox.This boot file makes a cool effect while looping through all of the bios colors.
;BootColor.bin
;written by Chris Carlin
;to compile:
;nasm -f bin BootColor.asm -o BootColor.bin
	
	org 07c00h		;sets the origin to where the bios should look
	
	mov al, 13h		;function to set graphics mode
	mov ah, 0	
	int 10h     	; set graphics video mode. 
	
	mov al, 1100b	;set color to light red
	mov cx, 0
	mov dx, 0
	mov ah, 0ch
	int 10h     	;set pixel.
	
l:	;loop entry point
	
	add cx,1
	add dx,1
	int 10h			;set pixel again
	
	cmp cx, 0FFFFh	;if count is at max of word
	je next			;goto next

	jmp l 			;goes back to top of loop if cx isn't at FFFF
	
next:	;sets up for next color
	cmp al,1111b 	;check to see if the color limit is met
	je reset			;Then jumps to reset color
	add al, 0001b	;increment color by 1
	mov dx, 0
	mov cx, 0
	jmp l			;back to loop
	
reset:	;resets color
	mov al, 0000b
	jmp l			;goes back to the loop
	


Is This A Good Question/Topic? 0
  • +

Replies To: OS Color Spin Loop

#2 vir0e5   User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 30-October 09

Re: OS Color Spin Loop

Posted 31 January 2010 - 02:34 AM

Nice code....!!!
Was This Post Helpful? 0
  • +
  • -

#3 carltech   User is offline

  • What did you call me?
  • member icon

Reputation: 28
  • View blog
  • Posts: 997
  • Joined: 19-October 07

Re: OS Color Spin Loop

Posted 19 February 2010 - 12:08 PM

Thank you
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1